Skip to content

Commit

Permalink
Add eth_call response check on contract
Browse files Browse the repository at this point in the history
  • Loading branch information
ferranbt committed Apr 28, 2021
1 parent 4e88c00 commit 238a6ac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contract/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ func (c *Contract) Call(method string, block web3.BlockNumber, args ...interface
if err != nil {
return nil, err
}
if len(raw) == 0 {
return nil, fmt.Errorf("empty response")
}
respInterface, err := abi.Decode(m.Outputs, raw)
if err != nil {
return nil, err
Expand Down

0 comments on commit 238a6ac

Please sign in to comment.