rpc: add native policy API to RPC client

part of #904
This commit is contained in:
Anna Shaleva 2020-06-16 15:46:28 +03:00
parent 9097a1a23d
commit b88863948d
3 changed files with 131 additions and 7 deletions

View file

@ -522,12 +522,10 @@ func (c *Client) AddNetworkFee(tx *transaction.Transaction, acc *wallet.Account)
tx.NetworkFee += netFee
size += sizeDelta
}
tx.NetworkFee += util.Fixed8(int64(size) * int64(c.GetFeePerByte()))
fee, err := c.GetFeePerByte()
if err != nil {
return err
}
tx.NetworkFee += util.Fixed8(int64(size) * fee)
return nil
}
// GetFeePerByte returns transaction network fee per byte
func (c *Client) GetFeePerByte() util.Fixed8 {
// TODO: make it a part of policy contract
return util.Fixed8(1000)
}