Revert "rpc: marshal fees and GAS as Fixed8 decimal"

This reverts commit a79b12b4d4.
This commit is contained in:
Evgeniy Stratonikov 2021-02-09 11:16:18 +03:00
parent 71494e6ae4
commit b0fbd897ad
8 changed files with 34 additions and 51 deletions

View file

@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
"github.com/nspcc-dev/neo-go/pkg/io"
"github.com/nspcc-dev/neo-go/pkg/smartcontract/trigger"
"github.com/nspcc-dev/neo-go/pkg/util"
@ -184,7 +183,7 @@ type Execution struct {
type executionAux struct {
Trigger string `json:"trigger"`
VMState string `json:"vmstate"`
GasConsumed fixedn.Fixed8 `json:"gasconsumed,string"`
GasConsumed int64 `json:"gasconsumed,string"`
Stack json.RawMessage `json:"stack"`
Events []NotificationEvent `json:"notifications"`
FaultException string `json:"exception,omitempty"`
@ -212,7 +211,7 @@ func (e Execution) MarshalJSON() ([]byte, error) {
return json.Marshal(&executionAux{
Trigger: e.Trigger.String(),
VMState: e.VMState.String(),
GasConsumed: fixedn.Fixed8(e.GasConsumed),
GasConsumed: e.GasConsumed,
Stack: st,
Events: e.Events,
FaultException: e.FaultException,
@ -253,7 +252,7 @@ func (e *Execution) UnmarshalJSON(data []byte) error {
}
e.VMState = state
e.Events = aux.Events
e.GasConsumed = int64(aux.GasConsumed)
e.GasConsumed = aux.GasConsumed
e.FaultException = aux.FaultException
return nil
}