forked from TrueCloudLab/frostfs-node
[#625] client/balance: remove intermediate wrapper
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
c7a8c762e0
commit
6f50fefbea
17 changed files with 239 additions and 524 deletions
40
pkg/morph/client/balance/burn.go
Normal file
40
pkg/morph/client/balance/burn.go
Normal file
|
@ -0,0 +1,40 @@
|
|||
package balance
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
)
|
||||
|
||||
// BurnPrm groups parameters of Burn operation.
|
||||
type BurnPrm struct {
|
||||
to util.Uint160
|
||||
amount int64
|
||||
id []byte
|
||||
|
||||
client.InvokePrmOptional
|
||||
}
|
||||
|
||||
// SetTo sets receiver.
|
||||
func (b *BurnPrm) SetTo(to util.Uint160) {
|
||||
b.to = to
|
||||
}
|
||||
|
||||
// SetAmount sets amount.
|
||||
func (b *BurnPrm) SetAmount(amount int64) {
|
||||
b.amount = amount
|
||||
}
|
||||
|
||||
// SetID sets ID
|
||||
func (b *BurnPrm) SetID(id []byte) {
|
||||
b.id = id
|
||||
}
|
||||
|
||||
// Burn destroys funds from the account.
|
||||
func (c *Client) Burn(p BurnPrm) error {
|
||||
prm := client.InvokePrm{}
|
||||
prm.SetMethod(burnMethod)
|
||||
prm.SetArgs(p.to.BytesBE(), p.amount, p.id)
|
||||
prm.InvokePrmOptional = p.InvokePrmOptional
|
||||
|
||||
return c.client.Invoke(prm)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue