Skip to content

Added separate interface for WaitMined #31608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions accounts/abi/bind/v2/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,14 @@ type ContractTransactor interface {
PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
}

// DeployBackend wraps the operations needed by WaitMined and WaitDeployed.
type DeployBackend interface {
// TxReceiptBackend wraps the operations needed by WaitMined.
type TxReceiptBackend interface {
TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
}

// DeployBackend wraps the operations needed by WaitDeployed.
type DeployBackend interface {
TxReceiptBackend
CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)
}

Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/v2/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

// WaitMined waits for tx to be mined on the blockchain.
// It stops waiting when the context is canceled.
func WaitMined(ctx context.Context, b DeployBackend, txHash common.Hash) (*types.Receipt, error) {
func WaitMined(ctx context.Context, b TxReceiptBackend, txHash common.Hash) (*types.Receipt, error) {
queryTicker := time.NewTicker(time.Second)
defer queryTicker.Stop()

Expand Down