Skip to content
This repository was archived by the owner on May 11, 2024. It is now read-only.

Commit 4a08bbf

Browse files
committed
feat: update comments
1 parent fd8d60a commit 4a08bbf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

bindings/encoding/custom_error.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,25 @@ import (
1212
)
1313

1414
// BlockHashContractCallerAndTransactionReader represents a contract caller and transaction reader.
15-
type BlockHashContractCallerAndTransactionReader interface {
15+
type BlockHashContractCallerAndChainReader interface {
1616
bind.BlockHashContractCaller
1717
ethereum.TransactionReader
18-
HeaderByHash(context.Context, common.Hash) (*types.Header, error)
18+
ethereum.ChainReader
1919
}
2020

2121
// TryParsingCustomErrorFromReceipt tries to parse the custom error from the given receipt.
2222
func TryParsingCustomErrorFromReceipt(
2323
ctx context.Context,
24-
rpc BlockHashContractCallerAndTransactionReader,
24+
rpc BlockHashContractCallerAndChainReader,
2525
from common.Address,
2626
receipt *types.Receipt,
2727
) error {
28-
// get header
28+
// Get the block header of the receipt.
2929
header, err := rpc.HeaderByHash(ctx, receipt.BlockHash)
3030
if err != nil {
3131
return err
3232
}
33+
3334
// Fetch the raw transaction.
3435
tx, _, err := rpc.TransactionByHash(ctx, receipt.TxHash)
3536
if err != nil {

0 commit comments

Comments
 (0)