frostfs-node/pkg/morph/client/balance/mint.go
Evgenii Stratonikov 230a5cd037 [#1141] morph/client: Remove unneeded argument conversions
Client supports `util.Uint160` directly, no need to convert it to bytes.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-05-16 15:09:35 +03:00

40 lines
788 B
Go

package balance
import (
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
)
// 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(p MintPrm) error {
prm := client.InvokePrm{}
prm.SetMethod(mintMethod)
prm.SetArgs(p.to, p.amount, p.id)
prm.InvokePrmOptional = p.InvokePrmOptional
return c.client.Invoke(prm)
}