diff --git a/pkg/rpc/response/result/invoke.go b/pkg/rpc/response/result/invoke.go index 922dcdcad..bfd4c72ea 100644 --- a/pkg/rpc/response/result/invoke.go +++ b/pkg/rpc/response/result/invoke.go @@ -26,7 +26,7 @@ type Invoke struct { type invokeAux struct { State string `json:"state"` - GasConsumed fixedn.Fixed8 `json:"gasconsumed,string"` + GasConsumed fixedn.Fixed8 `json:"gasconsumed"` Script []byte `json:"script"` Stack json.RawMessage `json:"stack"` FaultException string `json:"exception,omitempty"` diff --git a/pkg/rpc/response/result/invoke_test.go b/pkg/rpc/response/result/invoke_test.go index 611831acb..f1975d42b 100644 --- a/pkg/rpc/response/result/invoke_test.go +++ b/pkg/rpc/response/result/invoke_test.go @@ -6,7 +6,6 @@ import ( "math/big" "testing" - "github.com/nspcc-dev/neo-go/pkg/encoding/fixedn" "github.com/nspcc-dev/neo-go/pkg/vm/stackitem" "github.com/stretchr/testify/require" ) @@ -14,7 +13,7 @@ import ( func TestInvoke_MarshalJSON(t *testing.T) { result := &Invoke{ State: "HALT", - GasConsumed: int64(fixedn.Fixed8FromFloat(123.45)), + GasConsumed: 237626000, Script: []byte{10}, Stack: []stackitem.Item{stackitem.NewBigInteger(big.NewInt(1))}, FaultException: "", @@ -26,7 +25,7 @@ func TestInvoke_MarshalJSON(t *testing.T) { require.NoError(t, err) expected := `{ "state":"HALT", - "gasconsumed":"123.45", + "gasconsumed":"2.37626", "script":"` + base64.StdEncoding.EncodeToString(result.Script) + `", "stack":[ {"type":"Integer","value":"1"}