This commit is contained in:
Prajjwal Mehta 2025-09-05 23:53:36 +05:30 committed by GitHub
commit 419fdd72c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 9 deletions

15
call.go
View file

@ -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.

View file

@ -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