Documentation
¶
Overview ¶
Package block contains ethereum helper methods that center around blocks, like waiting for a certain block timestamp, waiting for a transaction to be mined in a block, and extracting an error for a transaction from the block that mined it.
Index ¶
- func ErrorFromBlock(ctx context.Context, ec *ethclient.Client, receipt *ethtypes.Receipt) error
- func WaitForEthBlockAfterTimestamp(ctx context.Context, ec *ethclient.Client, ts time.Time) (*ethtypes.Header, error)
- func WaitForReceipt(ctx context.Context, ec *ethclient.Client, txHash ethcommon.Hash) (*ethtypes.Receipt, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorFromBlock ¶
ErrorFromBlock returns the error for why a transaction was reverted when mined. Normally these errors are detected when creating the transaction, as the contract call is simulated to estimate gas, but the state is different in the mined block and the transaction can fail (losing gas) after it already went out to the network. In this case, we simulate the call using the mined block to extract the error.
Types ¶
This section is empty.