Documentation ¶
Index ¶
- func FakeGenesis(l1 rune, l2 rune, l1GenesisNumber int) 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 MakeL1Info(fn func(l *MockL1Info)) func(rng *rand.Rand) *MockL1Info
- 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 RandomAddress(rng *rand.Rand) (out common.Address)
- func RandomBlockID(rng *rand.Rand) eth.BlockID
- func RandomBlockRef(rng *rand.Rand) eth.L1BlockRef
- func RandomData(rng *rand.Rand, size int) []byte
- func RandomETH(rng *rand.Rand, max int64) *big.Int
- func RandomHash(rng *rand.Rand) (out common.Hash)
- func RandomKey() *ecdsa.PrivateKey
- func RandomL2BlockRef(rng *rand.Rand) eth.L2BlockRef
- 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) L1BlockRefByNumber(ctx context.Context, l1Num uint64) (eth.L1BlockRef, error)
- func (m *FakeChainSource) L1Head() eth.L1BlockRef
- func (m *FakeChainSource) L1HeadBlockRef(ctx context.Context) (eth.L1BlockRef, error)
- 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) L2BlockRefByNumber(ctx context.Context, l2Num *big.Int) (eth.L2BlockRef, error)
- func (m *FakeChainSource) L2BlockRefHead(ctx context.Context) (eth.L2BlockRef, error)
- func (m *FakeChainSource) ReorgL1()
- func (m *FakeChainSource) SetL2Head(head int) eth.L2BlockRef
- type MockEngine
- func (m *MockEngine) ExpectForkchoiceUpdate(state *eth.ForkchoiceState, attr *eth.PayloadAttributes, ...)
- func (m *MockEngine) ExpectGetPayload(payloadId eth.PayloadID, payload *eth.ExecutionPayload, err error)
- func (m *MockEngine) ExpectL2BlockRefByHash(l2Hash common.Hash, ref eth.L1BlockRef, err error)
- func (m *MockEngine) ExpectL2BlockRefHead(ref eth.L1BlockRef, err error)
- func (m *MockEngine) ExpectNewPayload(payload *eth.ExecutionPayload, result *eth.PayloadStatusV1, err error)
- func (m *MockEngine) ExpectPayloadByHash(hash common.Hash, payload *eth.ExecutionPayload, err error)
- func (m *MockEngine) ExpectPayloadByNumber(hash common.Hash, payload *eth.ExecutionPayload, err error)
- func (m *MockEngine) ForkchoiceUpdate(ctx context.Context, state *eth.ForkchoiceState, attr *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error)
- func (m *MockEngine) GetPayload(ctx context.Context, payloadId eth.PayloadID) (*eth.ExecutionPayload, error)
- func (m *MockEngine) L2BlockRefByHash(ctx context.Context, l2Hash common.Hash) (eth.L2BlockRef, error)
- func (m *MockEngine) L2BlockRefHead(ctx context.Context) (eth.L2BlockRef, error)
- func (m *MockEngine) NewPayload(ctx context.Context, payload *eth.ExecutionPayload) (*eth.PayloadStatusV1, error)
- func (m *MockEngine) PayloadByHash(ctx context.Context, hash common.Hash) (*eth.ExecutionPayload, error)
- func (m *MockEngine) PayloadByNumber(ctx context.Context, n uint64) (*eth.ExecutionPayload, error)
- type MockL1Info
- func (l *MockL1Info) BaseFee() *big.Int
- func (l *MockL1Info) BlockRef() eth.L1BlockRef
- func (l *MockL1Info) Hash() common.Hash
- func (l *MockL1Info) ID() eth.BlockID
- func (l *MockL1Info) MixDigest() common.Hash
- func (l *MockL1Info) NumberU64() uint64
- func (l *MockL1Info) ParentHash() common.Hash
- func (l *MockL1Info) ReceiptHash() common.Hash
- func (l *MockL1Info) Root() common.Hash
- func (l *MockL1Info) SequenceNumber() uint64
- func (l *MockL1Info) Time() uint64
- type MockL1Source
- func (m *MockL1Source) ExpectFetch(hash common.Hash, info eth.L1Info, transactions types.Transactions, ...)
- func (m *MockL1Source) ExpectInfoAndTxsByHash(hash common.Hash, info eth.L1Info, transactions types.Transactions, err error)
- func (m *MockL1Source) ExpectInfoByHash(hash common.Hash, info eth.L1Info, err error)
- func (m *MockL1Source) ExpectL1BlockRefByHash(hash common.Hash, ref eth.L1BlockRef, err error)
- func (m *MockL1Source) ExpectL1BlockRefByNumber(u uint64, ref eth.L1BlockRef, err error)
- func (m *MockL1Source) Fetch(ctx context.Context, blockHash common.Hash) (eth.L1Info, types.Transactions, types.Receipts, error)
- func (m *MockL1Source) InfoAndTxsByHash(ctx context.Context, hash common.Hash) (eth.L1Info, types.Transactions, error)
- func (m *MockL1Source) InfoByHash(ctx context.Context, hash common.Hash) (eth.L1Info, error)
- func (m *MockL1Source) L1BlockRefByHash(ctx context.Context, hash common.Hash) (eth.L1BlockRef, error)
- func (m *MockL1Source) L1BlockRefByNumber(ctx context.Context, u uint64) (eth.L1BlockRef, error)
- func (m *MockL1Source) L1HeadBlockRef(ctx context.Context) (eth.L1BlockRef, error)
- type TestID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 MakeL1Info ¶ added in v0.3.0
func MakeL1Info(fn func(l *MockL1Info)) func(rng *rand.Rand) *MockL1Info
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 RandomBlockRef ¶
func RandomBlockRef(rng *rand.Rand) eth.L1BlockRef
func RandomKey ¶
func RandomKey() *ecdsa.PrivateKey
func RandomL2BlockRef ¶
func RandomL2BlockRef(rng *rand.Rand) eth.L2BlockRef
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) L1BlockRefByNumber ¶
func (m *FakeChainSource) L1BlockRefByNumber(ctx context.Context, l1Num uint64) (eth.L1BlockRef, error)
func (*FakeChainSource) L1Head ¶
func (m *FakeChainSource) L1Head() eth.L1BlockRef
func (*FakeChainSource) L1HeadBlockRef ¶ added in v0.3.0
func (m *FakeChainSource) L1HeadBlockRef(ctx context.Context) (eth.L1BlockRef, error)
func (*FakeChainSource) L2BlockRefByHash ¶
func (m *FakeChainSource) L2BlockRefByHash(ctx context.Context, l2Hash common.Hash) (eth.L2BlockRef, error)
func (*FakeChainSource) L2BlockRefByNumber ¶
func (m *FakeChainSource) L2BlockRefByNumber(ctx context.Context, l2Num *big.Int) (eth.L2BlockRef, error)
func (*FakeChainSource) L2BlockRefHead ¶ added in v0.3.0
func (m *FakeChainSource) L2BlockRefHead(ctx context.Context) (eth.L2BlockRef, error)
func (*FakeChainSource) ReorgL1 ¶
func (m *FakeChainSource) ReorgL1()
func (*FakeChainSource) SetL2Head ¶
func (m *FakeChainSource) SetL2Head(head int) eth.L2BlockRef
type MockEngine ¶
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.ExecutionPayload, err error)
func (*MockEngine) ExpectL2BlockRefByHash ¶ added in v0.3.0
func (m *MockEngine) ExpectL2BlockRefByHash(l2Hash common.Hash, ref eth.L1BlockRef, err error)
func (*MockEngine) ExpectL2BlockRefHead ¶ added in v0.3.0
func (m *MockEngine) ExpectL2BlockRefHead(ref eth.L1BlockRef, err error)
func (*MockEngine) ExpectNewPayload ¶
func (m *MockEngine) ExpectNewPayload(payload *eth.ExecutionPayload, result *eth.PayloadStatusV1, err error)
func (*MockEngine) ExpectPayloadByHash ¶ added in v0.3.0
func (m *MockEngine) ExpectPayloadByHash(hash common.Hash, payload *eth.ExecutionPayload, err error)
func (*MockEngine) ExpectPayloadByNumber ¶ added in v0.3.0
func (m *MockEngine) ExpectPayloadByNumber(hash common.Hash, payload *eth.ExecutionPayload, 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, payloadId eth.PayloadID) (*eth.ExecutionPayload, error)
func (*MockEngine) L2BlockRefByHash ¶ added in v0.3.0
func (m *MockEngine) L2BlockRefByHash(ctx context.Context, l2Hash common.Hash) (eth.L2BlockRef, error)
func (*MockEngine) L2BlockRefHead ¶ added in v0.3.0
func (m *MockEngine) L2BlockRefHead(ctx context.Context) (eth.L2BlockRef, error)
func (*MockEngine) NewPayload ¶
func (m *MockEngine) NewPayload(ctx context.Context, payload *eth.ExecutionPayload) (*eth.PayloadStatusV1, error)
func (*MockEngine) PayloadByHash ¶ added in v0.3.0
func (m *MockEngine) PayloadByHash(ctx context.Context, hash common.Hash) (*eth.ExecutionPayload, error)
func (*MockEngine) PayloadByNumber ¶ added in v0.3.0
func (m *MockEngine) PayloadByNumber(ctx context.Context, n uint64) (*eth.ExecutionPayload, error)
type MockL1Info ¶ added in v0.3.0
type MockL1Info struct { InfoHash common.Hash InfoParentHash common.Hash InfoRoot common.Hash InfoNum uint64 InfoTime uint64 InfoMixDigest [32]byte InfoBaseFee *big.Int InfoReceiptRoot common.Hash InfoSequenceNumber uint64 }
func RandomL1Info ¶ added in v0.3.0
func RandomL1Info(rng *rand.Rand) *MockL1Info
func (*MockL1Info) BaseFee ¶ added in v0.3.0
func (l *MockL1Info) BaseFee() *big.Int
func (*MockL1Info) BlockRef ¶ added in v0.3.0
func (l *MockL1Info) BlockRef() eth.L1BlockRef
func (*MockL1Info) Hash ¶ added in v0.3.0
func (l *MockL1Info) Hash() common.Hash
func (*MockL1Info) ID ¶ added in v0.3.0
func (l *MockL1Info) ID() eth.BlockID
func (*MockL1Info) MixDigest ¶ added in v0.3.0
func (l *MockL1Info) MixDigest() common.Hash
func (*MockL1Info) NumberU64 ¶ added in v0.3.0
func (l *MockL1Info) NumberU64() uint64
func (*MockL1Info) ParentHash ¶ added in v0.3.0
func (l *MockL1Info) ParentHash() common.Hash
func (*MockL1Info) ReceiptHash ¶ added in v0.3.0
func (l *MockL1Info) ReceiptHash() common.Hash
func (*MockL1Info) Root ¶ added in v0.3.0
func (l *MockL1Info) Root() common.Hash
func (*MockL1Info) SequenceNumber ¶ added in v0.3.0
func (l *MockL1Info) SequenceNumber() uint64
func (*MockL1Info) Time ¶ added in v0.3.0
func (l *MockL1Info) Time() uint64
type MockL1Source ¶
func (*MockL1Source) ExpectFetch ¶ added in v0.3.0
func (m *MockL1Source) ExpectFetch(hash common.Hash, info eth.L1Info, transactions types.Transactions, receipts types.Receipts, err error)
func (*MockL1Source) ExpectInfoAndTxsByHash ¶ added in v0.3.0
func (m *MockL1Source) ExpectInfoAndTxsByHash(hash common.Hash, info eth.L1Info, transactions types.Transactions, err error)
func (*MockL1Source) ExpectInfoByHash ¶ added in v0.4.0
func (*MockL1Source) ExpectL1BlockRefByHash ¶
func (m *MockL1Source) ExpectL1BlockRefByHash(hash common.Hash, ref eth.L1BlockRef, err error)
func (*MockL1Source) ExpectL1BlockRefByNumber ¶
func (m *MockL1Source) ExpectL1BlockRefByNumber(u uint64, ref eth.L1BlockRef, err error)
func (*MockL1Source) InfoAndTxsByHash ¶ added in v0.3.0
func (m *MockL1Source) InfoAndTxsByHash(ctx context.Context, hash common.Hash) (eth.L1Info, types.Transactions, error)
func (*MockL1Source) InfoByHash ¶ added in v0.4.0
func (*MockL1Source) L1BlockRefByHash ¶
func (m *MockL1Source) L1BlockRefByHash(ctx context.Context, hash common.Hash) (eth.L1BlockRef, error)
func (*MockL1Source) L1BlockRefByNumber ¶
func (m *MockL1Source) L1BlockRefByNumber(ctx context.Context, u uint64) (eth.L1BlockRef, error)
func (*MockL1Source) L1HeadBlockRef ¶ added in v0.4.0
func (m *MockL1Source) L1HeadBlockRef(ctx context.Context) (eth.L1BlockRef, error)
Click to show internal directories.
Click to hide internal directories.