File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -154,12 +154,20 @@ func (c *BoundContract) GetDeployer() *Transaction {
154154// Call invokes the (constant) contract method with params as input values and
155155// sets the output to result.
156156func (c * BoundContract ) Call (opts * CallOpts , out * Interfaces , method string , args * Interfaces ) error {
157- results := make ([]interface {}, len (out .objects ))
158- copy (results , out .objects )
159- if err := c .contract .Call (& opts .opts , & results , method , args .objects ... ); err != nil {
160- return err
157+ if len (out .objects ) == 1 {
158+ result := out .objects [0 ]
159+ if err := c .contract .Call (& opts .opts , result , method , args .objects ... ); err != nil {
160+ return err
161+ }
162+ out .objects [0 ] = result
163+ } else {
164+ results := make ([]interface {}, len (out .objects ))
165+ copy (results , out .objects )
166+ if err := c .contract .Call (& opts .opts , & results , method , args .objects ... ); err != nil {
167+ return err
168+ }
169+ copy (out .objects , results )
161170 }
162- copy (out .objects , results )
163171 return nil
164172}
165173
You can’t perform that action at this time.
0 commit comments