mirror of
https://github.com/forta-network/go-multicall.git
synced 2026-02-26 15:47:23 +00:00
Merge e8c9613045 into 9467c4ddaa
This commit is contained in:
commit
419fdd72c5
2 changed files with 10 additions and 9 deletions
15
call.go
15
call.go
|
|
@ -39,13 +39,14 @@ func ParseABI(rawJson string) (*abi.ABI, error) {
|
|||
|
||||
// Call wraps a multicall call.
|
||||
type Call struct {
|
||||
CallName string
|
||||
Contract *Contract
|
||||
Method string
|
||||
Inputs []any
|
||||
Outputs any
|
||||
CanFail bool
|
||||
Failed bool
|
||||
CallName string
|
||||
Contract *Contract
|
||||
Method string
|
||||
Inputs []any
|
||||
Outputs any
|
||||
CanFail bool
|
||||
Failed bool
|
||||
UnpackError error
|
||||
}
|
||||
|
||||
// NewCall creates a new call using given inputs.
|
||||
|
|
|
|||
|
|
@ -68,10 +68,10 @@ 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 err := call.Unpack(result.ReturnData); err != nil {
|
||||
return calls, fmt.Errorf("failed to unpack call outputs at index [%d]: %v", i, err)
|
||||
call.UnpackError = fmt.Errorf("failed to unpack call outputs at index [%d]: %v", i, err)
|
||||
}
|
||||
call.Failed = !result.Success || err != nil
|
||||
}
|
||||
|
||||
return calls, nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue