From 5149a701f30ff4a4aa12941617bc89e17a49972b Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 18 Mar 2021 18:44:23 +0300 Subject: [PATCH] [#433] Remove notary extra fee `client.CalculateNotaryFee` now calculates precise fee value. Signed-off-by: Alex Vanin --- pkg/morph/client/notary.go | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/pkg/morph/client/notary.go b/pkg/morph/client/notary.go index c290c6782..b08dbac04 100644 --- a/pkg/morph/client/notary.go +++ b/pkg/morph/client/notary.go @@ -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 {