diff --git a/pkg/core/transaction/transaction.go b/pkg/core/transaction/transaction.go index 9bb6825d4..657300fe9 100644 --- a/pkg/core/transaction/transaction.go +++ b/pkg/core/transaction/transaction.go @@ -275,6 +275,7 @@ func NewTransactionFromBytes(network netmode.Magic, b []byte) (*Transaction, err if r.Err != nil { return nil, r.Err } + tx.feePerByte = tx.NetworkFee / int64(len(b)) return tx, nil } diff --git a/pkg/rpc/client/rpc_test.go b/pkg/rpc/client/rpc_test.go index 93741e7b0..71b1ae334 100644 --- a/pkg/rpc/client/rpc_test.go +++ b/pkg/rpc/client/rpc_test.go @@ -498,7 +498,12 @@ var rpcClientTestCases = map[string][]rpcClientTestCase{ if err != nil { panic(err) } - return c.GetRawTransactionVerbose(hash) + out, err := c.GetRawTransactionVerbose(hash) + if err != nil { + return nil, err + } + out.Transaction.FeePerByte() // set fee per byte + return out, nil }, serverResponse: txMoveNeoVerbose, result: func(c *Client) interface{} {