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
|
@ -32,11 +32,19 @@ const (
|
|||
)
|
||||
|
||||
// Mint assets in contract.
|
||||
func Mint(cli *client.Client, con util.Uint160, p *MintBurnParams) error {
|
||||
func Mint(cli *client.Client, con util.Uint160, fee SideFeeProvider, p *MintBurnParams) error {
|
||||
if cli == nil {
|
||||
return client.ErrNilClient
|
||||
}
|
||||
|
||||
if !cli.NotaryEnabled() {
|
||||
return cli.Invoke(con, fee.SideChainFee(), mintMethod,
|
||||
p.ScriptHash,
|
||||
p.Amount,
|
||||
p.Comment,
|
||||
)
|
||||
}
|
||||
|
||||
return cli.NotaryInvoke(con, mintMethod,
|
||||
p.ScriptHash,
|
||||
p.Amount,
|
||||
|
@ -45,11 +53,19 @@ func Mint(cli *client.Client, con util.Uint160, p *MintBurnParams) error {
|
|||
}
|
||||
|
||||
// Burn minted assets.
|
||||
func Burn(cli *client.Client, con util.Uint160, p *MintBurnParams) error {
|
||||
func Burn(cli *client.Client, con util.Uint160, fee SideFeeProvider, p *MintBurnParams) error {
|
||||
if cli == nil {
|
||||
return client.ErrNilClient
|
||||
}
|
||||
|
||||
if !cli.NotaryEnabled() {
|
||||
return cli.Invoke(con, fee.SideChainFee(), burnMethod,
|
||||
p.ScriptHash,
|
||||
p.Amount,
|
||||
p.Comment,
|
||||
)
|
||||
}
|
||||
|
||||
return cli.NotaryInvoke(con, burnMethod,
|
||||
p.ScriptHash,
|
||||
p.Amount,
|
||||
|
@ -58,11 +74,21 @@ func Burn(cli *client.Client, con util.Uint160, p *MintBurnParams) error {
|
|||
}
|
||||
|
||||
// LockAsset invokes Lock method.
|
||||
func LockAsset(cli *client.Client, con util.Uint160, p *LockParams) error {
|
||||
func LockAsset(cli *client.Client, con util.Uint160, fee SideFeeProvider, p *LockParams) error {
|
||||
if cli == nil {
|
||||
return client.ErrNilClient
|
||||
}
|
||||
|
||||
if !cli.NotaryEnabled() {
|
||||
return cli.Invoke(con, fee.SideChainFee(), lockMethod,
|
||||
p.ID,
|
||||
p.User.BytesBE(),
|
||||
p.LockAccount.BytesBE(),
|
||||
p.Amount,
|
||||
int64(p.Until),
|
||||
)
|
||||
}
|
||||
|
||||
return cli.NotaryInvoke(con, lockMethod,
|
||||
p.ID,
|
||||
p.User.BytesBE(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue