forked from TrueCloudLab/frostfs-node
[#433] Remove notary extra fee
`client.CalculateNotaryFee` now calculates precise fee value. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
b9892edd6e
commit
5149a701f3
1 changed files with 10 additions and 23 deletions
|
@ -32,8 +32,6 @@ type (
|
|||
}
|
||||
|
||||
notaryCfg struct {
|
||||
extraVerifyFee int64
|
||||
|
||||
txValidTime, roundTime, fallbackTime uint32
|
||||
}
|
||||
|
||||
|
@ -41,7 +39,6 @@ type (
|
|||
)
|
||||
|
||||
const (
|
||||
defaultNotaryExtraFee = 1000_0000
|
||||
defaultNotaryValidTime = 50
|
||||
defaultNotaryRoundTime = 100
|
||||
defaultNotaryFallbackTime = 40
|
||||
|
@ -60,10 +57,9 @@ var (
|
|||
|
||||
func defaultNotaryConfig() *notaryCfg {
|
||||
return ¬aryCfg{
|
||||
extraVerifyFee: defaultNotaryExtraFee,
|
||||
txValidTime: defaultNotaryValidTime,
|
||||
roundTime: defaultNotaryRoundTime,
|
||||
fallbackTime: defaultNotaryFallbackTime,
|
||||
txValidTime: defaultNotaryValidTime,
|
||||
roundTime: defaultNotaryRoundTime,
|
||||
fallbackTime: defaultNotaryFallbackTime,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,13 +79,12 @@ func (c *Client) EnableNotarySupport(proxy, netmap util.Uint160, opts ...NotaryO
|
|||
}
|
||||
|
||||
c.notary = ¬ary{
|
||||
notary: notaryContract,
|
||||
proxy: proxy,
|
||||
netmap: netmap,
|
||||
extraVerifyFee: cfg.extraVerifyFee,
|
||||
txValidTime: cfg.txValidTime,
|
||||
roundTime: cfg.roundTime,
|
||||
fallbackTime: cfg.fallbackTime,
|
||||
notary: notaryContract,
|
||||
proxy: proxy,
|
||||
netmap: netmap,
|
||||
txValidTime: cfg.txValidTime,
|
||||
roundTime: cfg.roundTime,
|
||||
fallbackTime: cfg.fallbackTime,
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -234,7 +229,7 @@ func (c *Client) NotaryInvoke(contract util.Uint160, method string, args ...inte
|
|||
// add network fee for cosigners
|
||||
err = c.client.AddNetworkFee(
|
||||
mainTx,
|
||||
notaryFee+c.notary.extraVerifyFee,
|
||||
notaryFee,
|
||||
c.notaryAccounts(multiaddrAccount)...,
|
||||
)
|
||||
if err != nil {
|
||||
|
@ -443,14 +438,6 @@ func mn(ir []*keys.PublicKey) (m int, n int) {
|
|||
return
|
||||
}
|
||||
|
||||
// WithExtraVerifyFee returns a notary support option for client
|
||||
// that specifies extra fee to check witness of proxy contract.
|
||||
func WithExtraVerifyFee(fee int64) NotaryOption {
|
||||
return func(c *notaryCfg) {
|
||||
c.extraVerifyFee = fee
|
||||
}
|
||||
}
|
||||
|
||||
// WithTxValidTime returns a notary support option for client
|
||||
// that specifies minimum amount of blocks when mainTx will be valid.
|
||||
func WithTxValidTime(t uint32) NotaryOption {
|
||||
|
|
Loading…
Reference in a new issue