Merge pull request #1058 from nspcc-dev/neo3/smartcontract/policy

core: add native policy contract
This commit is contained in:
Roman Khimov 2020-06-24 09:37:29 +03:00 committed by GitHub
commit 0fdeafb8f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 1058 additions and 43 deletions

View file

@ -528,12 +528,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)
}