mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
added separate interface for WaitMined
This commit is contained in:
parent
a9444ea312
commit
8f4e068faf
2 changed files with 8 additions and 3 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue