Skip to content

Commit

Permalink
Merge pull request ethereum#15776 from ProChain/master
Browse files Browse the repository at this point in the history
accounts/abi: Fix the bug of mobile framework crashing
  • Loading branch information
holiman authored Feb 21, 2018
2 parents f54506c a6787a6 commit 45ce4dc
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions mobile/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 154,20 @@ func (c *BoundContract) GetDeployer() *Transaction {
// Call invokes the (constant) contract method with params as input values and
// sets the output to result.
func (c *BoundContract) Call(opts *CallOpts, out *Interfaces, method string, args *Interfaces) error {
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
if len(out.objects) == 1 {
result := out.objects[0]
if err := c.contract.Call(&opts.opts, result, method, args.objects...); err != nil {
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
}

Expand Down

0 comments on commit 45ce4dc

Please sign in to comment.