transaction: set feePerByte on tx construction
This commit is contained in:
parent
3097dc60e5
commit
27b3054df4
2 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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{} {
|
||||
|
|
Loading…
Reference in a new issue