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

Commit

Permalink
feat: update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Apr 29, 2024
1 parent fd8d60a commit 4a08bbf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bindings/encoding/custom_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,25 @@ import (
)

// BlockHashContractCallerAndTransactionReader represents a contract caller and transaction reader.
type BlockHashContractCallerAndTransactionReader interface {
type BlockHashContractCallerAndChainReader interface {
bind.BlockHashContractCaller
ethereum.TransactionReader
HeaderByHash(context.Context, common.Hash) (*types.Header, error)
ethereum.ChainReader
}

// TryParsingCustomErrorFromReceipt tries to parse the custom error from the given receipt.
func TryParsingCustomErrorFromReceipt(
ctx context.Context,
rpc BlockHashContractCallerAndTransactionReader,
rpc BlockHashContractCallerAndChainReader,
from common.Address,
receipt *types.Receipt,
) error {
// get header
// Get the block header of the receipt.
header, err := rpc.HeaderByHash(ctx, receipt.BlockHash)
if err != nil {
return err
}

// Fetch the raw transaction.
tx, _, err := rpc.TransactionByHash(ctx, receipt.TxHash)
if err != nil {
Expand Down

0 comments on commit 4a08bbf

Please sign in to comment.