Documentation ¶
Index ¶
- Variables
- func BigEqual(a, b *big.Int) bool
- func FakeGenesis(l1 rune, l2 rune, l1GenesisNumber uint64) rollup.Genesis
- func GenerateDeposit(sourceHash common.Hash, rng *rand.Rand) *types.DepositTx
- func GenerateLog(addr common.Address, topics []common.Hash, data []byte) *types.Log
- func InsecureRandomKey(rng *rand.Rand) *ecdsa.PrivateKey
- func MakeBlockInfo(fn func(l *MockBlockInfo)) func(rng *rand.Rand) *MockBlockInfo
- func NextRandomL2Ref(rng *rand.Rand, l2BlockTime uint64, parent eth.L2BlockRef, origin eth.BlockID) eth.L2BlockRef
- func NextRandomRef(rng *rand.Rand, parent eth.L1BlockRef) eth.L1BlockRef
- func RandomAccessListTx(rng *rand.Rand, signer types.Signer) *types.Transaction
- func RandomAddress(rng *rand.Rand) (out common.Address)
- func RandomBlock(rng *rand.Rand, txCount uint64) (*types.Block, []*types.Receipt)
- func RandomBlockID(rng *rand.Rand) eth.BlockID
- func RandomBlockPrependTxs(rng *rand.Rand, txCount int, ptxs ...*types.Transaction) (*types.Block, []*types.Receipt)
- func RandomBlockPrependTxsWithTime(rng *rand.Rand, txCount int, t uint64, ptxs ...*types.Transaction) (*types.Block, []*types.Receipt)
- func RandomBlockRef(rng *rand.Rand) eth.L1BlockRef
- func RandomBool(rng *rand.Rand) bool
- func RandomData(rng *rand.Rand, size int) []byte
- func RandomDynamicFeeTx(rng *rand.Rand, signer types.Signer) *types.Transaction
- func RandomDynamicFeeTxWithBaseFee(rng *rand.Rand, baseFee *big.Int, signer types.Signer) *types.Transaction
- func RandomETH(rng *rand.Rand, max int64) *big.Int
- func RandomHash(rng *rand.Rand) (out common.Hash)
- func RandomHeader(rng *rand.Rand) *types.Header
- func RandomHeaderWithTime(rng *rand.Rand, t uint64) *types.Header
- func RandomKey() *ecdsa.PrivateKey
- func RandomL2BlockRef(rng *rand.Rand) eth.L2BlockRef
- func RandomLegacyTx(rng *rand.Rand, signer types.Signer) *types.Transaction
- func RandomLegacyTxNotProtected(rng *rand.Rand) *types.Transaction
- func RandomLog(rng *rand.Rand) *types.Log
- func RandomOutputResponse(rng *rand.Rand) *eth.OutputResponse
- func RandomOutputV0(rng *rand.Rand) *eth.OutputV0
- func RandomReceipt(rng *rand.Rand, signer types.Signer, tx *types.Transaction, txIndex uint64, ...) *types.Receipt
- func RandomTo(rng *rand.Rand) *common.Address
- func RandomTx(rng *rand.Rand, baseFee *big.Int, signer types.Signer) *types.Transaction
- func RequireBigEqual(t *testing.T, exp, actual *big.Int)
- type FakeChainSource
- func (m *FakeChainSource) AdvanceL1() eth.L1BlockRef
- func (m *FakeChainSource) ForkchoiceUpdate(ctx context.Context, state *eth.ForkchoiceState, attr *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)
- func (m *FakeChainSource) L1BlockRefByHash(ctx context.Context, l1Hash common.Hash) (eth.L1BlockRef, error)
- func (m *FakeChainSource) L1BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L1BlockRef, error)
- func (m *FakeChainSource) L1BlockRefByNumber(ctx context.Context, l1Num uint64) (eth.L1BlockRef, error)
- func (m *FakeChainSource) L1Head() eth.L1BlockRef
- func (m *FakeChainSource) L1Range(ctx context.Context, base eth.BlockID, max uint64) ([]eth.BlockID, error)
- func (m *FakeChainSource) L2BlockRefByHash(ctx context.Context, l2Hash common.Hash) (eth.L2BlockRef, error)
- func (m *FakeChainSource) L2BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L2BlockRef, error)
- func (m *FakeChainSource) L2BlockRefByNumber(ctx context.Context, l2Num *big.Int) (eth.L2BlockRef, error)
- func (m *FakeChainSource) ReorgL1()
- func (m *FakeChainSource) SetL2Finalized(finalized common.Hash)
- func (m *FakeChainSource) SetL2Head(head int) eth.L2BlockRef
- func (m *FakeChainSource) SetL2Safe(safe common.Hash)
- type FakeInteropBackend
- func (m *FakeInteropBackend) CrossDerivedFrom(ctx context.Context, chainID types.ChainID, derived eth.BlockID) (eth.L1BlockRef, error)
- func (m *FakeInteropBackend) Finalized(ctx context.Context, chainID types.ChainID) (eth.BlockID, error)
- func (m *FakeInteropBackend) SafeView(ctx context.Context, chainID types.ChainID, safe types.ReferenceView) (types.ReferenceView, error)
- func (m *FakeInteropBackend) UnsafeView(ctx context.Context, chainID types.ChainID, unsafe types.ReferenceView) (types.ReferenceView, error)
- func (m *FakeInteropBackend) UpdateFinalizedL1(ctx context.Context, chainID types.ChainID, finalized eth.L1BlockRef) error
- func (m *FakeInteropBackend) UpdateLocalSafe(ctx context.Context, chainID types.ChainID, derivedFrom eth.L1BlockRef, ...) error
- func (m *FakeInteropBackend) UpdateLocalUnsafe(ctx context.Context, chainID types.ChainID, head eth.BlockRef) error
- type MockBlobsFetcher
- func (cl *MockBlobsFetcher) ExpectOnGetBlobSidecars(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash, ...)
- func (cl *MockBlobsFetcher) ExpectOnGetBlobs(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash, ...)
- func (cl *MockBlobsFetcher) GetBlobSidecars(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash) ([]*eth.BlobSidecar, error)
- func (cl *MockBlobsFetcher) GetBlobs(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash) ([]*eth.Blob, error)
- type MockBlockInfo
- func (l *MockBlockInfo) BaseFee() *big.Int
- func (l *MockBlockInfo) BlobBaseFee() *big.Int
- func (l *MockBlockInfo) BlockRef() eth.L1BlockRef
- func (l *MockBlockInfo) Coinbase() common.Address
- func (l *MockBlockInfo) GasLimit() uint64
- func (l *MockBlockInfo) GasUsed() uint64
- func (l *MockBlockInfo) Hash() common.Hash
- func (l *MockBlockInfo) HeaderRLP() ([]byte, error)
- func (l *MockBlockInfo) ID() eth.BlockID
- func (l *MockBlockInfo) MixDigest() common.Hash
- func (l *MockBlockInfo) NumberU64() uint64
- func (l *MockBlockInfo) ParentBeaconRoot() *common.Hash
- func (l *MockBlockInfo) ParentHash() common.Hash
- func (l *MockBlockInfo) ReceiptHash() common.Hash
- func (l *MockBlockInfo) Root() common.Hash
- func (l *MockBlockInfo) Time() uint64
- type MockClient
- func (m *MockClient) BalanceAt(ctx context.Context, account common.Address, block *big.Int) (*big.Int, error)
- func (m *MockClient) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
- func (m *MockClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
- func (m *MockClient) BlockNumber(ctx context.Context) (uint64, error)
- func (m *MockClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
- func (m *MockClient) CallContractAtHash(ctx context.Context, msg ethereum.CallMsg, blockHash common.Hash) ([]byte, error)
- func (m *MockClient) ChainID(ctx context.Context) (*big.Int, error)
- func (m *MockClient) Close()
- func (m *MockClient) CodeAt(ctx context.Context, account common.Address, block *big.Int) ([]byte, error)
- func (m *MockClient) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)
- func (m *MockClient) ExpectBalanceAt(account common.Address, block, amount *big.Int, err error)
- func (m *MockClient) ExpectBlockByHash(hash common.Hash, block *types.Block, err error)
- func (m *MockClient) ExpectBlockByNumber(number *big.Int, block *types.Block, err error)
- func (m *MockClient) ExpectBlockNumber(blockNum uint64, err error)
- func (m *MockClient) ExpectCallContract(msg ethereum.CallMsg, blockNumber *big.Int, result []byte, err error)
- func (m *MockClient) ExpectCallContractAtHash(msg ethereum.CallMsg, blockHash common.Hash, result []byte, err error)
- func (m *MockClient) ExpectChainID(id *big.Int, err error)
- func (m *MockClient) ExpectClose()
- func (m *MockClient) ExpectCodeAt(account common.Address, block *big.Int, code []byte, err error)
- func (m *MockClient) ExpectEstimateGas(msg ethereum.CallMsg, gas uint64, err error)
- func (m *MockClient) ExpectFilterLogs(q ethereum.FilterQuery, logs []types.Log, err error)
- func (m *MockClient) ExpectHeaderByHash(hash common.Hash, header *types.Header, err error)
- func (m *MockClient) ExpectHeaderByNumber(number *big.Int, header *types.Header, err error)
- func (m *MockClient) ExpectNetworkID(id *big.Int, err error)
- func (m *MockClient) ExpectNonceAt(account common.Address, block *big.Int, nonce uint64, err error)
- func (m *MockClient) ExpectPeerCount(count uint64, err error)
- func (m *MockClient) ExpectPendingBalanceAt(account common.Address, balance *big.Int, err error)
- func (m *MockClient) ExpectPendingCallContract(msg ethereum.CallMsg, result []byte, err error)
- func (m *MockClient) ExpectPendingCodeAt(account common.Address, code []byte, err error)
- func (m *MockClient) ExpectPendingNonceAt(account common.Address, nonce uint64, err error)
- func (m *MockClient) ExpectPendingStorageAt(account common.Address, key common.Hash, data []byte, err error)
- func (m *MockClient) ExpectPendingTransactionCount(count uint, err error)
- func (m *MockClient) ExpectRPC(rpc client.RPC)
- func (m *MockClient) ExpectSendTransaction(tx *types.Transaction, err error)
- func (m *MockClient) ExpectStorageAt(account common.Address, key common.Hash, block *big.Int, data []byte, ...)
- func (m *MockClient) ExpectSubscribeFilterLogs(q ethereum.FilterQuery, ch chan<- types.Log, sub ethereum.Subscription, ...)
- func (m *MockClient) ExpectSubscribeNewHead(ch chan<- *types.Header, sub ethereum.Subscription, err error)
- func (m *MockClient) ExpectSuggestGasPrice(price *big.Int, err error)
- func (m *MockClient) ExpectSuggestGasTipCap(tipCap *big.Int, err error)
- func (m *MockClient) ExpectSyncProgress(prog *ethereum.SyncProgress, err error)
- func (m *MockClient) ExpectTransactionByHash(hash common.Hash, tx *types.Transaction, isPending bool, err error)
- func (m *MockClient) ExpectTransactionCount(hash common.Hash, count uint, err error)
- func (m *MockClient) ExpectTransactionInBlock(hash common.Hash, index uint, tx *types.Transaction, err error)
- func (m *MockClient) ExpectTransactionReceipt(hash common.Hash, receipt *types.Receipt, err error)
- func (m *MockClient) ExpectTransactionSender(tx *types.Transaction, block common.Hash, index uint, sender common.Address, ...)
- func (m *MockClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)
- func (m *MockClient) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)
- func (m *MockClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
- func (m *MockClient) NetworkID(ctx context.Context) (*big.Int, error)
- func (m *MockClient) NonceAt(ctx context.Context, account common.Address, block *big.Int) (uint64, error)
- func (m *MockClient) PeerCount(ctx context.Context) (uint64, error)
- func (m *MockClient) PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error)
- func (m *MockClient) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error)
- func (m *MockClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
- func (m *MockClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
- func (m *MockClient) PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error)
- func (m *MockClient) PendingTransactionCount(ctx context.Context) (uint, error)
- func (m *MockClient) RPC() client.RPC
- func (m *MockClient) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (m *MockClient) StorageAt(ctx context.Context, account common.Address, key common.Hash, block *big.Int) ([]byte, error)
- func (m *MockClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
- func (m *MockClient) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error)
- func (m *MockClient) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- func (m *MockClient) SuggestGasTipCap(ctx context.Context) (*big.Int, error)
- func (m *MockClient) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error)
- func (m *MockClient) TransactionByHash(ctx context.Context, hash common.Hash) (*types.Transaction, bool, error)
- func (m *MockClient) TransactionCount(ctx context.Context, hash common.Hash) (uint, error)
- func (m *MockClient) TransactionInBlock(ctx context.Context, hash common.Hash, index uint) (*types.Transaction, error)
- func (m *MockClient) TransactionReceipt(ctx context.Context, hash common.Hash) (*types.Receipt, error)
- func (m *MockClient) TransactionSender(ctx context.Context, tx *types.Transaction, block common.Hash, index uint) (common.Address, error)
- type MockDebugClient
- func (m *MockDebugClient) CodeByHash(ctx context.Context, hash common.Hash) ([]byte, error)
- func (m *MockDebugClient) ExpectCodeByHash(hash common.Hash, res []byte, err error)
- func (m *MockDebugClient) ExpectNodeByHash(hash common.Hash, res []byte, err error)
- func (m *MockDebugClient) NodeByHash(ctx context.Context, hash common.Hash) ([]byte, error)
- type MockEmitter
- func (m *MockEmitter) AssertExpectations(t mock.TestingT)
- func (m *MockEmitter) Emit(ev event.Event)
- func (m *MockEmitter) ExpectMaybeRun(fn func(ev event.Event))
- func (m *MockEmitter) ExpectOnce(expected event.Event)
- func (m *MockEmitter) ExpectOnceRun(fn func(ev event.Event))
- func (m *MockEmitter) ExpectOnceType(typ string)
- type MockEngine
- func (m *MockEngine) ExpectForkchoiceUpdate(state *eth.ForkchoiceState, attr *eth.PayloadAttributes, ...)
- func (m *MockEngine) ExpectGetPayload(payloadId eth.PayloadID, payload *eth.ExecutionPayloadEnvelope, err error)
- func (m *MockEngine) ExpectNewPayload(payload *eth.ExecutionPayload, parentBeaconBlockRoot *common.Hash, ...)
- func (m *MockEngine) ForkchoiceUpdate(ctx context.Context, state *eth.ForkchoiceState, attr *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)
- func (m *MockEngine) GetPayload(ctx context.Context, payloadInfo eth.PayloadInfo) (*eth.ExecutionPayloadEnvelope, error)
- func (m *MockEngine) NewPayload(ctx context.Context, payload *eth.ExecutionPayload, ...) (*eth.PayloadStatusV1, error)
- type MockEthClient
- func (m *MockEthClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
- func (m *MockEthClient) Client() *rpc.Client
- func (m *MockEthClient) Close()
- func (m *MockEthClient) ExpectBlockByNumber(number *big.Int, block *types.Block, err error)
- func (m *MockEthClient) ExpectClose()
- func (m *MockEthClient) ExpectFetchReceipts(hash common.Hash, info eth.BlockInfo, receipts types.Receipts, err error)
- func (m *MockEthClient) ExpectGetProof(address common.Address, storage []common.Hash, blockTag string, ...)
- func (m *MockEthClient) ExpectGetStorageAt(ctx context.Context, address common.Address, storageSlot common.Hash, ...)
- func (m *MockEthClient) ExpectInfoAndTxsByHash(hash common.Hash, info eth.BlockInfo, transactions types.Transactions, ...)
- func (m *MockEthClient) ExpectInfoAndTxsByLabel(label eth.BlockLabel, info eth.BlockInfo, transactions types.Transactions, ...)
- func (m *MockEthClient) ExpectInfoAndTxsByNumber(number uint64, info eth.BlockInfo, transactions types.Transactions, err error)
- func (m *MockEthClient) ExpectInfoByHash(hash common.Hash, info eth.BlockInfo, err error)
- func (m *MockEthClient) ExpectInfoByLabel(label eth.BlockLabel, info eth.BlockInfo, err error)
- func (m *MockEthClient) ExpectInfoByNumber(number uint64, info eth.BlockInfo, err error)
- func (m *MockEthClient) ExpectPayloadByHash(hash common.Hash, payload *eth.ExecutionPayloadEnvelope, err error)
- func (m *MockEthClient) ExpectPayloadByLabel(label eth.BlockLabel, payload *eth.ExecutionPayloadEnvelope, err error)
- func (m *MockEthClient) ExpectPayloadByNumber(n uint64, payload *eth.ExecutionPayloadEnvelope, err error)
- func (m *MockEthClient) ExpectReadStorageAt(ctx context.Context, address common.Address, storageSlot common.Hash, ...)
- func (m *MockEthClient) FetchReceipts(ctx context.Context, blockHash common.Hash) (eth.BlockInfo, types.Receipts, error)
- func (m *MockEthClient) GetProof(ctx context.Context, address common.Address, storage []common.Hash, ...) (*eth.AccountResult, error)
- func (m *MockEthClient) GetStorageAt(ctx context.Context, address common.Address, storageSlot common.Hash, ...) (common.Hash, error)
- func (m *MockEthClient) InfoAndTxsByHash(ctx context.Context, hash common.Hash) (eth.BlockInfo, types.Transactions, error)
- func (m *MockEthClient) InfoAndTxsByLabel(ctx context.Context, label eth.BlockLabel) (eth.BlockInfo, types.Transactions, error)
- func (m *MockEthClient) InfoAndTxsByNumber(ctx context.Context, number uint64) (eth.BlockInfo, types.Transactions, error)
- func (m *MockEthClient) InfoByHash(ctx context.Context, hash common.Hash) (eth.BlockInfo, error)
- func (m *MockEthClient) InfoByLabel(ctx context.Context, label eth.BlockLabel) (eth.BlockInfo, error)
- func (m *MockEthClient) InfoByNumber(ctx context.Context, number uint64) (eth.BlockInfo, error)
- func (m *MockEthClient) MaybeClose()
- func (m *MockEthClient) PayloadByHash(ctx context.Context, hash common.Hash) (*eth.ExecutionPayloadEnvelope, error)
- func (m *MockEthClient) PayloadByLabel(ctx context.Context, label eth.BlockLabel) (*eth.ExecutionPayloadEnvelope, error)
- func (m *MockEthClient) PayloadByNumber(ctx context.Context, n uint64) (*eth.ExecutionPayloadEnvelope, error)
- func (m *MockEthClient) ReadStorageAt(ctx context.Context, address common.Address, storageSlot common.Hash, ...) (common.Hash, error)
- type MockInteropBackend
- func (m *MockInteropBackend) AssertExpectations(t mock.TestingT)
- func (m *MockInteropBackend) CrossDerivedFrom(ctx context.Context, chainID types.ChainID, derived eth.BlockID) (eth.L1BlockRef, error)
- func (m *MockInteropBackend) ExpectAnyUpdateLocalUnsafe(chainID types.ChainID, err error)
- func (m *MockInteropBackend) ExpectDerivedFrom(chainID types.ChainID, derived eth.BlockID, result eth.L1BlockRef, err error)
- func (m *MockInteropBackend) ExpectFinalized(chainID types.ChainID, result eth.BlockID, err error)
- func (m *MockInteropBackend) ExpectSafeView(chainID types.ChainID, safe types.ReferenceView, result types.ReferenceView, ...)
- func (m *MockInteropBackend) ExpectUnsafeView(chainID types.ChainID, unsafe types.ReferenceView, result types.ReferenceView, ...)
- func (m *MockInteropBackend) ExpectUpdateFinalizedL1(chainID types.ChainID, finalized eth.L1BlockRef, err error)
- func (m *MockInteropBackend) ExpectUpdateLocalSafe(chainID types.ChainID, derivedFrom eth.L1BlockRef, lastDerived eth.BlockRef, ...)
- func (m *MockInteropBackend) ExpectUpdateLocalUnsafe(chainID types.ChainID, head eth.BlockRef, err error)
- func (m *MockInteropBackend) Finalized(ctx context.Context, chainID types.ChainID) (eth.BlockID, error)
- func (m *MockInteropBackend) OnSafeView(chainID types.ChainID, ...)
- func (m *MockInteropBackend) OnUnsafeView(chainID types.ChainID, ...)
- func (m *MockInteropBackend) SafeView(ctx context.Context, chainID types.ChainID, safe types.ReferenceView) (types.ReferenceView, error)
- func (m *MockInteropBackend) UnsafeView(ctx context.Context, chainID types.ChainID, unsafe types.ReferenceView) (types.ReferenceView, error)
- func (m *MockInteropBackend) UpdateFinalizedL1(ctx context.Context, chainID types.ChainID, finalized eth.L1BlockRef) error
- func (m *MockInteropBackend) UpdateLocalSafe(ctx context.Context, chainID types.ChainID, derivedFrom eth.L1BlockRef, ...) error
- func (m *MockInteropBackend) UpdateLocalUnsafe(ctx context.Context, chainID types.ChainID, head eth.BlockRef) error
- type MockL1Source
- func (m *MockL1Source) ExpectL1BlockRefByHash(hash common.Hash, ref eth.L1BlockRef, err error)
- func (m *MockL1Source) ExpectL1BlockRefByLabel(label eth.BlockLabel, ref eth.L1BlockRef, err error)
- func (m *MockL1Source) ExpectL1BlockRefByNumber(num uint64, ref eth.L1BlockRef, err error)
- func (m *MockL1Source) L1BlockRefByHash(ctx context.Context, hash common.Hash) (eth.L1BlockRef, error)
- func (m *MockL1Source) L1BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L1BlockRef, error)
- func (m *MockL1Source) L1BlockRefByNumber(ctx context.Context, num uint64) (eth.L1BlockRef, error)
- type MockL2Client
- func (m *MockL2Client) ExpectL2BlockRefByHash(hash common.Hash, ref eth.L2BlockRef, err error)
- func (m *MockL2Client) ExpectL2BlockRefByLabel(label eth.BlockLabel, ref eth.L2BlockRef, err error)
- func (m *MockL2Client) ExpectL2BlockRefByNumber(num uint64, ref eth.L2BlockRef, err error)
- func (m *MockL2Client) ExpectOutputV0AtBlock(blockHash common.Hash, output *eth.OutputV0, err error)
- func (m *MockL2Client) ExpectSystemConfigByL2Hash(hash common.Hash, cfg eth.SystemConfig, err error)
- func (c *MockL2Client) L2BlockRefByHash(ctx context.Context, hash common.Hash) (eth.L2BlockRef, error)
- func (c *MockL2Client) L2BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L2BlockRef, error)
- func (c *MockL2Client) L2BlockRefByNumber(ctx context.Context, num uint64) (eth.L2BlockRef, error)
- func (m *MockL2Client) OutputV0AtBlock(ctx context.Context, blockHash common.Hash) (*eth.OutputV0, error)
- func (m *MockL2Client) SystemConfigByL2Hash(ctx context.Context, hash common.Hash) (eth.SystemConfig, error)
- type MockRPC
- func (m *MockRPC) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error
- func (m *MockRPC) CallContext(ctx context.Context, result any, method string, args ...any) error
- func (m *MockRPC) Close()
- func (m *MockRPC) EthSubscribe(ctx context.Context, channel any, args ...any) (ethereum.Subscription, error)
- func (m *MockRPC) ExpectBatchCallContext(b []rpc.BatchElem, err error)
- func (m *MockRPC) ExpectCallContext(result any, method string, args []any, err error)
- func (m *MockRPC) ExpectClose()
- func (m *MockRPC) ExpectEthSubscribe(channel any, args []any, sub ethereum.Subscription, err error)
- type MockRollupClient
- func (m *MockRollupClient) Close()
- func (m *MockRollupClient) ExpectClose()
- func (m *MockRollupClient) ExpectOutputAtBlock(blockNum uint64, response *eth.OutputResponse, err error) *mock.Call
- func (m *MockRollupClient) ExpectRollupConfig(config *rollup.Config, err error)
- func (m *MockRollupClient) ExpectSequencerActive(active bool, err error)
- func (m *MockRollupClient) ExpectStartSequencer(unsafeHead common.Hash, err error)
- func (m *MockRollupClient) ExpectSyncStatus(status *eth.SyncStatus, err error)
- func (m *MockRollupClient) MaybeClose()
- func (m *MockRollupClient) OutputAtBlock(ctx context.Context, blockNum uint64) (*eth.OutputResponse, error)
- func (m *MockRollupClient) RollupConfig(ctx context.Context) (*rollup.Config, error)
- func (m *MockRollupClient) SequencerActive(ctx context.Context) (bool, error)
- func (m *MockRollupClient) StartSequencer(ctx context.Context, unsafeHead common.Hash) error
- func (m *MockRollupClient) SyncStatus(ctx context.Context) (*eth.SyncStatus, error)
- type MockRuntimeConfig
- type RPCErrFaker
- func (r RPCErrFaker) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error
- func (r RPCErrFaker) CallContext(ctx context.Context, result any, method string, args ...any) error
- func (r RPCErrFaker) Close()
- func (r RPCErrFaker) EthSubscribe(ctx context.Context, channel any, args ...any) (ethereum.Subscription, error)
- type TestDerivationMetrics
- func (t *TestDerivationMetrics) CountSequencedTxs(count int)
- func (t *TestDerivationMetrics) RecordChannelInputBytes(inputCompressedBytes int)
- func (t *TestDerivationMetrics) RecordChannelTimedOut()
- func (n *TestDerivationMetrics) RecordDerivedBatches(batchType string)
- func (t *TestDerivationMetrics) RecordFrame()
- func (t *TestDerivationMetrics) RecordHeadChannelOpened()
- func (t *TestDerivationMetrics) RecordL1Ref(name string, ref eth.L1BlockRef)
- func (t *TestDerivationMetrics) RecordL1ReorgDepth(d uint64)
- func (t *TestDerivationMetrics) RecordL2Ref(name string, ref eth.L2BlockRef)
- func (t *TestDerivationMetrics) RecordPipelineReset()
- func (t *TestDerivationMetrics) RecordSequencerBuildingDiffTime(duration time.Duration)
- func (t *TestDerivationMetrics) RecordSequencerSealingTime(duration time.Duration)
- func (t *TestDerivationMetrics) RecordUnsafePayloadsBuffer(length uint64, memSize uint64, next eth.BlockID)
- func (t *TestDerivationMetrics) SetDerivationIdle(idle bool)
- type TestID
- type TestRPCMetrics
Constants ¶
This section is empty.
Variables ¶
var RandomDataSize = 1000
Functions ¶
func GenerateDeposit ¶
Returns a DepositEvent customized on the basis of the id parameter.
func GenerateLog ¶
Generates an EVM log entry with the given topics and data.
func InsecureRandomKey ¶
func InsecureRandomKey(rng *rand.Rand) *ecdsa.PrivateKey
InsecureRandomKey returns a random private key from a limited set of keys. Output is deterministic when the supplied rng generates the same random sequence.
func MakeBlockInfo ¶
func MakeBlockInfo(fn func(l *MockBlockInfo)) func(rng *rand.Rand) *MockBlockInfo
func NextRandomL2Ref ¶
func NextRandomL2Ref(rng *rand.Rand, l2BlockTime uint64, parent eth.L2BlockRef, origin eth.BlockID) eth.L2BlockRef
func NextRandomRef ¶
func NextRandomRef(rng *rand.Rand, parent eth.L1BlockRef) eth.L1BlockRef
func RandomAccessListTx ¶ added in v1.4.2
func RandomBlock ¶
func RandomBlockPrependTxs ¶
func RandomBlockPrependTxs(rng *rand.Rand, txCount int, ptxs ...*types.Transaction) (*types.Block, []*types.Receipt)
RandomBlockPrependTxs returns a random block with txCount randomly generated transactions and additionally the transactions ptxs prepended. So the total number of transactions is len(ptxs) + txCount.
func RandomBlockPrependTxsWithTime ¶ added in v1.7.3
func RandomBlockRef ¶
func RandomBlockRef(rng *rand.Rand) eth.L1BlockRef
func RandomBool ¶
func RandomDynamicFeeTx ¶ added in v1.4.2
func RandomDynamicFeeTxWithBaseFee ¶ added in v1.4.2
func RandomHeaderWithTime ¶ added in v1.7.3
func RandomKey ¶
func RandomKey() *ecdsa.PrivateKey
func RandomL2BlockRef ¶
func RandomL2BlockRef(rng *rand.Rand) eth.L2BlockRef
func RandomLegacyTx ¶ added in v1.4.2
func RandomLegacyTxNotProtected ¶ added in v1.4.2
func RandomLegacyTxNotProtected(rng *rand.Rand) *types.Transaction
func RandomOutputResponse ¶
func RandomOutputResponse(rng *rand.Rand) *eth.OutputResponse
func RandomReceipt ¶
Types ¶
type FakeChainSource ¶
type FakeChainSource struct {
// contains filtered or unexported fields
}
FakeChainSource implements the ChainSource interface with the ability to control what the head block is of the L1 and L2 chains. In addition, it enables re-orgs to easily be implemented
func NewFakeChainSource ¶
func (*FakeChainSource) AdvanceL1 ¶
func (m *FakeChainSource) AdvanceL1() eth.L1BlockRef
func (*FakeChainSource) ForkchoiceUpdate ¶
func (m *FakeChainSource) ForkchoiceUpdate(ctx context.Context, state *eth.ForkchoiceState, attr *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)
func (*FakeChainSource) L1BlockRefByHash ¶
func (m *FakeChainSource) L1BlockRefByHash(ctx context.Context, l1Hash common.Hash) (eth.L1BlockRef, error)
func (*FakeChainSource) L1BlockRefByLabel ¶
func (m *FakeChainSource) L1BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L1BlockRef, error)
func (*FakeChainSource) L1BlockRefByNumber ¶
func (m *FakeChainSource) L1BlockRefByNumber(ctx context.Context, l1Num uint64) (eth.L1BlockRef, error)
func (*FakeChainSource) L1Head ¶
func (m *FakeChainSource) L1Head() eth.L1BlockRef
func (*FakeChainSource) L2BlockRefByHash ¶
func (m *FakeChainSource) L2BlockRefByHash(ctx context.Context, l2Hash common.Hash) (eth.L2BlockRef, error)
func (*FakeChainSource) L2BlockRefByLabel ¶
func (m *FakeChainSource) L2BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L2BlockRef, error)
func (*FakeChainSource) L2BlockRefByNumber ¶
func (m *FakeChainSource) L2BlockRefByNumber(ctx context.Context, l2Num *big.Int) (eth.L2BlockRef, error)
func (*FakeChainSource) ReorgL1 ¶
func (m *FakeChainSource) ReorgL1()
func (*FakeChainSource) SetL2Finalized ¶
func (m *FakeChainSource) SetL2Finalized(finalized common.Hash)
func (*FakeChainSource) SetL2Head ¶
func (m *FakeChainSource) SetL2Head(head int) eth.L2BlockRef
func (*FakeChainSource) SetL2Safe ¶
func (m *FakeChainSource) SetL2Safe(safe common.Hash)
type FakeInteropBackend ¶ added in v1.9.5
type FakeInteropBackend struct { UnsafeViewFn func(ctx context.Context, chainID types.ChainID, unsafe types.ReferenceView) (types.ReferenceView, error) SafeViewFn func(ctx context.Context, chainID types.ChainID, safe types.ReferenceView) (types.ReferenceView, error) FinalizedFn func(ctx context.Context, chainID types.ChainID) (eth.BlockID, error) DerivedFromFn func(ctx context.Context, chainID types.ChainID, derived eth.BlockID) (eth.L1BlockRef, error) UpdateLocalUnsafeFn func(ctx context.Context, chainID types.ChainID, head eth.BlockRef) error UpdateLocalSafeFn func(ctx context.Context, chainID types.ChainID, derivedFrom eth.L1BlockRef, lastDerived eth.BlockRef) error UpdateFinalizedL1Fn func(ctx context.Context, chainID types.ChainID, finalized eth.L1BlockRef) error }
func (*FakeInteropBackend) CrossDerivedFrom ¶ added in v1.9.5
func (m *FakeInteropBackend) CrossDerivedFrom(ctx context.Context, chainID types.ChainID, derived eth.BlockID) (eth.L1BlockRef, error)
func (*FakeInteropBackend) SafeView ¶ added in v1.9.5
func (m *FakeInteropBackend) SafeView(ctx context.Context, chainID types.ChainID, safe types.ReferenceView) (types.ReferenceView, error)
func (*FakeInteropBackend) UnsafeView ¶ added in v1.9.5
func (m *FakeInteropBackend) UnsafeView(ctx context.Context, chainID types.ChainID, unsafe types.ReferenceView) (types.ReferenceView, error)
func (*FakeInteropBackend) UpdateFinalizedL1 ¶ added in v1.9.5
func (m *FakeInteropBackend) UpdateFinalizedL1(ctx context.Context, chainID types.ChainID, finalized eth.L1BlockRef) error
func (*FakeInteropBackend) UpdateLocalSafe ¶ added in v1.9.5
func (m *FakeInteropBackend) UpdateLocalSafe(ctx context.Context, chainID types.ChainID, derivedFrom eth.L1BlockRef, lastDerived eth.BlockRef) error
func (*FakeInteropBackend) UpdateLocalUnsafe ¶ added in v1.9.5
type MockBlobsFetcher ¶ added in v1.5.1
func (*MockBlobsFetcher) ExpectOnGetBlobSidecars ¶ added in v1.5.1
func (cl *MockBlobsFetcher) ExpectOnGetBlobSidecars(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash, commitment eth.Bytes48, blobs []*eth.Blob, err error)
func (*MockBlobsFetcher) ExpectOnGetBlobs ¶ added in v1.5.1
func (cl *MockBlobsFetcher) ExpectOnGetBlobs(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash, blobs []*eth.Blob, err error)
func (*MockBlobsFetcher) GetBlobSidecars ¶ added in v1.5.1
func (cl *MockBlobsFetcher) GetBlobSidecars(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash) ([]*eth.BlobSidecar, error)
func (*MockBlobsFetcher) GetBlobs ¶ added in v1.5.1
func (cl *MockBlobsFetcher) GetBlobs(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash) ([]*eth.Blob, error)
type MockBlockInfo ¶
type MockBlockInfo struct { InfoHash common.Hash InfoParentHash common.Hash InfoCoinbase common.Address InfoRoot common.Hash InfoNum uint64 InfoTime uint64 InfoMixDigest [32]byte InfoBaseFee *big.Int InfoBlobBaseFee *big.Int InfoReceiptRoot common.Hash InfoGasUsed uint64 InfoGasLimit uint64 InfoHeaderRLP []byte InfoParentBeaconRoot *common.Hash }
func RandomBlockInfo ¶
func RandomBlockInfo(rng *rand.Rand) *MockBlockInfo
func (*MockBlockInfo) BaseFee ¶
func (l *MockBlockInfo) BaseFee() *big.Int
func (*MockBlockInfo) BlobBaseFee ¶ added in v1.5.0
func (l *MockBlockInfo) BlobBaseFee() *big.Int
func (*MockBlockInfo) BlockRef ¶
func (l *MockBlockInfo) BlockRef() eth.L1BlockRef
func (*MockBlockInfo) Coinbase ¶
func (l *MockBlockInfo) Coinbase() common.Address
func (*MockBlockInfo) GasLimit ¶ added in v1.4.2
func (l *MockBlockInfo) GasLimit() uint64
func (*MockBlockInfo) GasUsed ¶
func (l *MockBlockInfo) GasUsed() uint64
func (*MockBlockInfo) Hash ¶
func (l *MockBlockInfo) Hash() common.Hash
func (*MockBlockInfo) HeaderRLP ¶
func (l *MockBlockInfo) HeaderRLP() ([]byte, error)
func (*MockBlockInfo) ID ¶
func (l *MockBlockInfo) ID() eth.BlockID
func (*MockBlockInfo) MixDigest ¶
func (l *MockBlockInfo) MixDigest() common.Hash
func (*MockBlockInfo) NumberU64 ¶
func (l *MockBlockInfo) NumberU64() uint64
func (*MockBlockInfo) ParentBeaconRoot ¶ added in v1.5.0
func (l *MockBlockInfo) ParentBeaconRoot() *common.Hash
func (*MockBlockInfo) ParentHash ¶
func (l *MockBlockInfo) ParentHash() common.Hash
func (*MockBlockInfo) ReceiptHash ¶
func (l *MockBlockInfo) ReceiptHash() common.Hash
func (*MockBlockInfo) Root ¶
func (l *MockBlockInfo) Root() common.Hash
func (*MockBlockInfo) Time ¶
func (l *MockBlockInfo) Time() uint64
type MockClient ¶ added in v1.7.6
func (*MockClient) BlockByHash ¶ added in v1.7.6
func (*MockClient) BlockByNumber ¶ added in v1.7.6
func (*MockClient) BlockNumber ¶ added in v1.7.6
func (m *MockClient) BlockNumber(ctx context.Context) (uint64, error)
func (*MockClient) CallContract ¶ added in v1.7.6
func (*MockClient) CallContractAtHash ¶ added in v1.7.6
func (*MockClient) Close ¶ added in v1.7.6
func (m *MockClient) Close()
func (*MockClient) EstimateGas ¶ added in v1.7.6
func (m *MockClient) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)
func (*MockClient) ExpectBalanceAt ¶ added in v1.7.6
func (*MockClient) ExpectBlockByHash ¶ added in v1.7.6
func (*MockClient) ExpectBlockByNumber ¶ added in v1.7.6
func (*MockClient) ExpectBlockNumber ¶ added in v1.7.6
func (m *MockClient) ExpectBlockNumber(blockNum uint64, err error)
func (*MockClient) ExpectCallContract ¶ added in v1.7.6
func (m *MockClient) ExpectCallContract(msg ethereum.CallMsg, blockNumber *big.Int, result []byte, err error)
func (*MockClient) ExpectCallContractAtHash ¶ added in v1.7.6
func (m *MockClient) ExpectCallContractAtHash(msg ethereum.CallMsg, blockHash common.Hash, result []byte, err error)
func (*MockClient) ExpectChainID ¶ added in v1.7.6
func (m *MockClient) ExpectChainID(id *big.Int, err error)
func (*MockClient) ExpectClose ¶ added in v1.7.6
func (m *MockClient) ExpectClose()
func (*MockClient) ExpectCodeAt ¶ added in v1.7.6
func (*MockClient) ExpectEstimateGas ¶ added in v1.7.6
func (m *MockClient) ExpectEstimateGas(msg ethereum.CallMsg, gas uint64, err error)
func (*MockClient) ExpectFilterLogs ¶ added in v1.7.6
func (m *MockClient) ExpectFilterLogs(q ethereum.FilterQuery, logs []types.Log, err error)
func (*MockClient) ExpectHeaderByHash ¶ added in v1.7.6
func (*MockClient) ExpectHeaderByNumber ¶ added in v1.7.6
func (*MockClient) ExpectNetworkID ¶ added in v1.7.6
func (m *MockClient) ExpectNetworkID(id *big.Int, err error)
func (*MockClient) ExpectNonceAt ¶ added in v1.7.6
func (*MockClient) ExpectPeerCount ¶ added in v1.7.6
func (m *MockClient) ExpectPeerCount(count uint64, err error)
func (*MockClient) ExpectPendingBalanceAt ¶ added in v1.7.6
func (*MockClient) ExpectPendingCallContract ¶ added in v1.7.6
func (m *MockClient) ExpectPendingCallContract(msg ethereum.CallMsg, result []byte, err error)
func (*MockClient) ExpectPendingCodeAt ¶ added in v1.7.6
func (m *MockClient) ExpectPendingCodeAt(account common.Address, code []byte, err error)
func (*MockClient) ExpectPendingNonceAt ¶ added in v1.7.6
func (m *MockClient) ExpectPendingNonceAt(account common.Address, nonce uint64, err error)
func (*MockClient) ExpectPendingStorageAt ¶ added in v1.7.6
func (*MockClient) ExpectPendingTransactionCount ¶ added in v1.7.6
func (m *MockClient) ExpectPendingTransactionCount(count uint, err error)
func (*MockClient) ExpectRPC ¶ added in v1.7.6
func (m *MockClient) ExpectRPC(rpc client.RPC)
func (*MockClient) ExpectSendTransaction ¶ added in v1.7.6
func (m *MockClient) ExpectSendTransaction(tx *types.Transaction, err error)
func (*MockClient) ExpectStorageAt ¶ added in v1.7.6
func (*MockClient) ExpectSubscribeFilterLogs ¶ added in v1.7.6
func (m *MockClient) ExpectSubscribeFilterLogs(q ethereum.FilterQuery, ch chan<- types.Log, sub ethereum.Subscription, err error)
func (*MockClient) ExpectSubscribeNewHead ¶ added in v1.7.6
func (m *MockClient) ExpectSubscribeNewHead(ch chan<- *types.Header, sub ethereum.Subscription, err error)
func (*MockClient) ExpectSuggestGasPrice ¶ added in v1.7.6
func (m *MockClient) ExpectSuggestGasPrice(price *big.Int, err error)
func (*MockClient) ExpectSuggestGasTipCap ¶ added in v1.7.6
func (m *MockClient) ExpectSuggestGasTipCap(tipCap *big.Int, err error)
func (*MockClient) ExpectSyncProgress ¶ added in v1.7.6
func (m *MockClient) ExpectSyncProgress(prog *ethereum.SyncProgress, err error)
func (*MockClient) ExpectTransactionByHash ¶ added in v1.7.6
func (m *MockClient) ExpectTransactionByHash(hash common.Hash, tx *types.Transaction, isPending bool, err error)
func (*MockClient) ExpectTransactionCount ¶ added in v1.7.6
func (m *MockClient) ExpectTransactionCount(hash common.Hash, count uint, err error)
func (*MockClient) ExpectTransactionInBlock ¶ added in v1.7.6
func (m *MockClient) ExpectTransactionInBlock(hash common.Hash, index uint, tx *types.Transaction, err error)
func (*MockClient) ExpectTransactionReceipt ¶ added in v1.7.6
func (*MockClient) ExpectTransactionSender ¶ added in v1.7.6
func (m *MockClient) ExpectTransactionSender(tx *types.Transaction, block common.Hash, index uint, sender common.Address, err error)
func (*MockClient) FilterLogs ¶ added in v1.7.6
func (*MockClient) HeaderByHash ¶ added in v1.7.6
func (*MockClient) HeaderByNumber ¶ added in v1.7.6
func (*MockClient) PeerCount ¶ added in v1.7.6
func (m *MockClient) PeerCount(ctx context.Context) (uint64, error)
func (*MockClient) PendingBalanceAt ¶ added in v1.7.6
func (*MockClient) PendingCallContract ¶ added in v1.7.6
func (m *MockClient) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error)
func (*MockClient) PendingCodeAt ¶ added in v1.7.6
func (*MockClient) PendingNonceAt ¶ added in v1.7.6
func (*MockClient) PendingStorageAt ¶ added in v1.7.6
func (*MockClient) PendingTransactionCount ¶ added in v1.7.6
func (m *MockClient) PendingTransactionCount(ctx context.Context) (uint, error)
func (*MockClient) RPC ¶ added in v1.7.6
func (m *MockClient) RPC() client.RPC
func (*MockClient) SendTransaction ¶ added in v1.7.6
func (m *MockClient) SendTransaction(ctx context.Context, tx *types.Transaction) error
func (*MockClient) SubscribeFilterLogs ¶ added in v1.7.6
func (*MockClient) SubscribeNewHead ¶ added in v1.7.6
func (*MockClient) SuggestGasPrice ¶ added in v1.7.6
func (*MockClient) SuggestGasTipCap ¶ added in v1.7.6
func (*MockClient) SyncProgress ¶ added in v1.7.6
func (m *MockClient) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error)
func (*MockClient) TransactionByHash ¶ added in v1.7.6
func (m *MockClient) TransactionByHash(ctx context.Context, hash common.Hash) (*types.Transaction, bool, error)
func (*MockClient) TransactionCount ¶ added in v1.7.6
func (*MockClient) TransactionInBlock ¶ added in v1.7.6
func (m *MockClient) TransactionInBlock(ctx context.Context, hash common.Hash, index uint) (*types.Transaction, error)
func (*MockClient) TransactionReceipt ¶ added in v1.7.6
func (*MockClient) TransactionSender ¶ added in v1.7.6
type MockDebugClient ¶
func (*MockDebugClient) CodeByHash ¶
func (*MockDebugClient) ExpectCodeByHash ¶
func (m *MockDebugClient) ExpectCodeByHash(hash common.Hash, res []byte, err error)
func (*MockDebugClient) ExpectNodeByHash ¶
func (m *MockDebugClient) ExpectNodeByHash(hash common.Hash, res []byte, err error)
func (*MockDebugClient) NodeByHash ¶
type MockEmitter ¶ added in v1.8.0
func (*MockEmitter) AssertExpectations ¶ added in v1.8.0
func (m *MockEmitter) AssertExpectations(t mock.TestingT)
func (*MockEmitter) Emit ¶ added in v1.8.0
func (m *MockEmitter) Emit(ev event.Event)
func (*MockEmitter) ExpectMaybeRun ¶ added in v1.8.0
func (m *MockEmitter) ExpectMaybeRun(fn func(ev event.Event))
func (*MockEmitter) ExpectOnce ¶ added in v1.8.0
func (m *MockEmitter) ExpectOnce(expected event.Event)
func (*MockEmitter) ExpectOnceRun ¶ added in v1.8.0
func (m *MockEmitter) ExpectOnceRun(fn func(ev event.Event))
func (*MockEmitter) ExpectOnceType ¶ added in v1.8.0
func (m *MockEmitter) ExpectOnceType(typ string)
type MockEngine ¶
type MockEngine struct {
MockL2Client
}
func (*MockEngine) ExpectForkchoiceUpdate ¶
func (m *MockEngine) ExpectForkchoiceUpdate(state *eth.ForkchoiceState, attr *eth.PayloadAttributes, result *eth.ForkchoiceUpdatedResult, err error)
func (*MockEngine) ExpectGetPayload ¶
func (m *MockEngine) ExpectGetPayload(payloadId eth.PayloadID, payload *eth.ExecutionPayloadEnvelope, err error)
func (*MockEngine) ExpectNewPayload ¶
func (m *MockEngine) ExpectNewPayload(payload *eth.ExecutionPayload, parentBeaconBlockRoot *common.Hash, result *eth.PayloadStatusV1, err error)
func (*MockEngine) ForkchoiceUpdate ¶
func (m *MockEngine) ForkchoiceUpdate(ctx context.Context, state *eth.ForkchoiceState, attr *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)
func (*MockEngine) GetPayload ¶
func (m *MockEngine) GetPayload(ctx context.Context, payloadInfo eth.PayloadInfo) (*eth.ExecutionPayloadEnvelope, error)
func (*MockEngine) NewPayload ¶
func (m *MockEngine) NewPayload(ctx context.Context, payload *eth.ExecutionPayload, parentBeaconBlockRoot *common.Hash) (*eth.PayloadStatusV1, error)
type MockEthClient ¶
func (*MockEthClient) BlockByNumber ¶ added in v1.4.2
func (*MockEthClient) Client ¶ added in v1.9.5
func (m *MockEthClient) Client() *rpc.Client
func (*MockEthClient) Close ¶ added in v1.4.2
func (m *MockEthClient) Close()
func (*MockEthClient) ExpectBlockByNumber ¶ added in v1.4.2
func (*MockEthClient) ExpectClose ¶ added in v1.4.2
func (m *MockEthClient) ExpectClose()
func (*MockEthClient) ExpectFetchReceipts ¶
func (*MockEthClient) ExpectGetProof ¶
func (m *MockEthClient) ExpectGetProof(address common.Address, storage []common.Hash, blockTag string, result *eth.AccountResult, err error)
func (*MockEthClient) ExpectGetStorageAt ¶
func (*MockEthClient) ExpectInfoAndTxsByHash ¶
func (m *MockEthClient) ExpectInfoAndTxsByHash(hash common.Hash, info eth.BlockInfo, transactions types.Transactions, err error)
func (*MockEthClient) ExpectInfoAndTxsByLabel ¶
func (m *MockEthClient) ExpectInfoAndTxsByLabel(label eth.BlockLabel, info eth.BlockInfo, transactions types.Transactions, err error)
func (*MockEthClient) ExpectInfoAndTxsByNumber ¶
func (m *MockEthClient) ExpectInfoAndTxsByNumber(number uint64, info eth.BlockInfo, transactions types.Transactions, err error)
func (*MockEthClient) ExpectInfoByHash ¶
func (*MockEthClient) ExpectInfoByLabel ¶
func (m *MockEthClient) ExpectInfoByLabel(label eth.BlockLabel, info eth.BlockInfo, err error)
func (*MockEthClient) ExpectInfoByNumber ¶
func (m *MockEthClient) ExpectInfoByNumber(number uint64, info eth.BlockInfo, err error)
func (*MockEthClient) ExpectPayloadByHash ¶
func (m *MockEthClient) ExpectPayloadByHash(hash common.Hash, payload *eth.ExecutionPayloadEnvelope, err error)
func (*MockEthClient) ExpectPayloadByLabel ¶
func (m *MockEthClient) ExpectPayloadByLabel(label eth.BlockLabel, payload *eth.ExecutionPayloadEnvelope, err error)
func (*MockEthClient) ExpectPayloadByNumber ¶
func (m *MockEthClient) ExpectPayloadByNumber(n uint64, payload *eth.ExecutionPayloadEnvelope, err error)
func (*MockEthClient) ExpectReadStorageAt ¶
func (*MockEthClient) FetchReceipts ¶
func (*MockEthClient) GetStorageAt ¶
func (*MockEthClient) InfoAndTxsByHash ¶
func (m *MockEthClient) InfoAndTxsByHash(ctx context.Context, hash common.Hash) (eth.BlockInfo, types.Transactions, error)
func (*MockEthClient) InfoAndTxsByLabel ¶
func (m *MockEthClient) InfoAndTxsByLabel(ctx context.Context, label eth.BlockLabel) (eth.BlockInfo, types.Transactions, error)
func (*MockEthClient) InfoAndTxsByNumber ¶
func (m *MockEthClient) InfoAndTxsByNumber(ctx context.Context, number uint64) (eth.BlockInfo, types.Transactions, error)
func (*MockEthClient) InfoByHash ¶
func (*MockEthClient) InfoByLabel ¶
func (m *MockEthClient) InfoByLabel(ctx context.Context, label eth.BlockLabel) (eth.BlockInfo, error)
func (*MockEthClient) InfoByNumber ¶
func (*MockEthClient) MaybeClose ¶ added in v1.4.2
func (m *MockEthClient) MaybeClose()
func (*MockEthClient) PayloadByHash ¶
func (m *MockEthClient) PayloadByHash(ctx context.Context, hash common.Hash) (*eth.ExecutionPayloadEnvelope, error)
func (*MockEthClient) PayloadByLabel ¶
func (m *MockEthClient) PayloadByLabel(ctx context.Context, label eth.BlockLabel) (*eth.ExecutionPayloadEnvelope, error)
func (*MockEthClient) PayloadByNumber ¶
func (m *MockEthClient) PayloadByNumber(ctx context.Context, n uint64) (*eth.ExecutionPayloadEnvelope, error)
type MockInteropBackend ¶ added in v1.9.3
func (*MockInteropBackend) AssertExpectations ¶ added in v1.9.3
func (m *MockInteropBackend) AssertExpectations(t mock.TestingT)
func (*MockInteropBackend) CrossDerivedFrom ¶ added in v1.9.5
func (m *MockInteropBackend) CrossDerivedFrom(ctx context.Context, chainID types.ChainID, derived eth.BlockID) (eth.L1BlockRef, error)
func (*MockInteropBackend) ExpectAnyUpdateLocalUnsafe ¶ added in v1.9.5
func (m *MockInteropBackend) ExpectAnyUpdateLocalUnsafe(chainID types.ChainID, err error)
func (*MockInteropBackend) ExpectDerivedFrom ¶ added in v1.9.5
func (m *MockInteropBackend) ExpectDerivedFrom(chainID types.ChainID, derived eth.BlockID, result eth.L1BlockRef, err error)
func (*MockInteropBackend) ExpectFinalized ¶ added in v1.9.5
func (*MockInteropBackend) ExpectSafeView ¶ added in v1.9.5
func (m *MockInteropBackend) ExpectSafeView(chainID types.ChainID, safe types.ReferenceView, result types.ReferenceView, err error)
func (*MockInteropBackend) ExpectUnsafeView ¶ added in v1.9.5
func (m *MockInteropBackend) ExpectUnsafeView(chainID types.ChainID, unsafe types.ReferenceView, result types.ReferenceView, err error)
func (*MockInteropBackend) ExpectUpdateFinalizedL1 ¶ added in v1.9.5
func (m *MockInteropBackend) ExpectUpdateFinalizedL1(chainID types.ChainID, finalized eth.L1BlockRef, err error)
func (*MockInteropBackend) ExpectUpdateLocalSafe ¶ added in v1.9.5
func (m *MockInteropBackend) ExpectUpdateLocalSafe(chainID types.ChainID, derivedFrom eth.L1BlockRef, lastDerived eth.BlockRef, err error)
func (*MockInteropBackend) ExpectUpdateLocalUnsafe ¶ added in v1.9.5
func (*MockInteropBackend) OnSafeView ¶ added in v1.9.5
func (m *MockInteropBackend) OnSafeView(chainID types.ChainID, fn func(request types.ReferenceView) (result types.ReferenceView, err error))
func (*MockInteropBackend) OnUnsafeView ¶ added in v1.9.5
func (m *MockInteropBackend) OnUnsafeView(chainID types.ChainID, fn func(request types.ReferenceView) (result types.ReferenceView, err error))
func (*MockInteropBackend) SafeView ¶ added in v1.9.5
func (m *MockInteropBackend) SafeView(ctx context.Context, chainID types.ChainID, safe types.ReferenceView) (types.ReferenceView, error)
func (*MockInteropBackend) UnsafeView ¶ added in v1.9.5
func (m *MockInteropBackend) UnsafeView(ctx context.Context, chainID types.ChainID, unsafe types.ReferenceView) (types.ReferenceView, error)
func (*MockInteropBackend) UpdateFinalizedL1 ¶ added in v1.9.5
func (m *MockInteropBackend) UpdateFinalizedL1(ctx context.Context, chainID types.ChainID, finalized eth.L1BlockRef) error
func (*MockInteropBackend) UpdateLocalSafe ¶ added in v1.9.5
func (m *MockInteropBackend) UpdateLocalSafe(ctx context.Context, chainID types.ChainID, derivedFrom eth.L1BlockRef, lastDerived eth.BlockRef) error
func (*MockInteropBackend) UpdateLocalUnsafe ¶ added in v1.9.5
type MockL1Source ¶
type MockL1Source struct {
MockEthClient
}
func (*MockL1Source) ExpectL1BlockRefByHash ¶
func (m *MockL1Source) ExpectL1BlockRefByHash(hash common.Hash, ref eth.L1BlockRef, err error)
func (*MockL1Source) ExpectL1BlockRefByLabel ¶
func (m *MockL1Source) ExpectL1BlockRefByLabel(label eth.BlockLabel, ref eth.L1BlockRef, err error)
func (*MockL1Source) ExpectL1BlockRefByNumber ¶
func (m *MockL1Source) ExpectL1BlockRefByNumber(num uint64, ref eth.L1BlockRef, err error)
func (*MockL1Source) L1BlockRefByHash ¶
func (m *MockL1Source) L1BlockRefByHash(ctx context.Context, hash common.Hash) (eth.L1BlockRef, error)
func (*MockL1Source) L1BlockRefByLabel ¶
func (m *MockL1Source) L1BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L1BlockRef, error)
func (*MockL1Source) L1BlockRefByNumber ¶
func (m *MockL1Source) L1BlockRefByNumber(ctx context.Context, num uint64) (eth.L1BlockRef, error)
type MockL2Client ¶
type MockL2Client struct {
MockEthClient
}
func (*MockL2Client) ExpectL2BlockRefByHash ¶
func (m *MockL2Client) ExpectL2BlockRefByHash(hash common.Hash, ref eth.L2BlockRef, err error)
func (*MockL2Client) ExpectL2BlockRefByLabel ¶
func (m *MockL2Client) ExpectL2BlockRefByLabel(label eth.BlockLabel, ref eth.L2BlockRef, err error)
func (*MockL2Client) ExpectL2BlockRefByNumber ¶
func (m *MockL2Client) ExpectL2BlockRefByNumber(num uint64, ref eth.L2BlockRef, err error)
func (*MockL2Client) ExpectOutputV0AtBlock ¶
func (*MockL2Client) ExpectSystemConfigByL2Hash ¶
func (m *MockL2Client) ExpectSystemConfigByL2Hash(hash common.Hash, cfg eth.SystemConfig, err error)
func (*MockL2Client) L2BlockRefByHash ¶
func (c *MockL2Client) L2BlockRefByHash(ctx context.Context, hash common.Hash) (eth.L2BlockRef, error)
func (*MockL2Client) L2BlockRefByLabel ¶
func (c *MockL2Client) L2BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L2BlockRef, error)
func (*MockL2Client) L2BlockRefByNumber ¶
func (c *MockL2Client) L2BlockRefByNumber(ctx context.Context, num uint64) (eth.L2BlockRef, error)
func (*MockL2Client) OutputV0AtBlock ¶
func (*MockL2Client) SystemConfigByL2Hash ¶
func (m *MockL2Client) SystemConfigByL2Hash(ctx context.Context, hash common.Hash) (eth.SystemConfig, error)
type MockRPC ¶ added in v1.7.6
func (*MockRPC) BatchCallContext ¶ added in v1.7.6
func (*MockRPC) CallContext ¶ added in v1.7.6
func (*MockRPC) EthSubscribe ¶ added in v1.7.6
func (*MockRPC) ExpectBatchCallContext ¶ added in v1.7.6
func (*MockRPC) ExpectCallContext ¶ added in v1.7.6
func (*MockRPC) ExpectClose ¶ added in v1.7.6
func (m *MockRPC) ExpectClose()
type MockRollupClient ¶ added in v1.4.2
func (*MockRollupClient) Close ¶ added in v1.4.2
func (m *MockRollupClient) Close()
func (*MockRollupClient) ExpectClose ¶ added in v1.4.2
func (m *MockRollupClient) ExpectClose()
func (*MockRollupClient) ExpectOutputAtBlock ¶ added in v1.4.2
func (m *MockRollupClient) ExpectOutputAtBlock(blockNum uint64, response *eth.OutputResponse, err error) *mock.Call
func (*MockRollupClient) ExpectRollupConfig ¶ added in v1.4.2
func (m *MockRollupClient) ExpectRollupConfig(config *rollup.Config, err error)
func (*MockRollupClient) ExpectSequencerActive ¶ added in v1.4.2
func (m *MockRollupClient) ExpectSequencerActive(active bool, err error)
func (*MockRollupClient) ExpectStartSequencer ¶ added in v1.4.2
func (m *MockRollupClient) ExpectStartSequencer(unsafeHead common.Hash, err error)
func (*MockRollupClient) ExpectSyncStatus ¶ added in v1.4.2
func (m *MockRollupClient) ExpectSyncStatus(status *eth.SyncStatus, err error)
func (*MockRollupClient) MaybeClose ¶ added in v1.4.2
func (m *MockRollupClient) MaybeClose()
func (*MockRollupClient) OutputAtBlock ¶ added in v1.4.2
func (m *MockRollupClient) OutputAtBlock(ctx context.Context, blockNum uint64) (*eth.OutputResponse, error)
func (*MockRollupClient) RollupConfig ¶ added in v1.4.2
func (*MockRollupClient) SequencerActive ¶ added in v1.4.2
func (m *MockRollupClient) SequencerActive(ctx context.Context) (bool, error)
func (*MockRollupClient) StartSequencer ¶ added in v1.4.2
func (*MockRollupClient) SyncStatus ¶ added in v1.4.2
func (m *MockRollupClient) SyncStatus(ctx context.Context) (*eth.SyncStatus, error)
type MockRuntimeConfig ¶
func (*MockRuntimeConfig) P2PSequencerAddress ¶
func (m *MockRuntimeConfig) P2PSequencerAddress() common.Address
type RPCErrFaker ¶
type RPCErrFaker struct { // RPC to call when no ErrFn is set, or the ErrFn does not return an error RPC client.RPC // ErrFn returns an error when the RPC needs to return error upon a call, batch call or subscription (nil input). // The RPC operates without fake errors if the ErrFn is nil, or returns nil. ErrFn func(call []rpc.BatchElem) error }
RPCErrFaker implements an RPC by wrapping one, but returns an error when prepared with one, to test RPC error handling.
func (RPCErrFaker) BatchCallContext ¶
func (RPCErrFaker) CallContext ¶
func (RPCErrFaker) Close ¶
func (r RPCErrFaker) Close()
func (RPCErrFaker) EthSubscribe ¶
type TestDerivationMetrics ¶
type TestDerivationMetrics struct { FnRecordL1ReorgDepth func(d uint64) FnRecordL1Ref func(name string, ref eth.L1BlockRef) FnRecordL2Ref func(name string, ref eth.L2BlockRef) FnRecordUnsafePayloads func(length uint64, memSize uint64, next eth.BlockID) FnRecordChannelInputBytes func(inputCompressedBytes int) FnRecordChannelTimedOut func() }
TestDerivationMetrics implements the metrics used in the derivation pipeline as no-op operations. Optionally a test may hook into the metrics
func (*TestDerivationMetrics) CountSequencedTxs ¶ added in v1.8.0
func (t *TestDerivationMetrics) CountSequencedTxs(count int)
func (*TestDerivationMetrics) RecordChannelInputBytes ¶
func (t *TestDerivationMetrics) RecordChannelInputBytes(inputCompressedBytes int)
func (*TestDerivationMetrics) RecordChannelTimedOut ¶
func (t *TestDerivationMetrics) RecordChannelTimedOut()
func (*TestDerivationMetrics) RecordDerivedBatches ¶ added in v1.4.2
func (n *TestDerivationMetrics) RecordDerivedBatches(batchType string)
func (*TestDerivationMetrics) RecordFrame ¶
func (t *TestDerivationMetrics) RecordFrame()
func (*TestDerivationMetrics) RecordHeadChannelOpened ¶
func (t *TestDerivationMetrics) RecordHeadChannelOpened()
func (*TestDerivationMetrics) RecordL1Ref ¶
func (t *TestDerivationMetrics) RecordL1Ref(name string, ref eth.L1BlockRef)
func (*TestDerivationMetrics) RecordL1ReorgDepth ¶
func (t *TestDerivationMetrics) RecordL1ReorgDepth(d uint64)
func (*TestDerivationMetrics) RecordL2Ref ¶
func (t *TestDerivationMetrics) RecordL2Ref(name string, ref eth.L2BlockRef)
func (*TestDerivationMetrics) RecordPipelineReset ¶ added in v1.8.0
func (t *TestDerivationMetrics) RecordPipelineReset()
func (*TestDerivationMetrics) RecordSequencerBuildingDiffTime ¶ added in v1.8.0
func (t *TestDerivationMetrics) RecordSequencerBuildingDiffTime(duration time.Duration)
func (*TestDerivationMetrics) RecordSequencerSealingTime ¶ added in v1.8.0
func (t *TestDerivationMetrics) RecordSequencerSealingTime(duration time.Duration)
func (*TestDerivationMetrics) RecordUnsafePayloadsBuffer ¶
func (t *TestDerivationMetrics) RecordUnsafePayloadsBuffer(length uint64, memSize uint64, next eth.BlockID)
func (*TestDerivationMetrics) SetDerivationIdle ¶ added in v1.8.0
func (t *TestDerivationMetrics) SetDerivationIdle(idle bool)
type TestID ¶
type TestID string
TestID represents an eth.BlockID as string, and can be shortened for convenience in test definitions.
Format: <hash-characters>:<number> where the <hash-characters> are copied over (i.e. not hex) and <number> is in decimal.
Examples: "foobar:123", or "B:2"
type TestRPCMetrics ¶
type TestRPCMetrics struct{}
func (*TestRPCMetrics) RecordRPCClientRequest ¶
func (n *TestRPCMetrics) RecordRPCClientRequest(method string) func(err error)
func (*TestRPCMetrics) RecordRPCClientResponse ¶
func (n *TestRPCMetrics) RecordRPCClientResponse(method string, err error)
func (*TestRPCMetrics) RecordRPCServerRequest ¶
func (n *TestRPCMetrics) RecordRPCServerRequest(method string) func()
Source Files ¶
- assertions.go
- block_id.go
- deposits.go
- fake_chain.go
- fake_interop_backend.go
- l1info.go
- metrics.go
- mock_blobs_fetcher.go
- mock_client.go
- mock_debug_client.go
- mock_emitter.go
- mock_engine.go
- mock_eth_client.go
- mock_interop_backend.go
- mock_l1.go
- mock_l2.go
- mock_rollup_client.go
- mock_rpc.go
- random.go
- random_keys.go
- rpc_err_faker.go
- runtime_config.go