forked from TrueCloudLab/frostfs-node
[#486] innerring: Use fee provider interface in invoke
package
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
1f3bb33db8
commit
91a1896b8b
7 changed files with 135 additions and 24 deletions
|
@ -31,11 +31,20 @@ const (
|
|||
)
|
||||
|
||||
// CashOutCheque invokes Cheque method.
|
||||
func CashOutCheque(cli *client.Client, con util.Uint160, p *ChequeParams) error {
|
||||
func CashOutCheque(cli *client.Client, con util.Uint160, fee MainFeeProvider, p *ChequeParams) error {
|
||||
if cli == nil {
|
||||
return client.ErrNilClient
|
||||
}
|
||||
|
||||
if !cli.NotaryEnabled() {
|
||||
return cli.Invoke(con, fee.MainChainFee(), chequeMethod,
|
||||
p.ID,
|
||||
p.User.BytesBE(),
|
||||
p.Amount,
|
||||
p.LockAccount.BytesBE(),
|
||||
)
|
||||
}
|
||||
|
||||
return cli.NotaryInvoke(con, chequeMethod,
|
||||
p.ID,
|
||||
p.User.BytesBE(),
|
||||
|
@ -45,10 +54,14 @@ func CashOutCheque(cli *client.Client, con util.Uint160, p *ChequeParams) error
|
|||
}
|
||||
|
||||
// AlphabetUpdate invokes alphabetUpdate method.
|
||||
func AlphabetUpdate(cli *client.Client, con util.Uint160, id []byte, list keys.PublicKeys) error {
|
||||
func AlphabetUpdate(cli *client.Client, con util.Uint160, fee MainFeeProvider, id []byte, list keys.PublicKeys) error {
|
||||
if cli == nil {
|
||||
return client.ErrNilClient
|
||||
}
|
||||
|
||||
if !cli.NotaryEnabled() {
|
||||
return cli.Invoke(con, fee.MainChainFee(), alphabetUpdateMethod, id, list)
|
||||
}
|
||||
|
||||
return cli.NotaryInvoke(con, alphabetUpdateMethod, id, list)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue