frostfs-node/pkg/morph/client/balance/mint.go
Dmitrii Stepanov 7429553266
[#1437] node: Fix contextcheck linter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2024-11-13 10:36:10 +03:00

43 lines
852 B
Go

package balance
import (
"context"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client"
"github.com/nspcc-dev/neo-go/pkg/util"
)
// MintPrm groups parameters of Mint operation.
type MintPrm struct {
to util.Uint160
amount int64
id []byte
client.InvokePrmOptional
}
// SetTo sets receiver of the transfer.
func (m *MintPrm) SetTo(to util.Uint160) {
m.to = to
}
// SetAmount sets amount of the transfer.
func (m *MintPrm) SetAmount(amount int64) {
m.amount = amount
}
// SetID sets ID.
func (m *MintPrm) SetID(id []byte) {
m.id = id
}
// Mint sends funds to the account.
func (c *Client) Mint(ctx context.Context, p MintPrm) error {
prm := client.InvokePrm{}
prm.SetMethod(mintMethod)
prm.SetArgs(p.to, p.amount, p.id)
prm.InvokePrmOptional = p.InvokePrmOptional
_, err := c.client.Invoke(ctx, prm)
return err
}