mocks

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EthermanMock added in v0.0.990

type EthermanMock struct {
	mock.Mock
}

EthermanMock is an autogenerated mock type for the EthermanInterface type

func NewEthermanMock added in v0.0.990

func NewEthermanMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *EthermanMock

NewEthermanMock creates a new instance of EthermanMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*EthermanMock) GetFinalizedBlockNumber added in v0.0.990

func (_m *EthermanMock) GetFinalizedBlockNumber(ctx context.Context) (uint64, error)

GetFinalizedBlockNumber provides a mock function with given fields: ctx

func (*EthermanMock) GetSafeBlockNumber added in v0.0.990

func (_m *EthermanMock) GetSafeBlockNumber(ctx context.Context) (uint64, error)

GetSafeBlockNumber provides a mock function with given fields: ctx

type PoolMock

type PoolMock struct {
	mock.Mock
}

PoolMock is an autogenerated mock type for the PoolInterface type

func NewPoolMock

func NewPoolMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *PoolMock

NewPoolMock creates a new instance of PoolMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*PoolMock) AddTx

func (_m *PoolMock) AddTx(ctx context.Context, tx types.Transaction, ip string) error

AddTx provides a mock function with given fields: ctx, tx, ip

func (*PoolMock) CalculateEffectiveGasPrice added in v0.4.5

func (_m *PoolMock) CalculateEffectiveGasPrice(rawTx []byte, txGasPrice *big.Int, txGasUsed uint64, l1GasPrice uint64, l2GasPrice uint64) (*big.Int, error)

CalculateEffectiveGasPrice provides a mock function with given fields: rawTx, txGasPrice, txGasUsed, l1GasPrice, l2GasPrice

func (*PoolMock) CountPendingTransactions

func (_m *PoolMock) CountPendingTransactions(ctx context.Context) (uint64, error)

CountPendingTransactions provides a mock function with given fields: ctx

func (*PoolMock) EffectiveGasPriceEnabled added in v0.4.5

func (_m *PoolMock) EffectiveGasPriceEnabled() bool

EffectiveGasPriceEnabled provides a mock function with given fields:

func (*PoolMock) GetGasPrices added in v0.0.990

func (_m *PoolMock) GetGasPrices(ctx context.Context) (pool.GasPrices, error)

GetGasPrices provides a mock function with given fields: ctx

func (*PoolMock) GetNonce

func (_m *PoolMock) GetNonce(ctx context.Context, address common.Address) (uint64, error)

GetNonce provides a mock function with given fields: ctx, address

func (*PoolMock) GetPendingTxHashesSince

func (_m *PoolMock) GetPendingTxHashesSince(ctx context.Context, since time.Time) ([]common.Hash, error)

GetPendingTxHashesSince provides a mock function with given fields: ctx, since

func (*PoolMock) GetPendingTxs

func (_m *PoolMock) GetPendingTxs(ctx context.Context, limit uint64) ([]pool.Transaction, error)

GetPendingTxs provides a mock function with given fields: ctx, limit

func (*PoolMock) GetTransactionByHash added in v0.5.0

func (_m *PoolMock) GetTransactionByHash(ctx context.Context, hash common.Hash) (*pool.Transaction, error)

GetTransactionByHash provides a mock function with given fields: ctx, hash

func (*PoolMock) GetTransactionByL2Hash added in v0.5.0

func (_m *PoolMock) GetTransactionByL2Hash(ctx context.Context, hash common.Hash) (*pool.Transaction, error)

GetTransactionByL2Hash provides a mock function with given fields: ctx, hash

type StateMock

type StateMock struct {
	mock.Mock
}

StateMock is an autogenerated mock type for the StateInterface type

func NewStateMock

func NewStateMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *StateMock

NewStateMock creates a new instance of StateMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*StateMock) BatchNumberByL2BlockNumber

func (_m *StateMock) BatchNumberByL2BlockNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (uint64, error)

BatchNumberByL2BlockNumber provides a mock function with given fields: ctx, blockNumber, dbTx

func (*StateMock) BeginStateTransaction

func (_m *StateMock) BeginStateTransaction(ctx context.Context) (pgx.Tx, error)

BeginStateTransaction provides a mock function with given fields: ctx

func (*StateMock) DebugTransaction

func (_m *StateMock) DebugTransaction(ctx context.Context, transactionHash common.Hash, traceConfig state.TraceConfig, dbTx pgx.Tx) (*runtime.ExecutionResult, error)

