Documentation
¶
Index ¶
Constants ¶
const SupportedFixtureFormat = "blockchain_test_engine_x"
SupportedFixtureFormat is the fixture format we support.
const ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"
ZeroHash is the zero hash used for forkchoice state.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlockHeader ¶
type BlockHeader struct {
ParentHash string `json:"parentHash"`
UncleHash string `json:"uncleHash"`
Coinbase string `json:"coinbase"`
StateRoot string `json:"stateRoot"`
TransactionsTrie string `json:"transactionsTrie"`
ReceiptTrie string `json:"receiptTrie"`
Bloom string `json:"bloom"`
Difficulty string `json:"difficulty"`
Number string `json:"number"`
GasLimit string `json:"gasLimit"`
GasUsed string `json:"gasUsed"`
Timestamp string `json:"timestamp"`
ExtraData string `json:"extraData"`
MixDigest string `json:"mixDigest"`
Nonce string `json:"nonce"`
BaseFeePerGas string `json:"baseFeePerGas,omitempty"`
WithdrawalsRoot string `json:"withdrawalsRoot,omitempty"`
BlobGasUsed string `json:"blobGasUsed,omitempty"`
ExcessBlobGas string `json:"excessBlobGas,omitempty"`
ParentBeaconBlockRoot string `json:"parentBeaconBlockRoot,omitempty"`
RequestsHash string `json:"requestsHash,omitempty"`
Hash string `json:"hash"`
}
BlockHeader represents an Ethereum block header.
type Consolidate ¶
type Consolidate struct {
SourceAddress string `json:"sourceAddress"`
SourcePubkey string `json:"sourcePubkey"`
TargetPubkey string `json:"targetPubkey"`
}
Consolidate represents a consolidation request in the execution payload.
type ConvertedTest ¶
type ConvertedTest struct {
Name string
SetupLines []string // JSON-RPC calls for setup (all payloads except last)
TestLines []string // JSON-RPC calls for test (last payload only)
GenesisHash string // Genesis block hash for forkchoiceUpdated calls
FinalHash string // Final block hash after all payloads
PayloadCount int // Total number of payloads in the fixture
}
ConvertedTest represents a test converted from EEST fixture format.
func ConvertFixture ¶
func ConvertFixture(name string, fixture *Fixture) (*ConvertedTest, error)
ConvertFixture converts an EEST fixture to JSON-RPC calls. For each payload:
- engine_newPayloadV{version}(params)
- engine_forkchoiceUpdatedV{version}({headBlockHash, safeBlockHash, finalizedBlockHash}, null)
All payloads except the last become setup steps. The last payload becomes the test step.
type Deposit ¶
type Deposit struct {
Pubkey string `json:"pubkey"`
WithdrawalCredentials string `json:"withdrawalCredentials"`
Amount string `json:"amount"`
Signature string `json:"signature"`
Index string `json:"index"`
}
Deposit represents a deposit request in the execution payload.
type EngineNewPayload ¶
type EngineNewPayload struct {
ExecutionPayload *ExecutionPayload
BlobVersionedHashes []string
ParentBeaconBlockRoot string
ExecutionRequests []string
NewPayloadVersion int
ForkchoiceUpdatedVersion int
ValidationError *ValidationError
ErrorCode *int
}
EngineNewPayload represents a parsed engine_newPayload RPC call entry.
func (*EngineNewPayload) UnmarshalJSON ¶
func (e *EngineNewPayload) UnmarshalJSON(data []byte) error
UnmarshalJSON implements custom unmarshaling for EngineNewPayload.
type EngineNewPayloadRaw ¶
type EngineNewPayloadRaw struct {
NewPayloadVersion string `json:"newPayloadVersion"`
ForkchoiceUpdatedVersion string `json:"forkchoiceUpdatedVersion"`
Params []json.RawMessage `json:"params"`
ValidationError *ValidationError `json:"validationError,omitempty"`
ErrorCode *int `json:"errorCode,omitempty"`
}
EngineNewPayloadRaw represents the raw JSON structure for engine_newPayload.
type ExecutionPayload ¶
type ExecutionPayload struct {
ParentHash string `json:"parentHash"`
FeeRecipient string `json:"feeRecipient"`
StateRoot string `json:"stateRoot"`
ReceiptsRoot string `json:"receiptsRoot"`
LogsBloom string `json:"logsBloom"`
PrevRandao string `json:"prevRandao"`
BlockNumber string `json:"blockNumber"`
GasLimit string `json:"gasLimit"`
GasUsed string `json:"gasUsed"`
Timestamp string `json:"timestamp"`
ExtraData string `json:"extraData"`
BaseFeePerGas string `json:"baseFeePerGas"`
BlockHash string `json:"blockHash"`
Transactions []string `json:"transactions"`
Withdrawals []*Withdrawal `json:"withdrawals,omitempty"`
BlobGasUsed string `json:"blobGasUsed,omitempty"`
ExcessBlobGas string `json:"excessBlobGas,omitempty"`
DepositRequests []*Deposit `json:"depositRequests,omitempty"`
WithdrawalRequests []*WithdrawReq `json:"withdrawalRequests,omitempty"`
ConsolidationRequests []*Consolidate `json:"consolidationRequests,omitempty"`
}
ExecutionPayload represents the execution payload in an engine_newPayload call.
type Fixture ¶
type Fixture struct {
Info *FixtureInfo `json:"_info"`
Network string `json:"network"`
GenesisBlockHeader *BlockHeader `json:"genesisBlockHeader"`
EngineNewPayloads []*EngineNewPayload `json:"engineNewPayloads"`
}
Fixture represents a single EEST test fixture.
func (*Fixture) IsSupportedFormat ¶
IsSupportedFormat returns true if the fixture has a supported format.
type FixtureInfo ¶
type FixtureInfo struct {
FixtureFormat string `json:"fixture-format"`
Hash string `json:"hash,omitempty"`
OpcodeCount map[string]int `json:"opcode_count,omitempty"`
Comment string `json:"comment,omitempty"`
FillingTransitionTool string `json:"filling-transition-tool,omitempty"`
Description string `json:"description,omitempty"`
URL string `json:"url,omitempty"`
}
FixtureInfo contains metadata about the fixture.
type ValidationError ¶
type ValidationError struct {
Message string `json:"message,omitempty"`
}
ValidationError represents an expected validation error.
type WithdrawReq ¶
type WithdrawReq struct {
SourceAddress string `json:"sourceAddress"`
ValidatorPubkey string `json:"validatorPubkey"`
Amount string `json:"amount"`
}
WithdrawReq represents a withdrawal request in the execution payload.