transaction: set feePerByte on tx construction

This commit is contained in:
Evgenii Stratonikov 2020-07-03 17:40:03 +03:00
parent 3097dc60e5
commit 27b3054df4
2 changed files with 7 additions and 1 deletions

View file

@ -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
}

View file

@ -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{} {