forked from TrueCloudLab/frostfs-node
[#338] ir: Drop named named put fee
Named put fee value used only when notary disabled. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
656fd7f376
commit
81718afb39
10 changed files with 9 additions and 125 deletions
|
@ -27,7 +27,7 @@ type staticOpts struct {
|
|||
tryNotary bool
|
||||
alpha bool // use client's key to sign notary request's main TX
|
||||
|
||||
fees fees
|
||||
fee fixedn.Fixed8
|
||||
}
|
||||
|
||||
// WithNotary returns notary status of the client.
|
||||
|
@ -63,7 +63,7 @@ func NewStatic(client *Client, scriptHash util.Uint160, fee fixedn.Fixed8, opts
|
|||
scScriptHash: scriptHash,
|
||||
}
|
||||
|
||||
c.fees.defaultFee = fee
|
||||
c.fee = fee
|
||||
|
||||
for i := range opts {
|
||||
opts[i](&c.staticOpts)
|
||||
|
@ -125,8 +125,6 @@ func (i *InvokePrmOptional) SetControlTX(b bool) {
|
|||
// If fee for the operation executed using specified method is customized, then StaticClient uses it.
|
||||
// Otherwise, default fee is used.
|
||||
func (s StaticClient) Invoke(prm InvokePrm) error {
|
||||
fee := s.fees.feeForMethod(prm.method)
|
||||
|
||||
if s.tryNotary {
|
||||
if s.alpha {
|
||||
var (
|
||||
|
@ -149,15 +147,15 @@ func (s StaticClient) Invoke(prm InvokePrm) error {
|
|||
vubP = &vub
|
||||
}
|
||||
|
||||
return s.client.NotaryInvoke(s.scScriptHash, fee, nonce, vubP, prm.method, prm.args...)
|
||||
return s.client.NotaryInvoke(s.scScriptHash, s.fee, nonce, vubP, prm.method, prm.args...)
|
||||
}
|
||||
|
||||
return s.client.NotaryInvokeNotAlpha(s.scScriptHash, fee, prm.method, prm.args...)
|
||||
return s.client.NotaryInvokeNotAlpha(s.scScriptHash, s.fee, prm.method, prm.args...)
|
||||
}
|
||||
|
||||
return s.client.Invoke(
|
||||
s.scScriptHash,
|
||||
fee,
|
||||
s.fee,
|
||||
prm.method,
|
||||
prm.args...,
|
||||
)
|
||||
|
@ -211,11 +209,3 @@ func AsAlphabet() StaticClientOption {
|
|||
o.alpha = true
|
||||
}
|
||||
}
|
||||
|
||||
// WithCustomFee returns option to specify custom fee for the operation executed using
|
||||
// specified contract method.
|
||||
func WithCustomFee(method string, fee fixedn.Fixed8) StaticClientOption {
|
||||
return func(o *staticOpts) {
|
||||
o.fees.setFeeForMethod(method, fee)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue