From dd0b38ae959665333ba2c9a06ec8512ee206dc89 Mon Sep 17 00:00:00 2001 From: ququzone Date: Wed, 10 Mar 2021 10:46:32 +0800 Subject: [PATCH] change to abi.Unpack --- iotex/contract.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/iotex/contract.go b/iotex/contract.go index 9415857a..ba80c6fa 100644 --- a/iotex/contract.go +++ b/iotex/contract.go @@ -16,10 +16,7 @@ type Data struct { } // Unmarshal unmarshals data into a data holder object. -func (d Data) Unmarshal(v interface{}) (err error) { - v, err = d.abi.Unpack(d.method, d.Raw) - return -} +func (d Data) Unmarshal() ([]interface{}, error) { return d.abi.Unpack(d.method, d.Raw) } type contract struct { address address.Address @@ -40,6 +37,7 @@ func (c *contract) Read(method string, args ...interface{}) ReadContractCaller { sender: c.account.Address(), } } + func (c *contract) Execute(method string, args ...interface{}) ExecuteContractCaller { return &executeContractCaller{ abi: c.abi,