Documentation
¶
Index ¶
- Constants
- Variables
- func CheckTxIncluded(client *ethclient.Client, txHash common.Hash) bool
- func GetRandomTransaction(t *testing.T, privateKeyHex, toAddressHex, chainID string, gasLimit uint64, ...) *types.Transaction
- type EngineClient
- func (c *EngineClient) ExecuteTxs(ctx context.Context, txs [][]byte, blockHeight uint64, timestamp time.Time, ...) (updatedStateRoot []byte, maxBytes uint64, err error)
- func (c *EngineClient) GetLatestHeight(ctx context.Context) (uint64, error)
- func (c *EngineClient) GetTxs(ctx context.Context) ([][]byte, error)
- func (c *EngineClient) InitChain(ctx context.Context, genesisTime time.Time, initialHeight uint64, ...) ([]byte, uint64, error)
- func (c *EngineClient) SetFinal(ctx context.Context, blockHeight uint64) error
- func (c *EngineClient) SetLogger(l zerolog.Logger)
Constants ¶
const ( FlagEvmEthURL = "evm.eth-url" FlagEvmEngineURL = "evm.engine-url" FlagEvmJWTSecretFile = "evm.jwt-secret-file" FlagEvmGenesisHash = "evm.genesis-hash" FlagEvmFeeRecipient = "evm.fee-recipient" )
Variables ¶
var ( // ErrInvalidPayloadStatus indicates that EVM returned status != VALID ErrInvalidPayloadStatus = errors.New("invalid payload status") )
Functions ¶
func CheckTxIncluded ¶
CheckTxIncluded checks if a transaction with the given hash was included in a block and succeeded.
func GetRandomTransaction ¶
func GetRandomTransaction(t *testing.T, privateKeyHex, toAddressHex, chainID string, gasLimit uint64, lastNonce *uint64) *types.Transaction
GetRandomTransaction creates and signs a random Ethereum legacy transaction using the provided private key, recipient, chain ID, gas limit, and nonce.
Types ¶
type EngineClient ¶
type EngineClient struct {
// contains filtered or unexported fields
}
EngineClient represents a client that interacts with an Ethereum execution engine through the Engine API. It manages connections to both the engine and standard Ethereum APIs, and maintains state related to block processing.
func NewEngineExecutionClient ¶
func NewEngineExecutionClient( ethURL, engineURL string, jwtSecret string, genesisHash common.Hash, feeRecipient common.Address, ) (*EngineClient, error)
NewEngineExecutionClient creates a new instance of EngineAPIExecutionClient
func (*EngineClient) ExecuteTxs ¶
func (c *EngineClient) ExecuteTxs(ctx context.Context, txs [][]byte, blockHeight uint64, timestamp time.Time, prevStateRoot []byte) (updatedStateRoot []byte, maxBytes uint64, err error)
ExecuteTxs executes the given transactions at the specified block height and timestamp
func (*EngineClient) GetLatestHeight ¶
func (c *EngineClient) GetLatestHeight(ctx context.Context) (uint64, error)
GetLatestHeight returns the current block height of the execution layer
func (*EngineClient) GetTxs ¶
func (c *EngineClient) GetTxs(ctx context.Context) ([][]byte, error)
GetTxs retrieves transactions from the current execution payload
func (*EngineClient) InitChain ¶
func (c *EngineClient) InitChain(ctx context.Context, genesisTime time.Time, initialHeight uint64, chainID string) ([]byte, uint64, error)
InitChain initializes the blockchain with the given genesis parameters
func (*EngineClient) SetFinal ¶
func (c *EngineClient) SetFinal(ctx context.Context, blockHeight uint64) error
SetFinal marks the block at the given height as finalized
func (*EngineClient) SetLogger ¶
func (c *EngineClient) SetLogger(l zerolog.Logger)
SetLogger allows callers to attach a structured logger.