DebugTransaction provides a mock function with given fields: ctx, transactionHash, traceConfig, dbTx

func (*StateMock) EstimateGas

func (_m *StateMock) EstimateGas(transaction *coretypes.Transaction, senderAddress common.Address, l2BlockNumber *uint64, dbTx pgx.Tx) (uint64, []byte, error)

EstimateGas provides a mock function with given fields: transaction, senderAddress, l2BlockNumber, dbTx

func (*StateMock) GetBalance

func (_m *StateMock) GetBalance(ctx context.Context, address common.Address, root common.Hash) (*big.Int, error)

GetBalance provides a mock function with given fields: ctx, address, root

func (*StateMock) GetBatchByNumber

func (_m *StateMock) GetBatchByNumber(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.Batch, error)

GetBatchByNumber provides a mock function with given fields: ctx, batchNumber, dbTx

func (*StateMock) GetBatchTimestamp added in v0.5.0

func (_m *StateMock) GetBatchTimestamp(ctx context.Context, batchNumber uint64, forcedForkId *uint64, dbTx pgx.Tx) (*time.Time, error)

GetBatchTimestamp provides a mock function with given fields: ctx, batchNumber, forcedForkId, dbTx

func (*StateMock) GetCode

func (_m *StateMock) GetCode(ctx context.Context, address common.Address, root common.Hash) ([]byte, error)

GetCode provides a mock function with given fields: ctx, address, root

func (*StateMock) GetExitRootByGlobalExitRoot

func (_m *StateMock) GetExitRootByGlobalExitRoot(ctx context.Context, ger common.Hash, dbTx pgx.Tx) (*state.GlobalExitRoot, error)

GetExitRootByGlobalExitRoot provides a mock function with given fields: ctx, ger, dbTx

func (*StateMock) GetL2BlockByHash

func (_m *StateMock) GetL2BlockByHash(ctx context.Context, hash common.Hash, dbTx pgx.Tx) (*state.L2Block, error)

GetL2BlockByHash provides a mock function with given fields: ctx, hash, dbTx

func (*StateMock) GetL2BlockByNumber

func (_m *StateMock) GetL2BlockByNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*state.L2Block, error)

GetL2BlockByNumber provides a mock function with given fields: ctx, blockNumber, dbTx

func (*StateMock) GetL2BlockHashesSince

func (_m *StateMock) GetL2BlockHashesSince(ctx context.Context, since time.Time, dbTx pgx.Tx) ([]common.Hash, error)

GetL2BlockHashesSince provides a mock function with given fields: ctx, since, dbTx

func (*StateMock) GetL2BlockHeaderByNumber

func (_m *StateMock) GetL2BlockHeaderByNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*state.L2Header, error)

GetL2BlockHeaderByNumber provides a mock function with given fields: ctx, blockNumber, dbTx

func (*StateMock) GetL2BlockTransactionCountByHash

func (_m *StateMock) GetL2BlockTransactionCountByHash(ctx context.Context, hash common.Hash, dbTx pgx.Tx) (uint64, error)

GetL2BlockTransactionCountByHash provides a mock function with given fields: ctx, hash, dbTx

func (*StateMock) GetL2BlockTransactionCountByNumber

func (_m *StateMock) GetL2BlockTransactionCountByNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (uint64, error)

GetL2BlockTransactionCountByNumber provides a mock function with given fields: ctx, blockNumber, dbTx

func (*StateMock) GetL2BlocksByBatchNumber added in v0.0.990

func (_m *StateMock) GetL2BlocksByBatchNumber(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) ([]state.L2Block, error)

GetL2BlocksByBatchNumber provides a mock function with given fields: ctx, batchNumber, dbTx

func (*StateMock) GetL2TxHashByTxHash added in v0.5.0

func (_m *StateMock) GetL2TxHashByTxHash(ctx context.Context, hash common.Hash, dbTx pgx.Tx) (*common.Hash, error)

GetL2TxHashByTxHash provides a mock function with given fields: ctx, hash, dbTx

func (*StateMock) GetLastBatchNumber

func (_m *StateMock) GetLastBatchNumber(ctx context.Context, dbTx pgx.Tx) (uint64, error)

GetLastBatchNumber provides a mock function with given fields: ctx, dbTx

func (*StateMock) GetLastClosedBatchNumber added in v0.4.0

func (_m *StateMock) GetLastClosedBatchNumber(ctx context.Context, dbTx pgx.Tx) (uint64, error)

GetLastClosedBatchNumber provides a mock function with given fields: ctx, dbTx

func (*StateMock) GetLastConsolidatedL2BlockNumber

func (_m *StateMock) GetLastConsolidatedL2BlockNumber(ctx context.Context, dbTx pgx.Tx) (uint64, error)

GetLastConsolidatedL2BlockNumber provides a mock function with given fields: ctx, dbTx

func (*StateMock) GetLastL2Block

func (_m *StateMock) GetLastL2Block(ctx context.Context, dbTx pgx.Tx) (*state.L2Block, error)

GetLastL2Block provides a mock function with given fields: ctx, dbTx

func (*StateMock) GetLastL2BlockNumber

func (_m *StateMock) GetLastL2BlockNumber(ctx context.Context, dbTx pgx.Tx) (uint64, error)

GetLastL2BlockNumber provides a mock function with given fields: ctx, dbTx

func (*StateMock) GetLastVerifiedBatch

func (_m *StateMock) GetLastVerifiedBatch(ctx context.Context, dbTx pgx.Tx) (*state.VerifiedBatch, error)

GetLastVerifiedBatch provides a mock function with given fields: ctx, dbTx

func (*StateMock) GetLastVerifiedBatchNumberUntilL1Block added in v0.4.0

func (_m *StateMock) GetLastVerifiedBatchNumberUntilL1Block(ctx context.Context, l1BlockNumber uint64, dbTx pgx.Tx) (uint64, error)

GetLastVerifiedBatchNumberUntilL1Block provides a mock function with given fields: ctx, l1BlockNumber, dbTx

func (*StateMock) GetLastVerifiedL2BlockNumberUntilL1Block added in v0.4.0

func (_m *StateMock) GetLastVerifiedL2BlockNumberUntilL1Block(ctx context.Context, l1FinalizedBlockNumber uint64, dbTx pgx.Tx) (uint64, error)

GetLastVerifiedL2BlockNumberUntilL1Block provides a mock function with given fields: ctx, l1FinalizedBlockNumber, dbTx

func (*StateMock) GetLastVirtualBatchNum

func (_m *StateMock) GetLastVirtualBatchNum(ctx context.Context, dbTx pgx.Tx) (uint64, error)

GetLastVirtualBatchNum provides a mock function with given fields: ctx, dbTx

func (*StateMock) GetLastVirtualizedL2BlockNumber added in v0.0.990

func (_m *StateMock) GetLastVirtualizedL2BlockNumber(ctx context.Context, dbTx pgx.Tx) (uint64, error)

GetLastVirtualizedL2BlockNumber provides a mock function with given fields: ctx, dbTx

func (*StateMock) GetLatestBatchGlobalExitRoot added in v0.5.0

func (_m *StateMock) GetLatestBatchGlobalExitRoot(ctx context.Context, dbTx pgx.Tx) (common.Hash, error)

GetLatestBatchGlobalExitRoot provides a mock function with given fields: ctx, dbTx

func (*StateMock) GetLogs

func (_m *StateMock) GetLogs(ctx context.Context, fromBlock uint64, toBlock uint64, addresses []common.Address, topics [][]common.Hash, blockHash *common.Hash, since *time.Time, dbTx pgx.Tx) ([]*coretypes.Log, error)

GetLogs provides a mock function with given fields: ctx, fromBlock, toBlock, addresses, topics, blockHash, since, dbTx

func (*StateMock) GetNativeBlockHashesInRange added in v0.0.990

func (_m *StateMock) GetNativeBlockHashesInRange(ctx context.Context, fromBlockNumber uint64, toBlockNumber uint64, dbTx pgx.Tx) ([]common.Hash, error)

GetNativeBlockHashesInRange provides a mock function with given fields: ctx, fromBlockNumber, toBlockNumber, dbTx

func (*StateMock) GetNonce

func (_m *StateMock) GetNonce(ctx context.Context, address common.Address, root common.Hash) (uint64, error)

GetNonce provides a mock function with given fields: ctx, address, root

func (*StateMock) GetStorageAt

func (_m *StateMock) GetStorageAt(ctx context.Context, address common.Address, position *big.Int, root common.Hash) (*big.Int, error)

GetStorageAt provides a mock function with given fields: ctx, address, position, root

func (*StateMock) GetSyncingInfo

func (_m *StateMock) GetSyncingInfo(ctx context.Context, dbTx pgx.Tx) (state.SyncingInfo, error)

GetSyncingInfo provides a mock function with given fields: ctx, dbTx

func (*StateMock) GetTransactionByHash

func (_m *StateMock) GetTransactionByHash(ctx context.Context, transactionHash common.Hash, dbTx pgx.Tx) (*coretypes.Transaction, error)

GetTransactionByHash provides a mock function with given fields: ctx, transactionHash, dbTx

func (*StateMock) GetTransactionByL2BlockHashAndIndex

func (_m *StateMock) GetTransactionByL2BlockHashAndIndex(ctx context.Context, blockHash common.Hash, index uint64, dbTx pgx.Tx) (*coretypes.Transaction, error)

GetTransactionByL2BlockHashAndIndex provides a mock function with given fields: ctx, blockHash, index, dbTx

func (*StateMock) GetTransactionByL2BlockNumberAndIndex

func (_m *StateMock) GetTransactionByL2BlockNumberAndIndex(ctx context.Context, blockNumber uint64, index uint64, dbTx pgx.Tx) (*coretypes.Transaction, error)

GetTransactionByL2BlockNumberAndIndex provides a mock function with given fields: ctx, blockNumber, index, dbTx

func (*StateMock) GetTransactionByL2Hash added in v0.5.0

func (_m *StateMock) GetTransactionByL2Hash(ctx context.Context, transactionHash common.Hash, dbTx pgx.Tx) (*coretypes.Transaction, error)

GetTransactionByL2Hash provides a mock function with given fields: ctx, transactionHash, dbTx

func (*StateMock) GetTransactionReceipt

func (_m *StateMock) GetTransactionReceipt(ctx context.Context, transactionHash common.Hash, dbTx pgx.Tx) (*coretypes.Receipt, error)

GetTransactionReceipt provides a mock function with given fields: ctx, transactionHash, dbTx

func (*StateMock) GetTransactionsByBatchNumber

func (_m *StateMock) GetTransactionsByBatchNumber(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) ([]coretypes.Transaction, []uint8, error)

GetTransactionsByBatchNumber provides a mock function with given fields: ctx, batchNumber, dbTx

func (*StateMock) GetVerifiedBatch

func (_m *StateMock) GetVerifiedBatch(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.VerifiedBatch, error)

GetVerifiedBatch provides a mock function with given fields: ctx, batchNumber, dbTx

func (*StateMock) GetVirtualBatch

func (_m *StateMock) GetVirtualBatch(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.VirtualBatch, error)

GetVirtualBatch provides a mock function with given fields: ctx, batchNumber, dbTx

func (*StateMock) IsL2BlockConsolidated

func (_m *StateMock) IsL2BlockConsolidated(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (bool, error)

IsL2BlockConsolidated provides a mock function with given fields: ctx, blockNumber, dbTx

func (*StateMock) IsL2BlockVirtualized

func (_m *StateMock) IsL2BlockVirtualized(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (bool, error)

IsL2BlockVirtualized provides a mock function with given fields: ctx, blockNumber, dbTx

func (*StateMock) PreProcessUnsignedTransaction added in v0.5.13

func (_m *StateMock) PreProcessUnsignedTransaction(ctx context.Context, tx *coretypes.Transaction, sender common.Address, l2BlockNumber *uint64, dbTx pgx.Tx) (*state.ProcessBatchResponse, error)

PreProcessUnsignedTransaction provides a mock function with given fields: ctx, tx, sender, l2BlockNumber, dbTx

func (*StateMock) ProcessUnsignedTransaction

func (_m *StateMock) ProcessUnsignedTransaction(ctx context.Context, tx *coretypes.Transaction, senderAddress common.Address, l2BlockNumber *uint64, noZKEVMCounters bool, dbTx pgx.Tx) (*runtime.ExecutionResult, error)

ProcessUnsignedTransaction provides a mock function with given fields: ctx, tx, senderAddress, l2BlockNumber, noZKEVMCounters, dbTx

func (*StateMock) RegisterNewL2BlockEventHandler

func (_m *StateMock) RegisterNewL2BlockEventHandler(h state.NewL2BlockEventHandler)

RegisterNewL2BlockEventHandler provides a mock function with given fields: h

func (*StateMock) StartToMonitorNewL2Blocks added in v0.0.990

func (_m *StateMock) StartToMonitorNewL2Blocks()

StartToMonitorNewL2Blocks provides a mock function with given fields:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL