Skip to content

Commit

Permalink
fix intoFn
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubhaankar-Sharma committed Jan 6, 2024
1 parent c59b51e commit 23db380
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ethrpc/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,13 @@ func ContractQuery(contractAddress common.Address, inputAbiExpr, outputAbiExpr s
return CallBuilder[[]string]{
method: "eth_call",
params: []any{toCallArg(msg), toBlockNumArg(nil)},
intoFn: func(raw json.RawMessage, ret *[]string) error {
resp, err := ethcoder.AbiDecodeExprAndStringify(outputAbiExpr, raw)
intoFn: func(message json.RawMessage, ret *[]string) error {
var result hexutil.Bytes
if err := json.Unmarshal(message, &result); err != nil {
return err
}

resp, err := ethcoder.AbiDecodeExprAndStringify(outputAbiExpr, result)
if err != nil {
return fmt.Errorf("abi decode of response failed: %w", err)
}
Expand Down

0 comments on commit 23db380

Please sign in to comment.