Merge pull request #15776 from ProChain/master
accounts/abi: Fix the bug of mobile framework crashing
This commit is contained in:
commit
45ce4dce3f
|
@ -154,12 +154,20 @@ func (c *BoundContract) GetDeployer() *Transaction {
|
||||||
// Call invokes the (constant) contract method with params as input values and
|
// Call invokes the (constant) contract method with params as input values and
|
||||||
// sets the output to result.
|
// sets the output to result.
|
||||||
func (c *BoundContract) Call(opts *CallOpts, out *Interfaces, method string, args *Interfaces) error {
|
func (c *BoundContract) Call(opts *CallOpts, out *Interfaces, method string, args *Interfaces) error {
|
||||||
results := make([]interface{}, len(out.objects))
|
if len(out.objects) == 1 {
|
||||||
copy(results, out.objects)
|
result := out.objects[0]
|
||||||
if err := c.contract.Call(&opts.opts, &results, method, args.objects...); err != nil {
|
if err := c.contract.Call(&opts.opts, result, method, args.objects...); err != nil {
|
||||||
return err
|
return err
|
||||||
|
}
|
||||||
|
out.objects[0] = result
|
||||||
|
} else {
|
||||||
|
results := make([]interface{}, len(out.objects))
|
||||||
|
copy(results, out.objects)
|
||||||
|
if err := c.contract.Call(&opts.opts, &results, method, args.objects...); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
copy(out.objects, results)
|
||||||
}
|
}
|
||||||
copy(out.objects, results)
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue