[#15] Fix AppCall invocations

There is no need in single array for all arguments now.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-08-27 16:58:51 +03:00 committed by Alex Vanin
parent a2479a3ade
commit ff83e7fe78

View file

@ -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")
}