diff --git a/accounts/abi/bind/v2/backend.go b/accounts/abi/bind/v2/backend.go index 2f5f17b31ebc..fd4f8fb79348 100644 --- a/accounts/abi/bind/v2/backend.go +++ b/accounts/abi/bind/v2/backend.go @@ -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) } diff --git a/accounts/abi/bind/v2/util.go b/accounts/abi/bind/v2/util.go index 438848a753ac..4f69fcd693ea 100644 --- a/accounts/abi/bind/v2/util.go +++ b/accounts/abi/bind/v2/util.go @@ -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()