mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 20:21:56 +00:00
adapt Tendermint to new abci.Client interface
which was introduced in https://github.com/tendermint/abci/pull/130
This commit is contained in:
@@ -38,7 +38,7 @@ func (a ABCIApp) ABCIQueryWithOptions(path string, data data.Bytes, opts client.
|
||||
func (a ABCIApp) BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) {
|
||||
res := ctypes.ResultBroadcastTxCommit{}
|
||||
res.CheckTx = a.App.CheckTx(tx)
|
||||
if !res.CheckTx.IsOK() {
|
||||
if res.CheckTx.IsErr() {
|
||||
return &res, nil
|
||||
}
|
||||
res.DeliverTx = a.App.DeliverTx(tx)
|
||||
@@ -48,7 +48,7 @@ func (a ABCIApp) BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit
|
||||
func (a ABCIApp) BroadcastTxAsync(tx types.Tx) (*ctypes.ResultBroadcastTx, error) {
|
||||
c := a.App.CheckTx(tx)
|
||||
// and this gets written in a background thread...
|
||||
if c.IsOK() {
|
||||
if !c.IsErr() {
|
||||
go func() { a.App.DeliverTx(tx) }() // nolint: errcheck
|
||||
}
|
||||
return &ctypes.ResultBroadcastTx{c.Code, c.Data, c.Log, tx.Hash()}, nil
|
||||
@@ -57,7 +57,7 @@ func (a ABCIApp) BroadcastTxAsync(tx types.Tx) (*ctypes.ResultBroadcastTx, error
|
||||
func (a ABCIApp) BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error) {
|
||||
c := a.App.CheckTx(tx)
|
||||
// and this gets written in a background thread...
|
||||
if c.IsOK() {
|
||||
if !c.IsErr() {
|
||||
go func() { a.App.DeliverTx(tx) }() // nolint: errcheck
|
||||
}
|
||||
return &ctypes.ResultBroadcastTx{c.Code, c.Data, c.Log, tx.Hash()}, nil
|
||||
|
@@ -37,8 +37,8 @@ func TestABCIMock(t *testing.T) {
|
||||
BroadcastCommit: mock.Call{
|
||||
Args: goodTx,
|
||||
Response: &ctypes.ResultBroadcastTxCommit{
|
||||
CheckTx: abci.Result{Data: data.Bytes("stand")},
|
||||
DeliverTx: abci.Result{Data: data.Bytes("deliver")},
|
||||
CheckTx: abci.ResponseCheckTx{Data: data.Bytes("stand")},
|
||||
DeliverTx: abci.ResponseDeliverTx{Data: data.Bytes("deliver")},
|
||||
},
|
||||
Error: errors.New("bad tx"),
|
||||
},
|
||||
|
Reference in New Issue
Block a user