From 230a5cd037768912e2c2876a3b48aa2dc1b79f5d Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 31 Mar 2022 11:08:27 +0300 Subject: [PATCH] [#1141] morph/client: Remove unneeded argument conversions Client supports `util.Uint160` directly, no need to convert it to bytes. Signed-off-by: Evgenii Stratonikov --- pkg/morph/client/balance/balanceOf.go | 2 +- pkg/morph/client/balance/burn.go | 2 +- pkg/morph/client/balance/lock.go | 2 +- pkg/morph/client/balance/mint.go | 2 +- pkg/morph/client/balance/transfer.go | 2 +- pkg/morph/client/neofs/cheque.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/morph/client/balance/balanceOf.go b/pkg/morph/client/balance/balanceOf.go index c3aec323d..0eec19b77 100644 --- a/pkg/morph/client/balance/balanceOf.go +++ b/pkg/morph/client/balance/balanceOf.go @@ -19,7 +19,7 @@ func (c *Client) BalanceOf(id *owner.ID) (*big.Int, error) { invokePrm := client.TestInvokePrm{} invokePrm.SetMethod(balanceOfMethod) - invokePrm.SetArgs(h.BytesBE()) + invokePrm.SetArgs(h) prms, err := c.client.TestInvoke(invokePrm) if err != nil { diff --git a/pkg/morph/client/balance/burn.go b/pkg/morph/client/balance/burn.go index b86807c63..7d148a4fd 100644 --- a/pkg/morph/client/balance/burn.go +++ b/pkg/morph/client/balance/burn.go @@ -33,7 +33,7 @@ func (b *BurnPrm) SetID(id []byte) { func (c *Client) Burn(p BurnPrm) error { prm := client.InvokePrm{} prm.SetMethod(burnMethod) - prm.SetArgs(p.to.BytesBE(), p.amount, p.id) + prm.SetArgs(p.to, p.amount, p.id) prm.InvokePrmOptional = p.InvokePrmOptional return c.client.Invoke(prm) diff --git a/pkg/morph/client/balance/lock.go b/pkg/morph/client/balance/lock.go index 34042c10b..1ef31cbf1 100644 --- a/pkg/morph/client/balance/lock.go +++ b/pkg/morph/client/balance/lock.go @@ -45,7 +45,7 @@ func (l *LockPrm) SetDueEpoch(dueEpoch int64) { func (c *Client) Lock(p LockPrm) error { prm := client.InvokePrm{} prm.SetMethod(lockMethod) - prm.SetArgs(p.id, p.user.BytesBE(), p.lock.BytesBE(), p.amount, p.dueEpoch) + prm.SetArgs(p.id, p.user, p.lock, p.amount, p.dueEpoch) prm.InvokePrmOptional = p.InvokePrmOptional return c.client.Invoke(prm) diff --git a/pkg/morph/client/balance/mint.go b/pkg/morph/client/balance/mint.go index c7a89b503..b52727a9f 100644 --- a/pkg/morph/client/balance/mint.go +++ b/pkg/morph/client/balance/mint.go @@ -33,7 +33,7 @@ func (m *MintPrm) SetID(id []byte) { func (c *Client) Mint(p MintPrm) error { prm := client.InvokePrm{} prm.SetMethod(mintMethod) - prm.SetArgs(p.to.BytesBE(), p.amount, p.id) + prm.SetArgs(p.to, p.amount, p.id) prm.InvokePrmOptional = p.InvokePrmOptional return c.client.Invoke(prm) diff --git a/pkg/morph/client/balance/transfer.go b/pkg/morph/client/balance/transfer.go index 8c9330c4c..691bca2c3 100644 --- a/pkg/morph/client/balance/transfer.go +++ b/pkg/morph/client/balance/transfer.go @@ -36,7 +36,7 @@ func (c *Client) TransferX(p TransferPrm) error { prm := client.InvokePrm{} prm.SetMethod(transferXMethod) - prm.SetArgs(from.BytesBE(), to.BytesBE(), p.Amount, p.Details) + prm.SetArgs(from, to, p.Amount, p.Details) prm.InvokePrmOptional = p.InvokePrmOptional err = c.client.Invoke(prm) diff --git a/pkg/morph/client/neofs/cheque.go b/pkg/morph/client/neofs/cheque.go index 96f76cd67..0e384afa0 100644 --- a/pkg/morph/client/neofs/cheque.go +++ b/pkg/morph/client/neofs/cheque.go @@ -40,7 +40,7 @@ func (c *ChequePrm) SetLock(lock util.Uint160) { func (x *Client) Cheque(p ChequePrm) error { prm := client.InvokePrm{} prm.SetMethod(chequeMethod) - prm.SetArgs(p.id, p.user.BytesBE(), p.amount, p.lock.BytesBE()) + prm.SetArgs(p.id, p.user, p.amount, p.lock) prm.InvokePrmOptional = p.InvokePrmOptional return x.client.Invoke(prm)