mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-26 01:44:16 +00:00
update sites of DeliverTx
This commit is contained in:
+4
-4
@@ -6,11 +6,11 @@ import (
|
||||
)
|
||||
|
||||
// ABCIResults wraps the deliver tx results to return a proof.
|
||||
type ABCIResults []*abci.ResponseDeliverTx
|
||||
type ABCIResults []*abci.ExecTxResult
|
||||
|
||||
// NewResults strips non-deterministic fields from ResponseDeliverTx responses
|
||||
// and returns ABCIResults.
|
||||
func NewResults(responses []*abci.ResponseDeliverTx) ABCIResults {
|
||||
func NewResults(responses []*abci.ExecTxResult) ABCIResults {
|
||||
res := make(ABCIResults, len(responses))
|
||||
for i, d := range responses {
|
||||
res[i] = deterministicResponseDeliverTx(d)
|
||||
@@ -44,8 +44,8 @@ func (a ABCIResults) toByteSlices() [][]byte {
|
||||
|
||||
// deterministicResponseDeliverTx strips non-deterministic fields from
|
||||
// ResponseDeliverTx and returns another ResponseDeliverTx.
|
||||
func deterministicResponseDeliverTx(response *abci.ResponseDeliverTx) *abci.ResponseDeliverTx {
|
||||
return &abci.ResponseDeliverTx{
|
||||
func deterministicResponseDeliverTx(response *abci.ExecTxResult) *abci.ExecTxResult {
|
||||
return &abci.ExecTxResult{
|
||||
Code: response.Code,
|
||||
Data: response.Data,
|
||||
GasWanted: response.GasWanted,
|
||||
|
||||
@@ -10,12 +10,12 @@ import (
|
||||
)
|
||||
|
||||
func TestABCIResults(t *testing.T) {
|
||||
a := &abci.ResponseDeliverTx{Code: 0, Data: nil}
|
||||
b := &abci.ResponseDeliverTx{Code: 0, Data: []byte{}}
|
||||
c := &abci.ResponseDeliverTx{Code: 0, Data: []byte("one")}
|
||||
d := &abci.ResponseDeliverTx{Code: 14, Data: nil}
|
||||
e := &abci.ResponseDeliverTx{Code: 14, Data: []byte("foo")}
|
||||
f := &abci.ResponseDeliverTx{Code: 14, Data: []byte("bar")}
|
||||
a := &abci.ExecTxResult{Code: 0, Data: nil}
|
||||
b := &abci.ExecTxResult{Code: 0, Data: []byte{}}
|
||||
c := &abci.ExecTxResult{Code: 0, Data: []byte("one")}
|
||||
d := &abci.ExecTxResult{Code: 14, Data: nil}
|
||||
e := &abci.ExecTxResult{Code: 14, Data: []byte("foo")}
|
||||
f := &abci.ExecTxResult{Code: 14, Data: []byte("bar")}
|
||||
|
||||
// Nil and []byte{} should produce the same bytes
|
||||
bzA, err := a.Marshal()
|
||||
|
||||
Reference in New Issue
Block a user