From ff83e7fe7891c7d33ca6b7f26bbc0ece7147c5d0 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 27 Aug 2020 16:58:51 +0300 Subject: [PATCH] [#15] Fix AppCall invocations There is no need in single array for all arguments now. Signed-off-by: Alex Vanin --- neofs_contract.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/neofs_contract.go b/neofs_contract.go index 7769ada..0a036b7 100644 --- a/neofs_contract.go +++ b/neofs_contract.go @@ -174,9 +174,8 @@ func InnerRingCandidateAdd(key []byte) bool { from := contract.CreateStandardAccount(key) to := runtime.GetExecutingScriptHash() fee := getConfig(ctx, candidateFeeConfigKey).(int) - params := []interface{}{from, to, fee} - transferred := engine.AppCall([]byte(tokenHash), "transfer", params).(bool) + transferred := engine.AppCall([]byte(tokenHash), "transfer", from, to, fee).(bool) if !transferred { panic("irCandidateAdd: failed to transfer funds, aborting") } @@ -203,9 +202,8 @@ func Deposit(from []byte, args []interface{}) bool { } to := runtime.GetExecutingScriptHash() - params := []interface{}{from, to, amount} - transferred := engine.AppCall([]byte(tokenHash), "transfer", params).(bool) + transferred := engine.AppCall([]byte(tokenHash), "transfer", from, to, amount).(bool) if !transferred { panic("deposit: failed to transfer funds, aborting") } @@ -267,9 +265,8 @@ func Cheque(id, user []byte, amount int, lockAcc []byte) bool { removeVotes(ctx, hashID) from := runtime.GetExecutingScriptHash() - params := []interface{}{from, user, amount} - transferred := engine.AppCall([]byte(tokenHash), "transfer", params).(bool) + transferred := engine.AppCall([]byte(tokenHash), "transfer", from, user, amount).(bool) if !transferred { panic("cheque: failed to transfer funds, aborting") }