mirror of
https://github.com/forta-network/go-multicall.git
synced 2026-02-26 15:47:23 +00:00
Handling return failures
This commit is contained in:
parent
9467c4ddaa
commit
0fd6c633b0
1 changed files with 3 additions and 0 deletions
|
|
@ -69,6 +69,9 @@ func (caller *Caller) Call(opts *bind.CallOpts, calls ...*Call) ([]*Call, error)
|
|||
for i, result := range results {
|
||||
call := calls[i] // index always matches
|
||||
call.Failed = !result.Success
|
||||
if call.Failed {
|
||||
continue
|
||||
}
|
||||
if err := call.Unpack(result.ReturnData); err != nil {
|
||||
return calls, fmt.Errorf("failed to unpack call outputs at index [%d]: %v", i, err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue