diff --git a/aggregator/mocks/mock_dbtx.go b/aggregator/mocks/mock_dbtx.go index a71023a193..8ad33d476e 100644 --- a/aggregator/mocks/mock_dbtx.go +++ b/aggregator/mocks/mock_dbtx.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package mocks @@ -21,6 +21,10 @@ func (_m *DbTxMock) Begin(ctx context.Context) (pgx.Tx, error) { ret := _m.Called(ctx) var r0 pgx.Tx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (pgx.Tx, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) pgx.Tx); ok { r0 = rf(ctx) } else { @@ -29,7 +33,6 @@ func (_m *DbTxMock) Begin(ctx context.Context) (pgx.Tx, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -88,13 +91,16 @@ func (_m *DbTxMock) CopyFrom(ctx context.Context, tableName pgx.Identifier, colu ret := _m.Called(ctx, tableName, columnNames, rowSrc) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) (int64, error)); ok { + return rf(ctx, tableName, columnNames, rowSrc) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) int64); ok { r0 = rf(ctx, tableName, columnNames, rowSrc) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) error); ok { r1 = rf(ctx, tableName, columnNames, rowSrc) } else { @@ -112,6 +118,10 @@ func (_m *DbTxMock) Exec(ctx context.Context, sql string, arguments ...interface ret := _m.Called(_ca...) var r0 pgconn.CommandTag + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (pgconn.CommandTag, error)); ok { + return rf(ctx, sql, arguments...) + } if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) pgconn.CommandTag); ok { r0 = rf(ctx, sql, arguments...) } else { @@ -120,7 +130,6 @@ func (_m *DbTxMock) Exec(ctx context.Context, sql string, arguments ...interface } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok { r1 = rf(ctx, sql, arguments...) } else { @@ -149,6 +158,10 @@ func (_m *DbTxMock) Prepare(ctx context.Context, name string, sql string) (*pgco ret := _m.Called(ctx, name, sql) var r0 *pgconn.StatementDescription + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*pgconn.StatementDescription, error)); ok { + return rf(ctx, name, sql) + } if rf, ok := ret.Get(0).(func(context.Context, string, string) *pgconn.StatementDescription); ok { r0 = rf(ctx, name, sql) } else { @@ -157,7 +170,6 @@ func (_m *DbTxMock) Prepare(ctx context.Context, name string, sql string) (*pgco } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = rf(ctx, name, sql) } else { @@ -175,6 +187,10 @@ func (_m *DbTxMock) Query(ctx context.Context, sql string, args ...interface{}) ret := _m.Called(_ca...) var r0 pgx.Rows + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (pgx.Rows, error)); ok { + return rf(ctx, sql, args...) + } if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) pgx.Rows); ok { r0 = rf(ctx, sql, args...) } else { @@ -183,7 +199,6 @@ func (_m *DbTxMock) Query(ctx context.Context, sql string, args ...interface{}) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok { r1 = rf(ctx, sql, args...) } else { @@ -198,6 +213,10 @@ func (_m *DbTxMock) QueryFunc(ctx context.Context, sql string, args []interface{ ret := _m.Called(ctx, sql, args, scans, f) var r0 pgconn.CommandTag + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error)); ok { + return rf(ctx, sql, args, scans, f) + } if rf, ok := ret.Get(0).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) pgconn.CommandTag); ok { r0 = rf(ctx, sql, args, scans, f) } else { @@ -206,7 +225,6 @@ func (_m *DbTxMock) QueryFunc(ctx context.Context, sql string, args []interface{ } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) error); ok { r1 = rf(ctx, sql, args, scans, f) } else { diff --git a/aggregator/mocks/mock_etherman.go b/aggregator/mocks/mock_etherman.go index f9ceca418e..50831aac38 100644 --- a/aggregator/mocks/mock_etherman.go +++ b/aggregator/mocks/mock_etherman.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package mocks @@ -19,6 +19,11 @@ func (_m *Etherman) BuildTrustedVerifyBatchesTxData(lastVerifiedBatch uint64, ne ret := _m.Called(lastVerifiedBatch, newVerifiedBatch, inputs) var r0 *common.Address + var r1 []byte + var r2 error + if rf, ok := ret.Get(0).(func(uint64, uint64, *types.FinalProofInputs) (*common.Address, []byte, error)); ok { + return rf(lastVerifiedBatch, newVerifiedBatch, inputs) + } if rf, ok := ret.Get(0).(func(uint64, uint64, *types.FinalProofInputs) *common.Address); ok { r0 = rf(lastVerifiedBatch, newVerifiedBatch, inputs) } else { @@ -27,7 +32,6 @@ func (_m *Etherman) BuildTrustedVerifyBatchesTxData(lastVerifiedBatch uint64, ne } } - var r1 []byte if rf, ok := ret.Get(1).(func(uint64, uint64, *types.FinalProofInputs) []byte); ok { r1 = rf(lastVerifiedBatch, newVerifiedBatch, inputs) } else { @@ -36,7 +40,6 @@ func (_m *Etherman) BuildTrustedVerifyBatchesTxData(lastVerifiedBatch uint64, ne } } - var r2 error if rf, ok := ret.Get(2).(func(uint64, uint64, *types.FinalProofInputs) error); ok { r2 = rf(lastVerifiedBatch, newVerifiedBatch, inputs) } else { @@ -51,13 +54,16 @@ func (_m *Etherman) GetLatestVerifiedBatchNum() (uint64, error) { ret := _m.Called() var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() uint64); ok { r0 = rf() } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { diff --git a/aggregator/mocks/mock_ethtxmanager.go b/aggregator/mocks/mock_ethtxmanager.go index 048e8e5cc6..8aeae6304a 100644 --- a/aggregator/mocks/mock_ethtxmanager.go +++ b/aggregator/mocks/mock_ethtxmanager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package mocks @@ -44,13 +44,16 @@ func (_m *EthTxManager) Result(ctx context.Context, owner string, id string, dbT ret := _m.Called(ctx, owner, id, dbTx) var r0 ethtxmanager.MonitoredTxResult + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, pgx.Tx) (ethtxmanager.MonitoredTxResult, error)); ok { + return rf(ctx, owner, id, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, pgx.Tx) ethtxmanager.MonitoredTxResult); ok { r0 = rf(ctx, owner, id, dbTx) } else { r0 = ret.Get(0).(ethtxmanager.MonitoredTxResult) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, pgx.Tx) error); ok { r1 = rf(ctx, owner, id, dbTx) } else { @@ -65,6 +68,10 @@ func (_m *EthTxManager) ResultsByStatus(ctx context.Context, owner string, statu ret := _m.Called(ctx, owner, statuses, dbTx) var r0 []ethtxmanager.MonitoredTxResult + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, []ethtxmanager.MonitoredTxStatus, pgx.Tx) ([]ethtxmanager.MonitoredTxResult, error)); ok { + return rf(ctx, owner, statuses, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, string, []ethtxmanager.MonitoredTxStatus, pgx.Tx) []ethtxmanager.MonitoredTxResult); ok { r0 = rf(ctx, owner, statuses, dbTx) } else { @@ -73,7 +80,6 @@ func (_m *EthTxManager) ResultsByStatus(ctx context.Context, owner string, statu } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, []ethtxmanager.MonitoredTxStatus, pgx.Tx) error); ok { r1 = rf(ctx, owner, statuses, dbTx) } else { diff --git a/aggregator/mocks/mock_profitabilitychecker.go b/aggregator/mocks/mock_profitabilitychecker.go index 34657c51af..870e791f64 100644 --- a/aggregator/mocks/mock_profitabilitychecker.go +++ b/aggregator/mocks/mock_profitabilitychecker.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package mocks @@ -19,13 +19,16 @@ func (_m *ProfitabilityCheckerMock) IsProfitable(_a0 context.Context, _a1 *big.I ret := _m.Called(_a0, _a1) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) (bool, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *big.Int) bool); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *big.Int) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/aggregator/mocks/mock_prover.go b/aggregator/mocks/mock_prover.go index 3ecd3f7534..7cba231d6e 100644 --- a/aggregator/mocks/mock_prover.go +++ b/aggregator/mocks/mock_prover.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package mocks @@ -33,6 +33,10 @@ func (_m *ProverMock) AggregatedProof(inputProof1 string, inputProof2 string) (* ret := _m.Called(inputProof1, inputProof2) var r0 *string + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*string, error)); ok { + return rf(inputProof1, inputProof2) + } if rf, ok := ret.Get(0).(func(string, string) *string); ok { r0 = rf(inputProof1, inputProof2) } else { @@ -41,7 +45,6 @@ func (_m *ProverMock) AggregatedProof(inputProof1 string, inputProof2 string) (* } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(inputProof1, inputProof2) } else { @@ -56,6 +59,10 @@ func (_m *ProverMock) BatchProof(input *pb.InputProver) (*string, error) { ret := _m.Called(input) var r0 *string + var r1 error + if rf, ok := ret.Get(0).(func(*pb.InputProver) (*string, error)); ok { + return rf(input) + } if rf, ok := ret.Get(0).(func(*pb.InputProver) *string); ok { r0 = rf(input) } else { @@ -64,7 +71,6 @@ func (_m *ProverMock) BatchProof(input *pb.InputProver) (*string, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(*pb.InputProver) error); ok { r1 = rf(input) } else { @@ -79,6 +85,10 @@ func (_m *ProverMock) FinalProof(inputProof string, aggregatorAddr string) (*str ret := _m.Called(inputProof, aggregatorAddr) var r0 *string + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*string, error)); ok { + return rf(inputProof, aggregatorAddr) + } if rf, ok := ret.Get(0).(func(string, string) *string); ok { r0 = rf(inputProof, aggregatorAddr) } else { @@ -87,7 +97,6 @@ func (_m *ProverMock) FinalProof(inputProof string, aggregatorAddr string) (*str } } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(inputProof, aggregatorAddr) } else { @@ -116,13 +125,16 @@ func (_m *ProverMock) IsIdle() (bool, error) { ret := _m.Called() var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func() (bool, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -151,6 +163,10 @@ func (_m *ProverMock) WaitFinalProof(ctx context.Context, proofID string) (*pb.F ret := _m.Called(ctx, proofID) var r0 *pb.FinalProof + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*pb.FinalProof, error)); ok { + return rf(ctx, proofID) + } if rf, ok := ret.Get(0).(func(context.Context, string) *pb.FinalProof); ok { r0 = rf(ctx, proofID) } else { @@ -159,7 +175,6 @@ func (_m *ProverMock) WaitFinalProof(ctx context.Context, proofID string) (*pb.F } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, proofID) } else { @@ -174,13 +189,16 @@ func (_m *ProverMock) WaitRecursiveProof(ctx context.Context, proofID string) (s ret := _m.Called(ctx, proofID) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { + return rf(ctx, proofID) + } if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { r0 = rf(ctx, proofID) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, proofID) } else { diff --git a/aggregator/mocks/mock_state.go b/aggregator/mocks/mock_state.go index f6e277304e..75d5e26c26 100644 --- a/aggregator/mocks/mock_state.go +++ b/aggregator/mocks/mock_state.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package mocks @@ -35,6 +35,10 @@ func (_m *StateMock) BeginStateTransaction(ctx context.Context) (pgx.Tx, error) ret := _m.Called(ctx) var r0 pgx.Tx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (pgx.Tx, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) pgx.Tx); ok { r0 = rf(ctx) } else { @@ -43,7 +47,6 @@ func (_m *StateMock) BeginStateTransaction(ctx context.Context) (pgx.Tx, error) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -58,13 +61,16 @@ func (_m *StateMock) CheckProofContainsCompleteSequences(ctx context.Context, pr ret := _m.Called(ctx, proof, dbTx) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *state.Proof, pgx.Tx) (bool, error)); ok { + return rf(ctx, proof, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, *state.Proof, pgx.Tx) bool); ok { r0 = rf(ctx, proof, dbTx) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *state.Proof, pgx.Tx) error); ok { r1 = rf(ctx, proof, dbTx) } else { @@ -93,13 +99,16 @@ func (_m *StateMock) CleanupLockedProofs(ctx context.Context, duration string, d ret := _m.Called(ctx, duration, dbTx) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, pgx.Tx) (int64, error)); ok { + return rf(ctx, duration, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, string, pgx.Tx) int64); ok { r0 = rf(ctx, duration, dbTx) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, pgx.Tx) error); ok { r1 = rf(ctx, duration, dbTx) } else { @@ -142,6 +151,10 @@ func (_m *StateMock) GetBatchByNumber(ctx context.Context, batchNumber uint64, d ret := _m.Called(ctx, batchNumber, dbTx) var r0 *state.Batch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.Batch, error)); ok { + return rf(ctx, batchNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.Batch); ok { r0 = rf(ctx, batchNumber, dbTx) } else { @@ -150,7 +163,6 @@ func (_m *StateMock) GetBatchByNumber(ctx context.Context, batchNumber uint64, d } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, batchNumber, dbTx) } else { @@ -165,6 +177,10 @@ func (_m *StateMock) GetLastVerifiedBatch(ctx context.Context, dbTx pgx.Tx) (*st ret := _m.Called(ctx, dbTx) var r0 *state.VerifiedBatch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*state.VerifiedBatch, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *state.VerifiedBatch); ok { r0 = rf(ctx, dbTx) } else { @@ -173,7 +189,6 @@ func (_m *StateMock) GetLastVerifiedBatch(ctx context.Context, dbTx pgx.Tx) (*st } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -188,6 +203,10 @@ func (_m *StateMock) GetProofReadyToVerify(ctx context.Context, lastVerfiedBatch ret := _m.Called(ctx, lastVerfiedBatchNumber, dbTx) var r0 *state.Proof + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.Proof, error)); ok { + return rf(ctx, lastVerfiedBatchNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.Proof); ok { r0 = rf(ctx, lastVerfiedBatchNumber, dbTx) } else { @@ -196,7 +215,6 @@ func (_m *StateMock) GetProofReadyToVerify(ctx context.Context, lastVerfiedBatch } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, lastVerfiedBatchNumber, dbTx) } else { @@ -211,6 +229,11 @@ func (_m *StateMock) GetProofsToAggregate(ctx context.Context, dbTx pgx.Tx) (*st ret := _m.Called(ctx, dbTx) var r0 *state.Proof + var r1 *state.Proof + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*state.Proof, *state.Proof, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *state.Proof); ok { r0 = rf(ctx, dbTx) } else { @@ -219,7 +242,6 @@ func (_m *StateMock) GetProofsToAggregate(ctx context.Context, dbTx pgx.Tx) (*st } } - var r1 *state.Proof if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) *state.Proof); ok { r1 = rf(ctx, dbTx) } else { @@ -228,7 +250,6 @@ func (_m *StateMock) GetProofsToAggregate(ctx context.Context, dbTx pgx.Tx) (*st } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, pgx.Tx) error); ok { r2 = rf(ctx, dbTx) } else { @@ -243,6 +264,10 @@ func (_m *StateMock) GetVirtualBatchToProve(ctx context.Context, lastVerfiedBatc ret := _m.Called(ctx, lastVerfiedBatchNumber, dbTx) var r0 *state.Batch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.Batch, error)); ok { + return rf(ctx, lastVerfiedBatchNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.Batch); ok { r0 = rf(ctx, lastVerfiedBatchNumber, dbTx) } else { @@ -251,7 +276,6 @@ func (_m *StateMock) GetVirtualBatchToProve(ctx context.Context, lastVerfiedBatc } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, lastVerfiedBatchNumber, dbTx) } else { diff --git a/etherman/mock_etherscan.go b/etherman/mock_etherscan.go index 253b5add42..d8e3820968 100644 --- a/etherman/mock_etherscan.go +++ b/etherman/mock_etherscan.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package etherman @@ -19,6 +19,10 @@ func (_m *etherscanMock) SuggestGasPrice(ctx context.Context) (*big.Int, error) ret := _m.Called(ctx) var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { r0 = rf(ctx) } else { @@ -27,7 +31,6 @@ func (_m *etherscanMock) SuggestGasPrice(ctx context.Context) (*big.Int, error) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { diff --git a/etherman/mock_ethgasstation.go b/etherman/mock_ethgasstation.go index 5cb1c86178..ee9f1d5cba 100644 --- a/etherman/mock_ethgasstation.go +++ b/etherman/mock_ethgasstation.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package etherman @@ -19,6 +19,10 @@ func (_m *ethGasStationMock) SuggestGasPrice(ctx context.Context) (*big.Int, err ret := _m.Called(ctx) var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { r0 = rf(ctx) } else { @@ -27,7 +31,6 @@ func (_m *ethGasStationMock) SuggestGasPrice(ctx context.Context) (*big.Int, err } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { diff --git a/ethtxmanager/mock_etherman_test.go b/ethtxmanager/mock_etherman_test.go index f329465686..55fef0ddbe 100644 --- a/ethtxmanager/mock_etherman_test.go +++ b/ethtxmanager/mock_etherman_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package ethtxmanager @@ -25,13 +25,17 @@ func (_m *ethermanMock) CheckTxWasMined(ctx context.Context, txHash common.Hash) ret := _m.Called(ctx, txHash) var r0 bool + var r1 *types.Receipt + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, common.Hash) (bool, *types.Receipt, error)); ok { + return rf(ctx, txHash) + } if rf, ok := ret.Get(0).(func(context.Context, common.Hash) bool); ok { r0 = rf(ctx, txHash) } else { r0 = ret.Get(0).(bool) } - var r1 *types.Receipt if rf, ok := ret.Get(1).(func(context.Context, common.Hash) *types.Receipt); ok { r1 = rf(ctx, txHash) } else { @@ -40,7 +44,6 @@ func (_m *ethermanMock) CheckTxWasMined(ctx context.Context, txHash common.Hash) } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, common.Hash) error); ok { r2 = rf(ctx, txHash) } else { @@ -55,13 +58,16 @@ func (_m *ethermanMock) CurrentNonce(ctx context.Context, account common.Address ret := _m.Called(ctx, account) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address) (uint64, error)); ok { + return rf(ctx, account) + } if rf, ok := ret.Get(0).(func(context.Context, common.Address) uint64); ok { r0 = rf(ctx, account) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Address) error); ok { r1 = rf(ctx, account) } else { @@ -76,13 +82,16 @@ func (_m *ethermanMock) EstimateGas(ctx context.Context, from common.Address, to ret := _m.Called(ctx, from, to, value, data) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, *common.Address, *big.Int, []byte) (uint64, error)); ok { + return rf(ctx, from, to, value, data) + } if rf, ok := ret.Get(0).(func(context.Context, common.Address, *common.Address, *big.Int, []byte) uint64); ok { r0 = rf(ctx, from, to, value, data) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Address, *common.Address, *big.Int, []byte) error); ok { r1 = rf(ctx, from, to, value, data) } else { @@ -97,13 +106,16 @@ func (_m *ethermanMock) GetRevertMessage(ctx context.Context, tx *types.Transact ret := _m.Called(ctx, tx) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction) (string, error)); ok { + return rf(ctx, tx) + } if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction) string); ok { r0 = rf(ctx, tx) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.Transaction) error); ok { r1 = rf(ctx, tx) } else { @@ -118,6 +130,11 @@ func (_m *ethermanMock) GetTx(ctx context.Context, txHash common.Hash) (*types.T ret := _m.Called(ctx, txHash) var r0 *types.Transaction + var r1 bool + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, common.Hash) (*types.Transaction, bool, error)); ok { + return rf(ctx, txHash) + } if rf, ok := ret.Get(0).(func(context.Context, common.Hash) *types.Transaction); ok { r0 = rf(ctx, txHash) } else { @@ -126,14 +143,12 @@ func (_m *ethermanMock) GetTx(ctx context.Context, txHash common.Hash) (*types.T } } - var r1 bool if rf, ok := ret.Get(1).(func(context.Context, common.Hash) bool); ok { r1 = rf(ctx, txHash) } else { r1 = ret.Get(1).(bool) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, common.Hash) error); ok { r2 = rf(ctx, txHash) } else { @@ -148,6 +163,10 @@ func (_m *ethermanMock) GetTxReceipt(ctx context.Context, txHash common.Hash) (* ret := _m.Called(ctx, txHash) var r0 *types.Receipt + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Hash) (*types.Receipt, error)); ok { + return rf(ctx, txHash) + } if rf, ok := ret.Get(0).(func(context.Context, common.Hash) *types.Receipt); ok { r0 = rf(ctx, txHash) } else { @@ -156,7 +175,6 @@ func (_m *ethermanMock) GetTxReceipt(ctx context.Context, txHash common.Hash) (* } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Hash) error); ok { r1 = rf(ctx, txHash) } else { @@ -185,6 +203,10 @@ func (_m *ethermanMock) SignTx(ctx context.Context, sender common.Address, tx *t ret := _m.Called(ctx, sender, tx) var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, *types.Transaction) (*types.Transaction, error)); ok { + return rf(ctx, sender, tx) + } if rf, ok := ret.Get(0).(func(context.Context, common.Address, *types.Transaction) *types.Transaction); ok { r0 = rf(ctx, sender, tx) } else { @@ -193,7 +215,6 @@ func (_m *ethermanMock) SignTx(ctx context.Context, sender common.Address, tx *t } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Address, *types.Transaction) error); ok { r1 = rf(ctx, sender, tx) } else { @@ -208,6 +229,10 @@ func (_m *ethermanMock) SuggestedGasPrice(ctx context.Context) (*big.Int, error) ret := _m.Called(ctx) var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*big.Int, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) *big.Int); ok { r0 = rf(ctx) } else { @@ -216,7 +241,6 @@ func (_m *ethermanMock) SuggestedGasPrice(ctx context.Context) (*big.Int, error) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -231,13 +255,16 @@ func (_m *ethermanMock) WaitTxToBeMined(ctx context.Context, tx *types.Transacti ret := _m.Called(ctx, tx, timeout) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction, time.Duration) (bool, error)); ok { + return rf(ctx, tx, timeout) + } if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction, time.Duration) bool); ok { r0 = rf(ctx, tx, timeout) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.Transaction, time.Duration) error); ok { r1 = rf(ctx, tx, timeout) } else { diff --git a/ethtxmanager/mock_state_test.go b/ethtxmanager/mock_state_test.go index 153422cd09..befb59638c 100644 --- a/ethtxmanager/mock_state_test.go +++ b/ethtxmanager/mock_state_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package ethtxmanager @@ -22,6 +22,10 @@ func (_m *stateMock) GetLastBlock(ctx context.Context, dbTx pgx.Tx) (*state.Bloc ret := _m.Called(ctx, dbTx) var r0 *state.Block + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*state.Block, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *state.Block); ok { r0 = rf(ctx, dbTx) } else { @@ -30,7 +34,6 @@ func (_m *stateMock) GetLastBlock(ctx context.Context, dbTx pgx.Tx) (*state.Bloc } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { diff --git a/gasprice/mock_etherman.go b/gasprice/mock_etherman.go index 4cb05739f6..488c86f58a 100644 --- a/gasprice/mock_etherman.go +++ b/gasprice/mock_etherman.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package gasprice diff --git a/gasprice/mock_pool.go b/gasprice/mock_pool.go index 9957087ddf..7379f7c1a0 100644 --- a/gasprice/mock_pool.go +++ b/gasprice/mock_pool.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package gasprice @@ -18,13 +18,16 @@ func (_m *poolMock) GetGasPrice(ctx context.Context) (uint64, error) { ret := _m.Called(ctx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (uint64, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) uint64); ok { r0 = rf(ctx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { diff --git a/jsonrpc/mock_dbtx_test.go b/jsonrpc/mock_dbtx_test.go index b2bc43632b..37e2c86609 100644 --- a/jsonrpc/mock_dbtx_test.go +++ b/jsonrpc/mock_dbtx_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package jsonrpc @@ -21,6 +21,10 @@ func (_m *dbTxMock) Begin(ctx context.Context) (pgx.Tx, error) { ret := _m.Called(ctx) var r0 pgx.Tx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (pgx.Tx, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) pgx.Tx); ok { r0 = rf(ctx) } else { @@ -29,7 +33,6 @@ func (_m *dbTxMock) Begin(ctx context.Context) (pgx.Tx, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -88,13 +91,16 @@ func (_m *dbTxMock) CopyFrom(ctx context.Context, tableName pgx.Identifier, colu ret := _m.Called(ctx, tableName, columnNames, rowSrc) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) (int64, error)); ok { + return rf(ctx, tableName, columnNames, rowSrc) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) int64); ok { r0 = rf(ctx, tableName, columnNames, rowSrc) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) error); ok { r1 = rf(ctx, tableName, columnNames, rowSrc) } else { @@ -112,6 +118,10 @@ func (_m *dbTxMock) Exec(ctx context.Context, sql string, arguments ...interface ret := _m.Called(_ca...) var r0 pgconn.CommandTag + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (pgconn.CommandTag, error)); ok { + return rf(ctx, sql, arguments...) + } if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) pgconn.CommandTag); ok { r0 = rf(ctx, sql, arguments...) } else { @@ -120,7 +130,6 @@ func (_m *dbTxMock) Exec(ctx context.Context, sql string, arguments ...interface } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok { r1 = rf(ctx, sql, arguments...) } else { @@ -149,6 +158,10 @@ func (_m *dbTxMock) Prepare(ctx context.Context, name string, sql string) (*pgco ret := _m.Called(ctx, name, sql) var r0 *pgconn.StatementDescription + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*pgconn.StatementDescription, error)); ok { + return rf(ctx, name, sql) + } if rf, ok := ret.Get(0).(func(context.Context, string, string) *pgconn.StatementDescription); ok { r0 = rf(ctx, name, sql) } else { @@ -157,7 +170,6 @@ func (_m *dbTxMock) Prepare(ctx context.Context, name string, sql string) (*pgco } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = rf(ctx, name, sql) } else { @@ -175,6 +187,10 @@ func (_m *dbTxMock) Query(ctx context.Context, sql string, args ...interface{}) ret := _m.Called(_ca...) var r0 pgx.Rows + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (pgx.Rows, error)); ok { + return rf(ctx, sql, args...) + } if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) pgx.Rows); ok { r0 = rf(ctx, sql, args...) } else { @@ -183,7 +199,6 @@ func (_m *dbTxMock) Query(ctx context.Context, sql string, args ...interface{}) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok { r1 = rf(ctx, sql, args...) } else { @@ -198,6 +213,10 @@ func (_m *dbTxMock) QueryFunc(ctx context.Context, sql string, args []interface{ ret := _m.Called(ctx, sql, args, scans, f) var r0 pgconn.CommandTag + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error)); ok { + return rf(ctx, sql, args, scans, f) + } if rf, ok := ret.Get(0).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) pgconn.CommandTag); ok { r0 = rf(ctx, sql, args, scans, f) } else { @@ -206,7 +225,6 @@ func (_m *dbTxMock) QueryFunc(ctx context.Context, sql string, args []interface{ } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) error); ok { r1 = rf(ctx, sql, args, scans, f) } else { diff --git a/jsonrpc/mock_pool_test.go b/jsonrpc/mock_pool_test.go index 5ed49f9e03..cc6163e8e9 100644 --- a/jsonrpc/mock_pool_test.go +++ b/jsonrpc/mock_pool_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package jsonrpc @@ -40,13 +40,16 @@ func (_m *poolMock) CountPendingTransactions(ctx context.Context) (uint64, error ret := _m.Called(ctx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (uint64, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) uint64); ok { r0 = rf(ctx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -61,13 +64,16 @@ func (_m *poolMock) GetGasPrice(ctx context.Context) (uint64, error) { ret := _m.Called(ctx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (uint64, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) uint64); ok { r0 = rf(ctx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -82,13 +88,16 @@ func (_m *poolMock) GetNonce(ctx context.Context, address common.Address) (uint6 ret := _m.Called(ctx, address) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address) (uint64, error)); ok { + return rf(ctx, address) + } if rf, ok := ret.Get(0).(func(context.Context, common.Address) uint64); ok { r0 = rf(ctx, address) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Address) error); ok { r1 = rf(ctx, address) } else { @@ -103,6 +112,10 @@ func (_m *poolMock) GetPendingTxHashesSince(ctx context.Context, since time.Time ret := _m.Called(ctx, since) var r0 []common.Hash + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, time.Time) ([]common.Hash, error)); ok { + return rf(ctx, since) + } if rf, ok := ret.Get(0).(func(context.Context, time.Time) []common.Hash); ok { r0 = rf(ctx, since) } else { @@ -111,7 +124,6 @@ func (_m *poolMock) GetPendingTxHashesSince(ctx context.Context, since time.Time } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, time.Time) error); ok { r1 = rf(ctx, since) } else { @@ -126,6 +138,10 @@ func (_m *poolMock) GetPendingTxs(ctx context.Context, isClaims bool, limit uint ret := _m.Called(ctx, isClaims, limit) var r0 []pool.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bool, uint64) ([]pool.Transaction, error)); ok { + return rf(ctx, isClaims, limit) + } if rf, ok := ret.Get(0).(func(context.Context, bool, uint64) []pool.Transaction); ok { r0 = rf(ctx, isClaims, limit) } else { @@ -134,7 +150,6 @@ func (_m *poolMock) GetPendingTxs(ctx context.Context, isClaims bool, limit uint } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bool, uint64) error); ok { r1 = rf(ctx, isClaims, limit) } else { @@ -149,6 +164,10 @@ func (_m *poolMock) GetTxByHash(ctx context.Context, hash common.Hash) (*pool.Tr ret := _m.Called(ctx, hash) var r0 *pool.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Hash) (*pool.Transaction, error)); ok { + return rf(ctx, hash) + } if rf, ok := ret.Get(0).(func(context.Context, common.Hash) *pool.Transaction); ok { r0 = rf(ctx, hash) } else { @@ -157,7 +176,6 @@ func (_m *poolMock) GetTxByHash(ctx context.Context, hash common.Hash) (*pool.Tr } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Hash) error); ok { r1 = rf(ctx, hash) } else { diff --git a/jsonrpc/mock_state_test.go b/jsonrpc/mock_state_test.go index b7b25b707c..d54f41e5ab 100644 --- a/jsonrpc/mock_state_test.go +++ b/jsonrpc/mock_state_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package jsonrpc @@ -31,13 +31,16 @@ func (_m *stateMock) BatchNumberByL2BlockNumber(ctx context.Context, blockNumber ret := _m.Called(ctx, blockNumber, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (uint64, error)); ok { + return rf(ctx, blockNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) uint64); ok { r0 = rf(ctx, blockNumber, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, blockNumber, dbTx) } else { @@ -52,6 +55,10 @@ func (_m *stateMock) BeginStateTransaction(ctx context.Context) (pgx.Tx, error) ret := _m.Called(ctx) var r0 pgx.Tx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (pgx.Tx, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) pgx.Tx); ok { r0 = rf(ctx) } else { @@ -60,7 +67,6 @@ func (_m *stateMock) BeginStateTransaction(ctx context.Context) (pgx.Tx, error) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -75,6 +81,10 @@ func (_m *stateMock) DebugTransaction(ctx context.Context, transactionHash commo ret := _m.Called(ctx, transactionHash, traceConfig, dbTx) var r0 *runtime.ExecutionResult + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Hash, state.TraceConfig, pgx.Tx) (*runtime.ExecutionResult, error)); ok { + return rf(ctx, transactionHash, traceConfig, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, common.Hash, state.TraceConfig, pgx.Tx) *runtime.ExecutionResult); ok { r0 = rf(ctx, transactionHash, traceConfig, dbTx) } else { @@ -83,7 +93,6 @@ func (_m *stateMock) DebugTransaction(ctx context.Context, transactionHash commo } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Hash, state.TraceConfig, pgx.Tx) error); ok { r1 = rf(ctx, transactionHash, traceConfig, dbTx) } else { @@ -98,13 +107,16 @@ func (_m *stateMock) EstimateGas(transaction *types.Transaction, senderAddress c ret := _m.Called(transaction, senderAddress, l2BlockNumber, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(*types.Transaction, common.Address, *uint64, pgx.Tx) (uint64, error)); ok { + return rf(transaction, senderAddress, l2BlockNumber, dbTx) + } if rf, ok := ret.Get(0).(func(*types.Transaction, common.Address, *uint64, pgx.Tx) uint64); ok { r0 = rf(transaction, senderAddress, l2BlockNumber, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(*types.Transaction, common.Address, *uint64, pgx.Tx) error); ok { r1 = rf(transaction, senderAddress, l2BlockNumber, dbTx) } else { @@ -119,6 +131,10 @@ func (_m *stateMock) GetBalance(ctx context.Context, address common.Address, blo ret := _m.Called(ctx, address, blockNumber, dbTx) var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64, pgx.Tx) (*big.Int, error)); ok { + return rf(ctx, address, blockNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64, pgx.Tx) *big.Int); ok { r0 = rf(ctx, address, blockNumber, dbTx) } else { @@ -127,7 +143,6 @@ func (_m *stateMock) GetBalance(ctx context.Context, address common.Address, blo } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Address, uint64, pgx.Tx) error); ok { r1 = rf(ctx, address, blockNumber, dbTx) } else { @@ -142,6 +157,10 @@ func (_m *stateMock) GetBatchByNumber(ctx context.Context, batchNumber uint64, d ret := _m.Called(ctx, batchNumber, dbTx) var r0 *state.Batch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.Batch, error)); ok { + return rf(ctx, batchNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.Batch); ok { r0 = rf(ctx, batchNumber, dbTx) } else { @@ -150,7 +169,6 @@ func (_m *stateMock) GetBatchByNumber(ctx context.Context, batchNumber uint64, d } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, batchNumber, dbTx) } else { @@ -165,6 +183,10 @@ func (_m *stateMock) GetCode(ctx context.Context, address common.Address, blockN ret := _m.Called(ctx, address, blockNumber, dbTx) var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64, pgx.Tx) ([]byte, error)); ok { + return rf(ctx, address, blockNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64, pgx.Tx) []byte); ok { r0 = rf(ctx, address, blockNumber, dbTx) } else { @@ -173,7 +195,6 @@ func (_m *stateMock) GetCode(ctx context.Context, address common.Address, blockN } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Address, uint64, pgx.Tx) error); ok { r1 = rf(ctx, address, blockNumber, dbTx) } else { @@ -188,6 +209,10 @@ func (_m *stateMock) GetL2BlockByHash(ctx context.Context, hash common.Hash, dbT ret := _m.Called(ctx, hash, dbTx) var r0 *types.Block + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) (*types.Block, error)); ok { + return rf(ctx, hash, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) *types.Block); ok { r0 = rf(ctx, hash, dbTx) } else { @@ -196,7 +221,6 @@ func (_m *stateMock) GetL2BlockByHash(ctx context.Context, hash common.Hash, dbT } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Hash, pgx.Tx) error); ok { r1 = rf(ctx, hash, dbTx) } else { @@ -211,6 +235,10 @@ func (_m *stateMock) GetL2BlockByNumber(ctx context.Context, blockNumber uint64, ret := _m.Called(ctx, blockNumber, dbTx) var r0 *types.Block + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*types.Block, error)); ok { + return rf(ctx, blockNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *types.Block); ok { r0 = rf(ctx, blockNumber, dbTx) } else { @@ -219,7 +247,6 @@ func (_m *stateMock) GetL2BlockByNumber(ctx context.Context, blockNumber uint64, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, blockNumber, dbTx) } else { @@ -234,6 +261,10 @@ func (_m *stateMock) GetL2BlockHashesSince(ctx context.Context, since time.Time, ret := _m.Called(ctx, since, dbTx) var r0 []common.Hash + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, time.Time, pgx.Tx) ([]common.Hash, error)); ok { + return rf(ctx, since, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, time.Time, pgx.Tx) []common.Hash); ok { r0 = rf(ctx, since, dbTx) } else { @@ -242,7 +273,6 @@ func (_m *stateMock) GetL2BlockHashesSince(ctx context.Context, since time.Time, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, time.Time, pgx.Tx) error); ok { r1 = rf(ctx, since, dbTx) } else { @@ -257,6 +287,10 @@ func (_m *stateMock) GetL2BlockHeaderByNumber(ctx context.Context, blockNumber u ret := _m.Called(ctx, blockNumber, dbTx) var r0 *types.Header + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*types.Header, error)); ok { + return rf(ctx, blockNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *types.Header); ok { r0 = rf(ctx, blockNumber, dbTx) } else { @@ -265,7 +299,6 @@ func (_m *stateMock) GetL2BlockHeaderByNumber(ctx context.Context, blockNumber u } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, blockNumber, dbTx) } else { @@ -280,13 +313,16 @@ func (_m *stateMock) GetL2BlockTransactionCountByHash(ctx context.Context, hash ret := _m.Called(ctx, hash, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) (uint64, error)); ok { + return rf(ctx, hash, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) uint64); ok { r0 = rf(ctx, hash, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Hash, pgx.Tx) error); ok { r1 = rf(ctx, hash, dbTx) } else { @@ -301,13 +337,16 @@ func (_m *stateMock) GetL2BlockTransactionCountByNumber(ctx context.Context, blo ret := _m.Called(ctx, blockNumber, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (uint64, error)); ok { + return rf(ctx, blockNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) uint64); ok { r0 = rf(ctx, blockNumber, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, blockNumber, dbTx) } else { @@ -322,13 +361,16 @@ func (_m *stateMock) GetLastBatchNumber(ctx context.Context, dbTx pgx.Tx) (uint6 ret := _m.Called(ctx, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -343,13 +385,16 @@ func (_m *stateMock) GetLastConsolidatedL2BlockNumber(ctx context.Context, dbTx ret := _m.Called(ctx, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -364,6 +409,10 @@ func (_m *stateMock) GetLastL2Block(ctx context.Context, dbTx pgx.Tx) (*types.Bl ret := _m.Called(ctx, dbTx) var r0 *types.Block + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*types.Block, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *types.Block); ok { r0 = rf(ctx, dbTx) } else { @@ -372,7 +421,6 @@ func (_m *stateMock) GetLastL2Block(ctx context.Context, dbTx pgx.Tx) (*types.Bl } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -387,13 +435,16 @@ func (_m *stateMock) GetLastL2BlockNumber(ctx context.Context, dbTx pgx.Tx) (uin ret := _m.Called(ctx, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -408,6 +459,10 @@ func (_m *stateMock) GetLastVerifiedBatch(ctx context.Context, dbTx pgx.Tx) (*st ret := _m.Called(ctx, dbTx) var r0 *state.VerifiedBatch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*state.VerifiedBatch, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *state.VerifiedBatch); ok { r0 = rf(ctx, dbTx) } else { @@ -416,7 +471,6 @@ func (_m *stateMock) GetLastVerifiedBatch(ctx context.Context, dbTx pgx.Tx) (*st } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -431,13 +485,16 @@ func (_m *stateMock) GetLastVirtualBatchNum(ctx context.Context, dbTx pgx.Tx) (u ret := _m.Called(ctx, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -452,6 +509,10 @@ func (_m *stateMock) GetLogs(ctx context.Context, fromBlock uint64, toBlock uint ret := _m.Called(ctx, fromBlock, toBlock, addresses, topics, blockHash, since, dbTx) var r0 []*types.Log + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, []common.Address, [][]common.Hash, *common.Hash, *time.Time, pgx.Tx) ([]*types.Log, error)); ok { + return rf(ctx, fromBlock, toBlock, addresses, topics, blockHash, since, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, []common.Address, [][]common.Hash, *common.Hash, *time.Time, pgx.Tx) []*types.Log); ok { r0 = rf(ctx, fromBlock, toBlock, addresses, topics, blockHash, since, dbTx) } else { @@ -460,7 +521,6 @@ func (_m *stateMock) GetLogs(ctx context.Context, fromBlock uint64, toBlock uint } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, uint64, []common.Address, [][]common.Hash, *common.Hash, *time.Time, pgx.Tx) error); ok { r1 = rf(ctx, fromBlock, toBlock, addresses, topics, blockHash, since, dbTx) } else { @@ -475,13 +535,16 @@ func (_m *stateMock) GetNonce(ctx context.Context, address common.Address, block ret := _m.Called(ctx, address, blockNumber, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64, pgx.Tx) (uint64, error)); ok { + return rf(ctx, address, blockNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64, pgx.Tx) uint64); ok { r0 = rf(ctx, address, blockNumber, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Address, uint64, pgx.Tx) error); ok { r1 = rf(ctx, address, blockNumber, dbTx) } else { @@ -496,6 +559,10 @@ func (_m *stateMock) GetStorageAt(ctx context.Context, address common.Address, p ret := _m.Called(ctx, address, position, blockNumber, dbTx) var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int, uint64, pgx.Tx) (*big.Int, error)); ok { + return rf(ctx, address, position, blockNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, common.Address, *big.Int, uint64, pgx.Tx) *big.Int); ok { r0 = rf(ctx, address, position, blockNumber, dbTx) } else { @@ -504,7 +571,6 @@ func (_m *stateMock) GetStorageAt(ctx context.Context, address common.Address, p } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Address, *big.Int, uint64, pgx.Tx) error); ok { r1 = rf(ctx, address, position, blockNumber, dbTx) } else { @@ -519,13 +585,16 @@ func (_m *stateMock) GetSyncingInfo(ctx context.Context, dbTx pgx.Tx) (state.Syn ret := _m.Called(ctx, dbTx) var r0 state.SyncingInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (state.SyncingInfo, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) state.SyncingInfo); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(state.SyncingInfo) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -540,6 +609,10 @@ func (_m *stateMock) GetTransactionByHash(ctx context.Context, transactionHash c ret := _m.Called(ctx, transactionHash, dbTx) var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) (*types.Transaction, error)); ok { + return rf(ctx, transactionHash, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) *types.Transaction); ok { r0 = rf(ctx, transactionHash, dbTx) } else { @@ -548,7 +621,6 @@ func (_m *stateMock) GetTransactionByHash(ctx context.Context, transactionHash c } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Hash, pgx.Tx) error); ok { r1 = rf(ctx, transactionHash, dbTx) } else { @@ -563,6 +635,10 @@ func (_m *stateMock) GetTransactionByL2BlockHashAndIndex(ctx context.Context, bl ret := _m.Called(ctx, blockHash, index, dbTx) var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Hash, uint64, pgx.Tx) (*types.Transaction, error)); ok { + return rf(ctx, blockHash, index, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, common.Hash, uint64, pgx.Tx) *types.Transaction); ok { r0 = rf(ctx, blockHash, index, dbTx) } else { @@ -571,7 +647,6 @@ func (_m *stateMock) GetTransactionByL2BlockHashAndIndex(ctx context.Context, bl } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Hash, uint64, pgx.Tx) error); ok { r1 = rf(ctx, blockHash, index, dbTx) } else { @@ -586,6 +661,10 @@ func (_m *stateMock) GetTransactionByL2BlockNumberAndIndex(ctx context.Context, ret := _m.Called(ctx, blockNumber, index, dbTx) var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, pgx.Tx) (*types.Transaction, error)); ok { + return rf(ctx, blockNumber, index, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, pgx.Tx) *types.Transaction); ok { r0 = rf(ctx, blockNumber, index, dbTx) } else { @@ -594,7 +673,6 @@ func (_m *stateMock) GetTransactionByL2BlockNumberAndIndex(ctx context.Context, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, uint64, pgx.Tx) error); ok { r1 = rf(ctx, blockNumber, index, dbTx) } else { @@ -609,6 +687,10 @@ func (_m *stateMock) GetTransactionReceipt(ctx context.Context, transactionHash ret := _m.Called(ctx, transactionHash, dbTx) var r0 *types.Receipt + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) (*types.Receipt, error)); ok { + return rf(ctx, transactionHash, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) *types.Receipt); ok { r0 = rf(ctx, transactionHash, dbTx) } else { @@ -617,7 +699,6 @@ func (_m *stateMock) GetTransactionReceipt(ctx context.Context, transactionHash } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Hash, pgx.Tx) error); ok { r1 = rf(ctx, transactionHash, dbTx) } else { @@ -632,6 +713,10 @@ func (_m *stateMock) GetTransactionsByBatchNumber(ctx context.Context, batchNumb ret := _m.Called(ctx, batchNumber, dbTx) var r0 []types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) ([]types.Transaction, error)); ok { + return rf(ctx, batchNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) []types.Transaction); ok { r0 = rf(ctx, batchNumber, dbTx) } else { @@ -640,7 +725,6 @@ func (_m *stateMock) GetTransactionsByBatchNumber(ctx context.Context, batchNumb } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, batchNumber, dbTx) } else { @@ -655,6 +739,10 @@ func (_m *stateMock) GetVerifiedBatch(ctx context.Context, batchNumber uint64, d ret := _m.Called(ctx, batchNumber, dbTx) var r0 *state.VerifiedBatch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.VerifiedBatch, error)); ok { + return rf(ctx, batchNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.VerifiedBatch); ok { r0 = rf(ctx, batchNumber, dbTx) } else { @@ -663,7 +751,6 @@ func (_m *stateMock) GetVerifiedBatch(ctx context.Context, batchNumber uint64, d } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, batchNumber, dbTx) } else { @@ -678,6 +765,10 @@ func (_m *stateMock) GetVirtualBatch(ctx context.Context, batchNumber uint64, db ret := _m.Called(ctx, batchNumber, dbTx) var r0 *state.VirtualBatch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.VirtualBatch, error)); ok { + return rf(ctx, batchNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.VirtualBatch); ok { r0 = rf(ctx, batchNumber, dbTx) } else { @@ -686,7 +777,6 @@ func (_m *stateMock) GetVirtualBatch(ctx context.Context, batchNumber uint64, db } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, batchNumber, dbTx) } else { @@ -701,13 +791,16 @@ func (_m *stateMock) IsL2BlockConsolidated(ctx context.Context, blockNumber uint ret := _m.Called(ctx, blockNumber, dbTx) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (bool, error)); ok { + return rf(ctx, blockNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) bool); ok { r0 = rf(ctx, blockNumber, dbTx) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, blockNumber, dbTx) } else { @@ -722,13 +815,16 @@ func (_m *stateMock) IsL2BlockVirtualized(ctx context.Context, blockNumber uint6 ret := _m.Called(ctx, blockNumber, dbTx) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (bool, error)); ok { + return rf(ctx, blockNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) bool); ok { r0 = rf(ctx, blockNumber, dbTx) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, blockNumber, dbTx) } else { diff --git a/jsonrpc/mock_storage_test.go b/jsonrpc/mock_storage_test.go index 411d901993..105bad5455 100644 --- a/jsonrpc/mock_storage_test.go +++ b/jsonrpc/mock_storage_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package jsonrpc @@ -17,6 +17,10 @@ func (_m *storageMock) GetAllBlockFiltersWithWSConn() ([]*Filter, error) { ret := _m.Called() var r0 []*Filter + var r1 error + if rf, ok := ret.Get(0).(func() ([]*Filter, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*Filter); ok { r0 = rf() } else { @@ -25,7 +29,6 @@ func (_m *storageMock) GetAllBlockFiltersWithWSConn() ([]*Filter, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -40,6 +43,10 @@ func (_m *storageMock) GetAllLogFiltersWithWSConn() ([]*Filter, error) { ret := _m.Called() var r0 []*Filter + var r1 error + if rf, ok := ret.Get(0).(func() ([]*Filter, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []*Filter); ok { r0 = rf() } else { @@ -48,7 +55,6 @@ func (_m *storageMock) GetAllLogFiltersWithWSConn() ([]*Filter, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -63,6 +69,10 @@ func (_m *storageMock) GetFilter(filterID string) (*Filter, error) { ret := _m.Called(filterID) var r0 *Filter + var r1 error + if rf, ok := ret.Get(0).(func(string) (*Filter, error)); ok { + return rf(filterID) + } if rf, ok := ret.Get(0).(func(string) *Filter); ok { r0 = rf(filterID) } else { @@ -71,7 +81,6 @@ func (_m *storageMock) GetFilter(filterID string) (*Filter, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(filterID) } else { @@ -86,13 +95,16 @@ func (_m *storageMock) NewBlockFilter(wsConn *websocket.Conn) (string, error) { ret := _m.Called(wsConn) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*websocket.Conn) (string, error)); ok { + return rf(wsConn) + } if rf, ok := ret.Get(0).(func(*websocket.Conn) string); ok { r0 = rf(wsConn) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(*websocket.Conn) error); ok { r1 = rf(wsConn) } else { @@ -107,13 +119,16 @@ func (_m *storageMock) NewLogFilter(wsConn *websocket.Conn, filter LogFilter) (s ret := _m.Called(wsConn, filter) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*websocket.Conn, LogFilter) (string, error)); ok { + return rf(wsConn, filter) + } if rf, ok := ret.Get(0).(func(*websocket.Conn, LogFilter) string); ok { r0 = rf(wsConn, filter) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(*websocket.Conn, LogFilter) error); ok { r1 = rf(wsConn, filter) } else { @@ -128,13 +143,16 @@ func (_m *storageMock) NewPendingTransactionFilter(wsConn *websocket.Conn) (stri ret := _m.Called(wsConn) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(*websocket.Conn) (string, error)); ok { + return rf(wsConn) + } if rf, ok := ret.Get(0).(func(*websocket.Conn) string); ok { r0 = rf(wsConn) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(*websocket.Conn) error); ok { r1 = rf(wsConn) } else { diff --git a/pool/pool.go b/pool/pool.go index edafee9e9d..57fa96b1eb 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -68,17 +68,17 @@ func (p *Pool) AddTx(ctx context.Context, tx types.Transaction, ip string) error return err } - return p.StoreTx(ctx, tx, ip) + return p.StoreTx(ctx, tx, ip, false) } // StoreTx adds a transaction to the pool with the pending state -func (p *Pool) StoreTx(ctx context.Context, tx types.Transaction, ip string) error { +func (p *Pool) StoreTx(ctx context.Context, tx types.Transaction, ip string, isWIP bool) error { poolTx := Transaction{ Transaction: tx, Status: TxStatusPending, IsClaims: false, ReceivedAt: time.Now(), - IsWIP: false, + IsWIP: isWIP, IP: ip, } diff --git a/sequencer/broadcast/mocks/mock_state.go b/sequencer/broadcast/mocks/mock_state.go index a557f07a35..a01e3386ea 100644 --- a/sequencer/broadcast/mocks/mock_state.go +++ b/sequencer/broadcast/mocks/mock_state.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package mocks @@ -24,6 +24,10 @@ func (_m *StateMock) GetBatchByNumber(ctx context.Context, batchNumber uint64, d ret := _m.Called(ctx, batchNumber, dbTx) var r0 *state.Batch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.Batch, error)); ok { + return rf(ctx, batchNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.Batch); ok { r0 = rf(ctx, batchNumber, dbTx) } else { @@ -32,7 +36,6 @@ func (_m *StateMock) GetBatchByNumber(ctx context.Context, batchNumber uint64, d } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, batchNumber, dbTx) } else { @@ -47,6 +50,10 @@ func (_m *StateMock) GetEncodedTransactionsByBatchNumber(ctx context.Context, ba ret := _m.Called(ctx, batchNumber, dbTx) var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) ([]string, error)); ok { + return rf(ctx, batchNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) []string); ok { r0 = rf(ctx, batchNumber, dbTx) } else { @@ -55,7 +62,6 @@ func (_m *StateMock) GetEncodedTransactionsByBatchNumber(ctx context.Context, ba } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, batchNumber, dbTx) } else { @@ -70,6 +76,10 @@ func (_m *StateMock) GetExitRootByGlobalExitRoot(ctx context.Context, ger common ret := _m.Called(ctx, ger, dbTx) var r0 *state.GlobalExitRoot + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) (*state.GlobalExitRoot, error)); ok { + return rf(ctx, ger, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, common.Hash, pgx.Tx) *state.GlobalExitRoot); ok { r0 = rf(ctx, ger, dbTx) } else { @@ -78,7 +88,6 @@ func (_m *StateMock) GetExitRootByGlobalExitRoot(ctx context.Context, ger common } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Hash, pgx.Tx) error); ok { r1 = rf(ctx, ger, dbTx) } else { @@ -93,6 +102,10 @@ func (_m *StateMock) GetLastBatch(ctx context.Context, dbTx pgx.Tx) (*state.Batc ret := _m.Called(ctx, dbTx) var r0 *state.Batch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*state.Batch, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *state.Batch); ok { r0 = rf(ctx, dbTx) } else { @@ -101,7 +114,6 @@ func (_m *StateMock) GetLastBatch(ctx context.Context, dbTx pgx.Tx) (*state.Batc } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { diff --git a/sequencer/mock_db_manager.go b/sequencer/mock_db_manager.go index 5b23fe2c6e..b5f39a1d1b 100644 --- a/sequencer/mock_db_manager.go +++ b/sequencer/mock_db_manager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package sequencer @@ -31,6 +31,10 @@ func (_m *DbManagerMock) BeginStateTransaction(ctx context.Context) (pgx.Tx, err ret := _m.Called(ctx) var r0 pgx.Tx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (pgx.Tx, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) pgx.Tx); ok { r0 = rf(ctx) } else { @@ -39,7 +43,6 @@ func (_m *DbManagerMock) BeginStateTransaction(ctx context.Context) (pgx.Tx, err } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -68,13 +71,16 @@ func (_m *DbManagerMock) CountReorgs(ctx context.Context, dbTx pgx.Tx) (uint64, ret := _m.Called(ctx, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -131,6 +137,10 @@ func (_m *DbManagerMock) GetBalanceByStateRoot(ctx context.Context, address comm ret := _m.Called(ctx, address, root) var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, common.Hash) (*big.Int, error)); ok { + return rf(ctx, address, root) + } if rf, ok := ret.Get(0).(func(context.Context, common.Address, common.Hash) *big.Int); ok { r0 = rf(ctx, address, root) } else { @@ -139,7 +149,6 @@ func (_m *DbManagerMock) GetBalanceByStateRoot(ctx context.Context, address comm } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Address, common.Hash) error); ok { r1 = rf(ctx, address, root) } else { @@ -154,6 +163,10 @@ func (_m *DbManagerMock) GetBatchByNumber(ctx context.Context, batchNumber uint6 ret := _m.Called(ctx, batchNumber, dbTx) var r0 *state.Batch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.Batch, error)); ok { + return rf(ctx, batchNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.Batch); ok { r0 = rf(ctx, batchNumber, dbTx) } else { @@ -162,7 +175,6 @@ func (_m *DbManagerMock) GetBatchByNumber(ctx context.Context, batchNumber uint6 } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, batchNumber, dbTx) } else { @@ -177,6 +189,10 @@ func (_m *DbManagerMock) GetForcedBatchesSince(ctx context.Context, forcedBatchN ret := _m.Called(ctx, forcedBatchNumber, maxBlockNumber, dbTx) var r0 []*state.ForcedBatch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, pgx.Tx) ([]*state.ForcedBatch, error)); ok { + return rf(ctx, forcedBatchNumber, maxBlockNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, pgx.Tx) []*state.ForcedBatch); ok { r0 = rf(ctx, forcedBatchNumber, maxBlockNumber, dbTx) } else { @@ -185,7 +201,6 @@ func (_m *DbManagerMock) GetForcedBatchesSince(ctx context.Context, forcedBatchN } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, uint64, pgx.Tx) error); ok { r1 = rf(ctx, forcedBatchNumber, maxBlockNumber, dbTx) } else { @@ -200,6 +215,10 @@ func (_m *DbManagerMock) GetLastBatch(ctx context.Context) (*state.Batch, error) ret := _m.Called(ctx) var r0 *state.Batch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*state.Batch, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) *state.Batch); ok { r0 = rf(ctx) } else { @@ -208,7 +227,6 @@ func (_m *DbManagerMock) GetLastBatch(ctx context.Context) (*state.Batch, error) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -223,13 +241,16 @@ func (_m *DbManagerMock) GetLastBatchNumber(ctx context.Context) (uint64, error) ret := _m.Called(ctx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (uint64, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) uint64); ok { r0 = rf(ctx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -244,6 +265,10 @@ func (_m *DbManagerMock) GetLastBlock(ctx context.Context, dbTx pgx.Tx) (*state. ret := _m.Called(ctx, dbTx) var r0 *state.Block + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*state.Block, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *state.Block); ok { r0 = rf(ctx, dbTx) } else { @@ -252,7 +277,6 @@ func (_m *DbManagerMock) GetLastBlock(ctx context.Context, dbTx pgx.Tx) (*state. } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -267,6 +291,10 @@ func (_m *DbManagerMock) GetLastClosedBatch(ctx context.Context) (*state.Batch, ret := _m.Called(ctx) var r0 *state.Batch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*state.Batch, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) *state.Batch); ok { r0 = rf(ctx) } else { @@ -275,7 +303,6 @@ func (_m *DbManagerMock) GetLastClosedBatch(ctx context.Context) (*state.Batch, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -290,6 +317,10 @@ func (_m *DbManagerMock) GetLastL2BlockHeader(ctx context.Context, dbTx pgx.Tx) ret := _m.Called(ctx, dbTx) var r0 *types.Header + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*types.Header, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *types.Header); ok { r0 = rf(ctx, dbTx) } else { @@ -298,7 +329,6 @@ func (_m *DbManagerMock) GetLastL2BlockHeader(ctx context.Context, dbTx pgx.Tx) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -313,6 +343,10 @@ func (_m *DbManagerMock) GetLastNBatches(ctx context.Context, numBatches uint) ( ret := _m.Called(ctx, numBatches) var r0 []*state.Batch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint) ([]*state.Batch, error)); ok { + return rf(ctx, numBatches) + } if rf, ok := ret.Get(0).(func(context.Context, uint) []*state.Batch); ok { r0 = rf(ctx, numBatches) } else { @@ -321,7 +355,6 @@ func (_m *DbManagerMock) GetLastNBatches(ctx context.Context, numBatches uint) ( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok { r1 = rf(ctx, numBatches) } else { @@ -336,13 +369,16 @@ func (_m *DbManagerMock) GetLastTrustedForcedBatchNumber(ctx context.Context, db ret := _m.Called(ctx, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -357,20 +393,23 @@ func (_m *DbManagerMock) GetLatestGer(ctx context.Context, gerFinalityNumberOfBl ret := _m.Called(ctx, gerFinalityNumberOfBlocks) var r0 state.GlobalExitRoot + var r1 time.Time + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (state.GlobalExitRoot, time.Time, error)); ok { + return rf(ctx, gerFinalityNumberOfBlocks) + } if rf, ok := ret.Get(0).(func(context.Context, uint64) state.GlobalExitRoot); ok { r0 = rf(ctx, gerFinalityNumberOfBlocks) } else { r0 = ret.Get(0).(state.GlobalExitRoot) } - var r1 time.Time if rf, ok := ret.Get(1).(func(context.Context, uint64) time.Time); ok { r1 = rf(ctx, gerFinalityNumberOfBlocks) } else { r1 = ret.Get(1).(time.Time) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, uint64) error); ok { r2 = rf(ctx, gerFinalityNumberOfBlocks) } else { @@ -385,13 +424,16 @@ func (_m *DbManagerMock) GetLatestVirtualBatchTimestamp(ctx context.Context, dbT ret := _m.Called(ctx, dbTx) var r0 time.Time + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (time.Time, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) time.Time); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(time.Time) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -406,6 +448,10 @@ func (_m *DbManagerMock) GetTransactionsByBatchNumber(ctx context.Context, batch ret := _m.Called(ctx, batchNumber) var r0 []types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) ([]types.Transaction, error)); ok { + return rf(ctx, batchNumber) + } if rf, ok := ret.Get(0).(func(context.Context, uint64) []types.Transaction); ok { r0 = rf(ctx, batchNumber) } else { @@ -414,7 +460,6 @@ func (_m *DbManagerMock) GetTransactionsByBatchNumber(ctx context.Context, batch } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { r1 = rf(ctx, batchNumber) } else { @@ -429,6 +474,10 @@ func (_m *DbManagerMock) GetWIPBatch(ctx context.Context) (*WipBatch, error) { ret := _m.Called(ctx) var r0 *WipBatch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*WipBatch, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) *WipBatch); ok { r0 = rf(ctx) } else { @@ -437,7 +486,6 @@ func (_m *DbManagerMock) GetWIPBatch(ctx context.Context) (*WipBatch, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -452,13 +500,16 @@ func (_m *DbManagerMock) IsBatchClosed(ctx context.Context, batchNum uint64) (bo ret := _m.Called(ctx, batchNum) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (bool, error)); ok { + return rf(ctx, batchNum) + } if rf, ok := ret.Get(0).(func(context.Context, uint64) bool); ok { r0 = rf(ctx, batchNum) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { r1 = rf(ctx, batchNum) } else { @@ -487,6 +538,10 @@ func (_m *DbManagerMock) ProcessForcedBatch(forcedBatchNum uint64, request state ret := _m.Called(forcedBatchNum, request) var r0 *state.ProcessBatchResponse + var r1 error + if rf, ok := ret.Get(0).(func(uint64, state.ProcessRequest) (*state.ProcessBatchResponse, error)); ok { + return rf(forcedBatchNum, request) + } if rf, ok := ret.Get(0).(func(uint64, state.ProcessRequest) *state.ProcessBatchResponse); ok { r0 = rf(forcedBatchNum, request) } else { @@ -495,7 +550,6 @@ func (_m *DbManagerMock) ProcessForcedBatch(forcedBatchNum uint64, request state } } - var r1 error if rf, ok := ret.Get(1).(func(uint64, state.ProcessRequest) error); ok { r1 = rf(forcedBatchNum, request) } else { diff --git a/sequencer/mock_dbtx.go b/sequencer/mock_dbtx.go index fa16827b43..196f2b1850 100644 --- a/sequencer/mock_dbtx.go +++ b/sequencer/mock_dbtx.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package sequencer @@ -21,6 +21,10 @@ func (_m *DbTxMock) Begin(ctx context.Context) (pgx.Tx, error) { ret := _m.Called(ctx) var r0 pgx.Tx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (pgx.Tx, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) pgx.Tx); ok { r0 = rf(ctx) } else { @@ -29,7 +33,6 @@ func (_m *DbTxMock) Begin(ctx context.Context) (pgx.Tx, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -88,13 +91,16 @@ func (_m *DbTxMock) CopyFrom(ctx context.Context, tableName pgx.Identifier, colu ret := _m.Called(ctx, tableName, columnNames, rowSrc) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) (int64, error)); ok { + return rf(ctx, tableName, columnNames, rowSrc) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) int64); ok { r0 = rf(ctx, tableName, columnNames, rowSrc) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) error); ok { r1 = rf(ctx, tableName, columnNames, rowSrc) } else { @@ -112,6 +118,10 @@ func (_m *DbTxMock) Exec(ctx context.Context, sql string, arguments ...interface ret := _m.Called(_ca...) var r0 pgconn.CommandTag + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (pgconn.CommandTag, error)); ok { + return rf(ctx, sql, arguments...) + } if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) pgconn.CommandTag); ok { r0 = rf(ctx, sql, arguments...) } else { @@ -120,7 +130,6 @@ func (_m *DbTxMock) Exec(ctx context.Context, sql string, arguments ...interface } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok { r1 = rf(ctx, sql, arguments...) } else { @@ -149,6 +158,10 @@ func (_m *DbTxMock) Prepare(ctx context.Context, name string, sql string) (*pgco ret := _m.Called(ctx, name, sql) var r0 *pgconn.StatementDescription + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*pgconn.StatementDescription, error)); ok { + return rf(ctx, name, sql) + } if rf, ok := ret.Get(0).(func(context.Context, string, string) *pgconn.StatementDescription); ok { r0 = rf(ctx, name, sql) } else { @@ -157,7 +170,6 @@ func (_m *DbTxMock) Prepare(ctx context.Context, name string, sql string) (*pgco } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = rf(ctx, name, sql) } else { @@ -175,6 +187,10 @@ func (_m *DbTxMock) Query(ctx context.Context, sql string, args ...interface{}) ret := _m.Called(_ca...) var r0 pgx.Rows + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (pgx.Rows, error)); ok { + return rf(ctx, sql, args...) + } if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) pgx.Rows); ok { r0 = rf(ctx, sql, args...) } else { @@ -183,7 +199,6 @@ func (_m *DbTxMock) Query(ctx context.Context, sql string, args ...interface{}) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok { r1 = rf(ctx, sql, args...) } else { @@ -198,6 +213,10 @@ func (_m *DbTxMock) QueryFunc(ctx context.Context, sql string, args []interface{ ret := _m.Called(ctx, sql, args, scans, f) var r0 pgconn.CommandTag + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error)); ok { + return rf(ctx, sql, args, scans, f) + } if rf, ok := ret.Get(0).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) pgconn.CommandTag); ok { r0 = rf(ctx, sql, args, scans, f) } else { @@ -206,7 +225,6 @@ func (_m *DbTxMock) QueryFunc(ctx context.Context, sql string, args []interface{ } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) error); ok { r1 = rf(ctx, sql, args, scans, f) } else { diff --git a/sequencer/mock_pool.go b/sequencer/mock_pool.go index 830cc7dcd6..6d08025490 100644 --- a/sequencer/mock_pool.go +++ b/sequencer/mock_pool.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package sequencer @@ -52,6 +52,10 @@ func (_m *PoolMock) GetNonWIPPendingTxs(ctx context.Context, isClaims bool, limi ret := _m.Called(ctx, isClaims, limit) var r0 []pool.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bool, uint64) ([]pool.Transaction, error)); ok { + return rf(ctx, isClaims, limit) + } if rf, ok := ret.Get(0).(func(context.Context, bool, uint64) []pool.Transaction); ok { r0 = rf(ctx, isClaims, limit) } else { @@ -60,7 +64,6 @@ func (_m *PoolMock) GetNonWIPPendingTxs(ctx context.Context, isClaims bool, limi } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bool, uint64) error); ok { r1 = rf(ctx, isClaims, limit) } else { @@ -75,6 +78,10 @@ func (_m *PoolMock) GetTxZkCountersByHash(ctx context.Context, hash common.Hash) ret := _m.Called(ctx, hash) var r0 *state.ZKCounters + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Hash) (*state.ZKCounters, error)); ok { + return rf(ctx, hash) + } if rf, ok := ret.Get(0).(func(context.Context, common.Hash) *state.ZKCounters); ok { r0 = rf(ctx, hash) } else { @@ -83,7 +90,6 @@ func (_m *PoolMock) GetTxZkCountersByHash(ctx context.Context, hash common.Hash) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Hash) error); ok { r1 = rf(ctx, hash) } else { diff --git a/sequencer/mock_state.go b/sequencer/mock_state.go index 497153d86b..5bc27a0148 100644 --- a/sequencer/mock_state.go +++ b/sequencer/mock_state.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package sequencer @@ -31,6 +31,10 @@ func (_m *StateMock) Begin(ctx context.Context) (pgx.Tx, error) { ret := _m.Called(ctx) var r0 pgx.Tx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (pgx.Tx, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) pgx.Tx); ok { r0 = rf(ctx) } else { @@ -39,7 +43,6 @@ func (_m *StateMock) Begin(ctx context.Context) (pgx.Tx, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -54,6 +57,10 @@ func (_m *StateMock) BeginStateTransaction(ctx context.Context) (pgx.Tx, error) ret := _m.Called(ctx) var r0 pgx.Tx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (pgx.Tx, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) pgx.Tx); ok { r0 = rf(ctx) } else { @@ -62,7 +69,6 @@ func (_m *StateMock) BeginStateTransaction(ctx context.Context) (pgx.Tx, error) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -91,13 +97,16 @@ func (_m *StateMock) CountReorgs(ctx context.Context, dbTx pgx.Tx) (uint64, erro ret := _m.Called(ctx, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -112,6 +121,10 @@ func (_m *StateMock) ExecuteBatch(ctx context.Context, batch state.Batch, update ret := _m.Called(ctx, batch, updateMerkleTree, dbTx) var r0 *pb.ProcessBatchResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, state.Batch, bool, pgx.Tx) (*pb.ProcessBatchResponse, error)); ok { + return rf(ctx, batch, updateMerkleTree, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, state.Batch, bool, pgx.Tx) *pb.ProcessBatchResponse); ok { r0 = rf(ctx, batch, updateMerkleTree, dbTx) } else { @@ -120,7 +133,6 @@ func (_m *StateMock) ExecuteBatch(ctx context.Context, batch state.Batch, update } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, state.Batch, bool, pgx.Tx) error); ok { r1 = rf(ctx, batch, updateMerkleTree, dbTx) } else { @@ -149,6 +161,10 @@ func (_m *StateMock) GetBalanceByStateRoot(ctx context.Context, address common.A ret := _m.Called(ctx, address, root) var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, common.Hash) (*big.Int, error)); ok { + return rf(ctx, address, root) + } if rf, ok := ret.Get(0).(func(context.Context, common.Address, common.Hash) *big.Int); ok { r0 = rf(ctx, address, root) } else { @@ -157,7 +173,6 @@ func (_m *StateMock) GetBalanceByStateRoot(ctx context.Context, address common.A } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Address, common.Hash) error); ok { r1 = rf(ctx, address, root) } else { @@ -172,6 +187,10 @@ func (_m *StateMock) GetBatchByNumber(ctx context.Context, batchNumber uint64, d ret := _m.Called(ctx, batchNumber, dbTx) var r0 *state.Batch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.Batch, error)); ok { + return rf(ctx, batchNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.Batch); ok { r0 = rf(ctx, batchNumber, dbTx) } else { @@ -180,7 +199,6 @@ func (_m *StateMock) GetBatchByNumber(ctx context.Context, batchNumber uint64, d } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, batchNumber, dbTx) } else { @@ -195,6 +213,10 @@ func (_m *StateMock) GetForcedBatch(ctx context.Context, forcedBatchNumber uint6 ret := _m.Called(ctx, forcedBatchNumber, dbTx) var r0 *state.ForcedBatch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.ForcedBatch, error)); ok { + return rf(ctx, forcedBatchNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.ForcedBatch); ok { r0 = rf(ctx, forcedBatchNumber, dbTx) } else { @@ -203,7 +225,6 @@ func (_m *StateMock) GetForcedBatch(ctx context.Context, forcedBatchNumber uint6 } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, forcedBatchNumber, dbTx) } else { @@ -218,6 +239,10 @@ func (_m *StateMock) GetForcedBatchesSince(ctx context.Context, forcedBatchNumbe ret := _m.Called(ctx, forcedBatchNumber, maxBlockNumber, dbTx) var r0 []*state.ForcedBatch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, pgx.Tx) ([]*state.ForcedBatch, error)); ok { + return rf(ctx, forcedBatchNumber, maxBlockNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, pgx.Tx) []*state.ForcedBatch); ok { r0 = rf(ctx, forcedBatchNumber, maxBlockNumber, dbTx) } else { @@ -226,7 +251,6 @@ func (_m *StateMock) GetForcedBatchesSince(ctx context.Context, forcedBatchNumbe } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, uint64, pgx.Tx) error); ok { r1 = rf(ctx, forcedBatchNumber, maxBlockNumber, dbTx) } else { @@ -241,6 +265,10 @@ func (_m *StateMock) GetLastBatch(ctx context.Context, dbTx pgx.Tx) (*state.Batc ret := _m.Called(ctx, dbTx) var r0 *state.Batch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*state.Batch, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *state.Batch); ok { r0 = rf(ctx, dbTx) } else { @@ -249,7 +277,6 @@ func (_m *StateMock) GetLastBatch(ctx context.Context, dbTx pgx.Tx) (*state.Batc } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -264,13 +291,16 @@ func (_m *StateMock) GetLastBatchNumber(ctx context.Context, dbTx pgx.Tx) (uint6 ret := _m.Called(ctx, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -285,6 +315,10 @@ func (_m *StateMock) GetLastBlock(ctx context.Context, dbTx pgx.Tx) (*state.Bloc ret := _m.Called(ctx, dbTx) var r0 *state.Block + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*state.Block, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *state.Block); ok { r0 = rf(ctx, dbTx) } else { @@ -293,7 +327,6 @@ func (_m *StateMock) GetLastBlock(ctx context.Context, dbTx pgx.Tx) (*state.Bloc } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -308,6 +341,10 @@ func (_m *StateMock) GetLastClosedBatch(ctx context.Context, dbTx pgx.Tx) (*stat ret := _m.Called(ctx, dbTx) var r0 *state.Batch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*state.Batch, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *state.Batch); ok { r0 = rf(ctx, dbTx) } else { @@ -316,7 +353,6 @@ func (_m *StateMock) GetLastClosedBatch(ctx context.Context, dbTx pgx.Tx) (*stat } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -331,6 +367,10 @@ func (_m *StateMock) GetLastL2Block(ctx context.Context, dbTx pgx.Tx) (*types.Bl ret := _m.Called(ctx, dbTx) var r0 *types.Block + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*types.Block, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *types.Block); ok { r0 = rf(ctx, dbTx) } else { @@ -339,7 +379,6 @@ func (_m *StateMock) GetLastL2Block(ctx context.Context, dbTx pgx.Tx) (*types.Bl } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -354,6 +393,10 @@ func (_m *StateMock) GetLastL2BlockHeader(ctx context.Context, dbTx pgx.Tx) (*ty ret := _m.Called(ctx, dbTx) var r0 *types.Header + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*types.Header, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *types.Header); ok { r0 = rf(ctx, dbTx) } else { @@ -362,7 +405,6 @@ func (_m *StateMock) GetLastL2BlockHeader(ctx context.Context, dbTx pgx.Tx) (*ty } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -377,6 +419,10 @@ func (_m *StateMock) GetLastNBatches(ctx context.Context, numBatches uint, dbTx ret := _m.Called(ctx, numBatches, dbTx) var r0 []*state.Batch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint, pgx.Tx) ([]*state.Batch, error)); ok { + return rf(ctx, numBatches, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint, pgx.Tx) []*state.Batch); ok { r0 = rf(ctx, numBatches, dbTx) } else { @@ -385,7 +431,6 @@ func (_m *StateMock) GetLastNBatches(ctx context.Context, numBatches uint, dbTx } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint, pgx.Tx) error); ok { r1 = rf(ctx, numBatches, dbTx) } else { @@ -400,6 +445,10 @@ func (_m *StateMock) GetLastStateRoot(ctx context.Context, dbTx pgx.Tx) (common. ret := _m.Called(ctx, dbTx) var r0 common.Hash + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (common.Hash, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) common.Hash); ok { r0 = rf(ctx, dbTx) } else { @@ -408,7 +457,6 @@ func (_m *StateMock) GetLastStateRoot(ctx context.Context, dbTx pgx.Tx) (common. } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -423,13 +471,16 @@ func (_m *StateMock) GetLastTrustedForcedBatchNumber(ctx context.Context, dbTx p ret := _m.Called(ctx, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -444,13 +495,16 @@ func (_m *StateMock) GetLastVirtualBatchNum(ctx context.Context, dbTx pgx.Tx) (u ret := _m.Called(ctx, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -465,20 +519,23 @@ func (_m *StateMock) GetLatestGer(ctx context.Context, gerFinalityNumberOfBlocks ret := _m.Called(ctx, gerFinalityNumberOfBlocks) var r0 state.GlobalExitRoot + var r1 time.Time + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (state.GlobalExitRoot, time.Time, error)); ok { + return rf(ctx, gerFinalityNumberOfBlocks) + } if rf, ok := ret.Get(0).(func(context.Context, uint64) state.GlobalExitRoot); ok { r0 = rf(ctx, gerFinalityNumberOfBlocks) } else { r0 = ret.Get(0).(state.GlobalExitRoot) } - var r1 time.Time if rf, ok := ret.Get(1).(func(context.Context, uint64) time.Time); ok { r1 = rf(ctx, gerFinalityNumberOfBlocks) } else { r1 = ret.Get(1).(time.Time) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, uint64) error); ok { r2 = rf(ctx, gerFinalityNumberOfBlocks) } else { @@ -493,20 +550,23 @@ func (_m *StateMock) GetLatestGlobalExitRoot(ctx context.Context, maxBlockNumber ret := _m.Called(ctx, maxBlockNumber, dbTx) var r0 state.GlobalExitRoot + var r1 time.Time + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (state.GlobalExitRoot, time.Time, error)); ok { + return rf(ctx, maxBlockNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) state.GlobalExitRoot); ok { r0 = rf(ctx, maxBlockNumber, dbTx) } else { r0 = ret.Get(0).(state.GlobalExitRoot) } - var r1 time.Time if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) time.Time); ok { r1 = rf(ctx, maxBlockNumber, dbTx) } else { r1 = ret.Get(1).(time.Time) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, uint64, pgx.Tx) error); ok { r2 = rf(ctx, maxBlockNumber, dbTx) } else { @@ -521,13 +581,16 @@ func (_m *StateMock) GetLatestVirtualBatchTimestamp(ctx context.Context, dbTx pg ret := _m.Called(ctx, dbTx) var r0 time.Time + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (time.Time, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) time.Time); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(time.Time) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -542,6 +605,10 @@ func (_m *StateMock) GetNonceByStateRoot(ctx context.Context, address common.Add ret := _m.Called(ctx, address, root) var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, common.Hash) (*big.Int, error)); ok { + return rf(ctx, address, root) + } if rf, ok := ret.Get(0).(func(context.Context, common.Address, common.Hash) *big.Int); ok { r0 = rf(ctx, address, root) } else { @@ -550,7 +617,6 @@ func (_m *StateMock) GetNonceByStateRoot(ctx context.Context, address common.Add } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, common.Address, common.Hash) error); ok { r1 = rf(ctx, address, root) } else { @@ -565,13 +631,16 @@ func (_m *StateMock) GetTimeForLatestBatchVirtualization(ctx context.Context, db ret := _m.Called(ctx, dbTx) var r0 time.Time + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (time.Time, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) time.Time); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(time.Time) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -586,6 +655,10 @@ func (_m *StateMock) GetTransactionsByBatchNumber(ctx context.Context, batchNumb ret := _m.Called(ctx, batchNumber, dbTx) var r0 []types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) ([]types.Transaction, error)); ok { + return rf(ctx, batchNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) []types.Transaction); ok { r0 = rf(ctx, batchNumber, dbTx) } else { @@ -594,7 +667,6 @@ func (_m *StateMock) GetTransactionsByBatchNumber(ctx context.Context, batchNumb } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, batchNumber, dbTx) } else { @@ -609,6 +681,10 @@ func (_m *StateMock) GetTxsOlderThanNL1Blocks(ctx context.Context, nL1Blocks uin ret := _m.Called(ctx, nL1Blocks, dbTx) var r0 []common.Hash + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) ([]common.Hash, error)); ok { + return rf(ctx, nL1Blocks, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) []common.Hash); ok { r0 = rf(ctx, nL1Blocks, dbTx) } else { @@ -617,7 +693,6 @@ func (_m *StateMock) GetTxsOlderThanNL1Blocks(ctx context.Context, nL1Blocks uin } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, nL1Blocks, dbTx) } else { @@ -632,13 +707,16 @@ func (_m *StateMock) IsBatchClosed(ctx context.Context, batchNum uint64, dbTx pg ret := _m.Called(ctx, batchNum, dbTx) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (bool, error)); ok { + return rf(ctx, batchNum, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) bool); ok { r0 = rf(ctx, batchNum, dbTx) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, batchNum, dbTx) } else { @@ -667,6 +745,10 @@ func (_m *StateMock) ProcessBatch(ctx context.Context, request state.ProcessRequ ret := _m.Called(ctx, request, updateMerkleTree) var r0 *state.ProcessBatchResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, state.ProcessRequest, bool) (*state.ProcessBatchResponse, error)); ok { + return rf(ctx, request, updateMerkleTree) + } if rf, ok := ret.Get(0).(func(context.Context, state.ProcessRequest, bool) *state.ProcessBatchResponse); ok { r0 = rf(ctx, request, updateMerkleTree) } else { @@ -675,7 +757,6 @@ func (_m *StateMock) ProcessBatch(ctx context.Context, request state.ProcessRequ } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, state.ProcessRequest, bool) error); ok { r1 = rf(ctx, request, updateMerkleTree) } else { @@ -690,6 +771,10 @@ func (_m *StateMock) ProcessSequencerBatch(ctx context.Context, batchNumber uint ret := _m.Called(ctx, batchNumber, batchL2Data, caller, dbTx) var r0 *state.ProcessBatchResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, []byte, state.CallerLabel, pgx.Tx) (*state.ProcessBatchResponse, error)); ok { + return rf(ctx, batchNumber, batchL2Data, caller, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, []byte, state.CallerLabel, pgx.Tx) *state.ProcessBatchResponse); ok { r0 = rf(ctx, batchNumber, batchL2Data, caller, dbTx) } else { @@ -698,7 +783,6 @@ func (_m *StateMock) ProcessSequencerBatch(ctx context.Context, batchNumber uint } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, []byte, state.CallerLabel, pgx.Tx) error); ok { r1 = rf(ctx, batchNumber, batchL2Data, caller, dbTx) } else { diff --git a/sequencer/mock_worker.go b/sequencer/mock_worker.go index 2d22180ff2..8877a404d7 100644 --- a/sequencer/mock_worker.go +++ b/sequencer/mock_worker.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package sequencer @@ -72,6 +72,10 @@ func (_m *WorkerMock) NewTxTracker(tx types.Transaction, isClaim bool, counters ret := _m.Called(tx, isClaim, counters) var r0 *TxTracker + var r1 error + if rf, ok := ret.Get(0).(func(types.Transaction, bool, state.ZKCounters) (*TxTracker, error)); ok { + return rf(tx, isClaim, counters) + } if rf, ok := ret.Get(0).(func(types.Transaction, bool, state.ZKCounters) *TxTracker); ok { r0 = rf(tx, isClaim, counters) } else { @@ -80,7 +84,6 @@ func (_m *WorkerMock) NewTxTracker(tx types.Transaction, isClaim bool, counters } } - var r1 error if rf, ok := ret.Get(1).(func(types.Transaction, bool, state.ZKCounters) error); ok { r1 = rf(tx, isClaim, counters) } else { diff --git a/synchronizer/interfaces.go b/synchronizer/interfaces.go index 99c5c41562..3f86f57789 100644 --- a/synchronizer/interfaces.go +++ b/synchronizer/interfaces.go @@ -65,5 +65,5 @@ type ethTxManager interface { type poolInterface interface { DeleteReorgedTransactions(ctx context.Context, txs []*types.Transaction) error - StoreTx(ctx context.Context, tx types.Transaction, ip string) error + StoreTx(ctx context.Context, tx types.Transaction, ip string, isWIP bool) error } diff --git a/synchronizer/mock_dbtx.go b/synchronizer/mock_dbtx.go index d5a243d834..730d38c936 100644 --- a/synchronizer/mock_dbtx.go +++ b/synchronizer/mock_dbtx.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package synchronizer @@ -21,6 +21,10 @@ func (_m *dbTxMock) Begin(ctx context.Context) (pgx.Tx, error) { ret := _m.Called(ctx) var r0 pgx.Tx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (pgx.Tx, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) pgx.Tx); ok { r0 = rf(ctx) } else { @@ -29,7 +33,6 @@ func (_m *dbTxMock) Begin(ctx context.Context) (pgx.Tx, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -88,13 +91,16 @@ func (_m *dbTxMock) CopyFrom(ctx context.Context, tableName pgx.Identifier, colu ret := _m.Called(ctx, tableName, columnNames, rowSrc) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) (int64, error)); ok { + return rf(ctx, tableName, columnNames, rowSrc) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) int64); ok { r0 = rf(ctx, tableName, columnNames, rowSrc) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) error); ok { r1 = rf(ctx, tableName, columnNames, rowSrc) } else { @@ -112,6 +118,10 @@ func (_m *dbTxMock) Exec(ctx context.Context, sql string, arguments ...interface ret := _m.Called(_ca...) var r0 pgconn.CommandTag + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (pgconn.CommandTag, error)); ok { + return rf(ctx, sql, arguments...) + } if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) pgconn.CommandTag); ok { r0 = rf(ctx, sql, arguments...) } else { @@ -120,7 +130,6 @@ func (_m *dbTxMock) Exec(ctx context.Context, sql string, arguments ...interface } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok { r1 = rf(ctx, sql, arguments...) } else { @@ -149,6 +158,10 @@ func (_m *dbTxMock) Prepare(ctx context.Context, name string, sql string) (*pgco ret := _m.Called(ctx, name, sql) var r0 *pgconn.StatementDescription + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*pgconn.StatementDescription, error)); ok { + return rf(ctx, name, sql) + } if rf, ok := ret.Get(0).(func(context.Context, string, string) *pgconn.StatementDescription); ok { r0 = rf(ctx, name, sql) } else { @@ -157,7 +170,6 @@ func (_m *dbTxMock) Prepare(ctx context.Context, name string, sql string) (*pgco } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = rf(ctx, name, sql) } else { @@ -175,6 +187,10 @@ func (_m *dbTxMock) Query(ctx context.Context, sql string, args ...interface{}) ret := _m.Called(_ca...) var r0 pgx.Rows + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (pgx.Rows, error)); ok { + return rf(ctx, sql, args...) + } if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) pgx.Rows); ok { r0 = rf(ctx, sql, args...) } else { @@ -183,7 +199,6 @@ func (_m *dbTxMock) Query(ctx context.Context, sql string, args ...interface{}) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok { r1 = rf(ctx, sql, args...) } else { @@ -198,6 +213,10 @@ func (_m *dbTxMock) QueryFunc(ctx context.Context, sql string, args []interface{ ret := _m.Called(ctx, sql, args, scans, f) var r0 pgconn.CommandTag + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error)); ok { + return rf(ctx, sql, args, scans, f) + } if rf, ok := ret.Get(0).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) pgconn.CommandTag); ok { r0 = rf(ctx, sql, args, scans, f) } else { @@ -206,7 +225,6 @@ func (_m *dbTxMock) QueryFunc(ctx context.Context, sql string, args []interface{ } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) error); ok { r1 = rf(ctx, sql, args, scans, f) } else { diff --git a/synchronizer/mock_etherman.go b/synchronizer/mock_etherman.go index 0d82503c4d..036a115fed 100644 --- a/synchronizer/mock_etherman.go +++ b/synchronizer/mock_etherman.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package synchronizer @@ -27,6 +27,10 @@ func (_m *ethermanMock) EthBlockByNumber(ctx context.Context, blockNumber uint64 ret := _m.Called(ctx, blockNumber) var r0 *types.Block + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (*types.Block, error)); ok { + return rf(ctx, blockNumber) + } if rf, ok := ret.Get(0).(func(context.Context, uint64) *types.Block); ok { r0 = rf(ctx, blockNumber) } else { @@ -35,7 +39,6 @@ func (_m *ethermanMock) EthBlockByNumber(ctx context.Context, blockNumber uint64 } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { r1 = rf(ctx, blockNumber) } else { @@ -50,6 +53,10 @@ func (_m *ethermanMock) GetForks(ctx context.Context) ([]state.ForkIDInterval, e ret := _m.Called(ctx) var r0 []state.ForkIDInterval + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) ([]state.ForkIDInterval, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) []state.ForkIDInterval); ok { r0 = rf(ctx) } else { @@ -58,7 +65,6 @@ func (_m *ethermanMock) GetForks(ctx context.Context) ([]state.ForkIDInterval, e } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -73,13 +79,16 @@ func (_m *ethermanMock) GetLatestBatchNumber() (uint64, error) { ret := _m.Called() var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() uint64); ok { r0 = rf() } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -94,6 +103,11 @@ func (_m *ethermanMock) GetRollupInfoByBlockRange(ctx context.Context, fromBlock ret := _m.Called(ctx, fromBlock, toBlock) var r0 []etherman.Block + var r1 map[common.Hash][]etherman.Order + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, *uint64) ([]etherman.Block, map[common.Hash][]etherman.Order, error)); ok { + return rf(ctx, fromBlock, toBlock) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, *uint64) []etherman.Block); ok { r0 = rf(ctx, fromBlock, toBlock) } else { @@ -102,7 +116,6 @@ func (_m *ethermanMock) GetRollupInfoByBlockRange(ctx context.Context, fromBlock } } - var r1 map[common.Hash][]etherman.Order if rf, ok := ret.Get(1).(func(context.Context, uint64, *uint64) map[common.Hash][]etherman.Order); ok { r1 = rf(ctx, fromBlock, toBlock) } else { @@ -111,7 +124,6 @@ func (_m *ethermanMock) GetRollupInfoByBlockRange(ctx context.Context, fromBlock } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, uint64, *uint64) error); ok { r2 = rf(ctx, fromBlock, toBlock) } else { @@ -126,13 +138,16 @@ func (_m *ethermanMock) GetTrustedSequencerURL() (string, error) { ret := _m.Called() var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -147,6 +162,10 @@ func (_m *ethermanMock) HeaderByNumber(ctx context.Context, number *big.Int) (*t ret := _m.Called(ctx, number) var r0 *types.Header + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) (*types.Header, error)); ok { + return rf(ctx, number) + } if rf, ok := ret.Get(0).(func(context.Context, *big.Int) *types.Header); ok { r0 = rf(ctx, number) } else { @@ -155,7 +174,6 @@ func (_m *ethermanMock) HeaderByNumber(ctx context.Context, number *big.Int) (*t } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *big.Int) error); ok { r1 = rf(ctx, number) } else { @@ -170,13 +188,16 @@ func (_m *ethermanMock) VerifyGenBlockNumber(ctx context.Context, genBlockNumber ret := _m.Called(ctx, genBlockNumber) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (bool, error)); ok { + return rf(ctx, genBlockNumber) + } if rf, ok := ret.Get(0).(func(context.Context, uint64) bool); ok { r0 = rf(ctx, genBlockNumber) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { r1 = rf(ctx, genBlockNumber) } else { diff --git a/synchronizer/mock_ethtxmanager.go b/synchronizer/mock_ethtxmanager.go index dac2cc349f..31f6dd3ef0 100644 --- a/synchronizer/mock_ethtxmanager.go +++ b/synchronizer/mock_ethtxmanager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package synchronizer diff --git a/synchronizer/mock_pool.go b/synchronizer/mock_pool.go index c94eb18e0c..0db2e31cb0 100644 --- a/synchronizer/mock_pool.go +++ b/synchronizer/mock_pool.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package synchronizer @@ -29,13 +29,13 @@ func (_m *poolMock) DeleteReorgedTransactions(ctx context.Context, txs []*types. return r0 } -// StoreTx provides a mock function with given fields: ctx, tx, ip -func (_m *poolMock) StoreTx(ctx context.Context, tx types.Transaction, ip string) error { - ret := _m.Called(ctx, tx, ip) +// StoreTx provides a mock function with given fields: ctx, tx, ip, isWIP +func (_m *poolMock) StoreTx(ctx context.Context, tx types.Transaction, ip string, isWIP bool) error { + ret := _m.Called(ctx, tx, ip, isWIP) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, types.Transaction, string) error); ok { - r0 = rf(ctx, tx, ip) + if rf, ok := ret.Get(0).(func(context.Context, types.Transaction, string, bool) error); ok { + r0 = rf(ctx, tx, ip, isWIP) } else { r0 = ret.Error(0) } diff --git a/synchronizer/mock_state.go b/synchronizer/mock_state.go index 28071ed828..db075dd450 100644 --- a/synchronizer/mock_state.go +++ b/synchronizer/mock_state.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.16.0. DO NOT EDIT. +// Code generated by mockery v2.22.1. DO NOT EDIT. package synchronizer @@ -140,6 +140,10 @@ func (_m *stateMock) BeginStateTransaction(ctx context.Context) (pgx.Tx, error) ret := _m.Called(ctx) var r0 pgx.Tx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (pgx.Tx, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) pgx.Tx); ok { r0 = rf(ctx) } else { @@ -148,7 +152,6 @@ func (_m *stateMock) BeginStateTransaction(ctx context.Context) (pgx.Tx, error) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -177,6 +180,10 @@ func (_m *stateMock) ExecuteBatch(ctx context.Context, batch state.Batch, update ret := _m.Called(ctx, batch, updateMerkleTree, dbTx) var r0 *pb.ProcessBatchResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, state.Batch, bool, pgx.Tx) (*pb.ProcessBatchResponse, error)); ok { + return rf(ctx, batch, updateMerkleTree, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, state.Batch, bool, pgx.Tx) *pb.ProcessBatchResponse); ok { r0 = rf(ctx, batch, updateMerkleTree, dbTx) } else { @@ -185,7 +192,6 @@ func (_m *stateMock) ExecuteBatch(ctx context.Context, batch state.Batch, update } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, state.Batch, bool, pgx.Tx) error); ok { r1 = rf(ctx, batch, updateMerkleTree, dbTx) } else { @@ -200,6 +206,10 @@ func (_m *stateMock) GetBatchByNumber(ctx context.Context, batchNumber uint64, d ret := _m.Called(ctx, batchNumber, dbTx) var r0 *state.Batch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.Batch, error)); ok { + return rf(ctx, batchNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.Batch); ok { r0 = rf(ctx, batchNumber, dbTx) } else { @@ -208,7 +218,6 @@ func (_m *stateMock) GetBatchByNumber(ctx context.Context, batchNumber uint64, d } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, batchNumber, dbTx) } else { @@ -223,13 +232,16 @@ func (_m *stateMock) GetForkIDTrustedReorgCount(ctx context.Context, forkID uint ret := _m.Called(ctx, forkID, version, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, string, pgx.Tx) (uint64, error)); ok { + return rf(ctx, forkID, version, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, string, pgx.Tx) uint64); ok { r0 = rf(ctx, forkID, version, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, string, pgx.Tx) error); ok { r1 = rf(ctx, forkID, version, dbTx) } else { @@ -244,13 +256,16 @@ func (_m *stateMock) GetLastBatchNumber(ctx context.Context, dbTx pgx.Tx) (uint6 ret := _m.Called(ctx, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -265,6 +280,10 @@ func (_m *stateMock) GetLastBlock(ctx context.Context, dbTx pgx.Tx) (*state.Bloc ret := _m.Called(ctx, dbTx) var r0 *state.Block + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*state.Block, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *state.Block); ok { r0 = rf(ctx, dbTx) } else { @@ -273,7 +292,6 @@ func (_m *stateMock) GetLastBlock(ctx context.Context, dbTx pgx.Tx) (*state.Bloc } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -288,6 +306,10 @@ func (_m *stateMock) GetLastVerifiedBatch(ctx context.Context, dbTx pgx.Tx) (*st ret := _m.Called(ctx, dbTx) var r0 *state.VerifiedBatch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*state.VerifiedBatch, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) *state.VerifiedBatch); ok { r0 = rf(ctx, dbTx) } else { @@ -296,7 +318,6 @@ func (_m *stateMock) GetLastVerifiedBatch(ctx context.Context, dbTx pgx.Tx) (*st } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -311,13 +332,16 @@ func (_m *stateMock) GetLastVirtualBatchNum(ctx context.Context, dbTx pgx.Tx) (u ret := _m.Called(ctx, dbTx) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (uint64, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) uint64); ok { r0 = rf(ctx, dbTx) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, pgx.Tx) error); ok { r1 = rf(ctx, dbTx) } else { @@ -332,6 +356,10 @@ func (_m *stateMock) GetNextForcedBatches(ctx context.Context, nextForcedBatches ret := _m.Called(ctx, nextForcedBatches, dbTx) var r0 []state.ForcedBatch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int, pgx.Tx) ([]state.ForcedBatch, error)); ok { + return rf(ctx, nextForcedBatches, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, int, pgx.Tx) []state.ForcedBatch); ok { r0 = rf(ctx, nextForcedBatches, dbTx) } else { @@ -340,7 +368,6 @@ func (_m *stateMock) GetNextForcedBatches(ctx context.Context, nextForcedBatches } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, int, pgx.Tx) error); ok { r1 = rf(ctx, nextForcedBatches, dbTx) } else { @@ -355,6 +382,10 @@ func (_m *stateMock) GetPreviousBlock(ctx context.Context, offset uint64, dbTx p ret := _m.Called(ctx, offset, dbTx) var r0 *state.Block + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.Block, error)); ok { + return rf(ctx, offset, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.Block); ok { r0 = rf(ctx, offset, dbTx) } else { @@ -363,7 +394,6 @@ func (_m *stateMock) GetPreviousBlock(ctx context.Context, offset uint64, dbTx p } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, offset, dbTx) } else { @@ -378,6 +408,10 @@ func (_m *stateMock) GetReorgedTransactions(ctx context.Context, batchNumber uin ret := _m.Called(ctx, batchNumber, dbTx) var r0 []*types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) ([]*types.Transaction, error)); ok { + return rf(ctx, batchNumber, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) []*types.Transaction); ok { r0 = rf(ctx, batchNumber, dbTx) } else { @@ -386,7 +420,6 @@ func (_m *stateMock) GetReorgedTransactions(ctx context.Context, batchNumber uin } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, batchNumber, dbTx) } else { @@ -401,6 +434,10 @@ func (_m *stateMock) GetStateRootByBatchNumber(ctx context.Context, batchNum uin ret := _m.Called(ctx, batchNum, dbTx) var r0 common.Hash + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (common.Hash, error)); ok { + return rf(ctx, batchNum, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) common.Hash); ok { r0 = rf(ctx, batchNum, dbTx) } else { @@ -409,7 +446,6 @@ func (_m *stateMock) GetStateRootByBatchNumber(ctx context.Context, batchNum uin } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok { r1 = rf(ctx, batchNum, dbTx) } else { @@ -452,6 +488,10 @@ func (_m *stateMock) ProcessSequencerBatch(ctx context.Context, batchNumber uint ret := _m.Called(ctx, batchNumber, batchL2Data, caller, dbTx) var r0 *state.ProcessBatchResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, []byte, state.CallerLabel, pgx.Tx) (*state.ProcessBatchResponse, error)); ok { + return rf(ctx, batchNumber, batchL2Data, caller, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, uint64, []byte, state.CallerLabel, pgx.Tx) *state.ProcessBatchResponse); ok { r0 = rf(ctx, batchNumber, batchL2Data, caller, dbTx) } else { @@ -460,7 +500,6 @@ func (_m *stateMock) ProcessSequencerBatch(ctx context.Context, batchNumber uint } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64, []byte, state.CallerLabel, pgx.Tx) error); ok { r1 = rf(ctx, batchNumber, batchL2Data, caller, dbTx) } else { @@ -517,6 +556,10 @@ func (_m *stateMock) SetGenesis(ctx context.Context, block state.Block, genesis ret := _m.Called(ctx, block, genesis, dbTx) var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, state.Block, state.Genesis, pgx.Tx) ([]byte, error)); ok { + return rf(ctx, block, genesis, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, state.Block, state.Genesis, pgx.Tx) []byte); ok { r0 = rf(ctx, block, genesis, dbTx) } else { @@ -525,7 +568,6 @@ func (_m *stateMock) SetGenesis(ctx context.Context, block state.Block, genesis } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, state.Block, state.Genesis, pgx.Tx) error); ok { r1 = rf(ctx, block, genesis, dbTx) } else { diff --git a/synchronizer/synchronizer.go b/synchronizer/synchronizer.go index 78fe833749..95a61c7de3 100644 --- a/synchronizer/synchronizer.go +++ b/synchronizer/synchronizer.go @@ -1230,7 +1230,9 @@ func (s *ClientSynchronizer) reorgPool(dbTx pgx.Tx) error { // Add txs to the pool for _, tx := range txs { - err = s.pool.StoreTx(s.ctx, *tx, "") + // Insert tx in WIP status to avoid the sequencer to grab them before it gets restarted + // When the sequencer restarts, it will update the status to pending non-wip + err = s.pool.StoreTx(s.ctx, *tx, "", true) if err != nil { log.Errorf("error storing tx into the pool again. TxHash: %s. BatchNumber: %d, error: %v", tx.Hash().String(), batchNumber, err) return err diff --git a/synchronizer/synchronizer_test.go b/synchronizer/synchronizer_test.go index 8b4e9f823e..29d14f6d13 100644 --- a/synchronizer/synchronizer_test.go +++ b/synchronizer/synchronizer_test.go @@ -200,7 +200,7 @@ func TestTrustedStateReorg(t *testing.T) { Once() m.Pool. - On("StoreTx", ctx, *txs[0], ""). + On("StoreTx", ctx, *txs[0], "", true). Return(nil). Once()