From f9b3331f05f4a37869f7789e680fa2374244eeaa Mon Sep 17 00:00:00 2001 From: luketheart Date: Mon, 19 Aug 2024 19:22:49 +0800 Subject: [PATCH] fix: eth_pendingTransactions --- client/tendermint.go | 7 +++++-- store/pruning/mock/db_mock.go | 6 ++++++ testutil/mock/tendermint_tm_db_DB.go | 6 ++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/client/tendermint.go b/client/tendermint.go index f616e196bb..b51aec13bc 100644 --- a/client/tendermint.go +++ b/client/tendermint.go @@ -14,11 +14,15 @@ type TendermintRPC interface { Validators(ctx context.Context, height *int64, page, perPage *int) (*coretypes.ResultValidators, error) Status(context.Context) (*coretypes.ResultStatus, error) + ConsensusParams(ctx context.Context, height *int64) (*coretypes.ResultConsensusParams, error) + Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) BlockByHash(ctx context.Context, hash []byte) (*coretypes.ResultBlock, error) BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error) BlockchainInfo(ctx context.Context, minHeight, maxHeight int64) (*coretypes.ResultBlockchainInfo, error) + Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error) + Tx(ctx context.Context, hash []byte, prove bool) (*coretypes.ResultTx, error) TxSearch( ctx context.Context, @@ -27,6 +31,5 @@ type TendermintRPC interface { page, perPage *int, orderBy string, ) (*coretypes.ResultTxSearch, error) - - ConsensusParams(ctx context.Context, height *int64) (*coretypes.ResultConsensusParams, error) + UnconfirmedTxs(ctx context.Context, limit *int) (*coretypes.ResultUnconfirmedTxs, error) } diff --git a/store/pruning/mock/db_mock.go b/store/pruning/mock/db_mock.go index 29d554834a..1ac06999a0 100644 --- a/store/pruning/mock/db_mock.go +++ b/store/pruning/mock/db_mock.go @@ -143,6 +143,12 @@ func (m *MockDB) Print() error { return ret0 } +func (m *MockDB)ForceCompact(start, limit []byte) error {return nil} + +func (m *MockDB)NewBatchWithSize(int) db.Batch { + return m.NewBatch() +} + // Print indicates an expected call of Print. func (mr *MockDBMockRecorder) Print() *gomock.Call { mr.mock.ctrl.T.Helper() diff --git a/testutil/mock/tendermint_tm_db_DB.go b/testutil/mock/tendermint_tm_db_DB.go index 2e6b67d8ae..85dae07008 100644 --- a/testutil/mock/tendermint_tm_db_DB.go +++ b/testutil/mock/tendermint_tm_db_DB.go @@ -100,6 +100,12 @@ func (m *MockDB) Has(arg0 []byte) (bool, error) { return ret0, ret1 } +func (m *MockDB)ForceCompact(start, limit []byte) error {return nil} + +func (m *MockDB)NewBatchWithSize(int) db.Batch { + return m.NewBatch() +} + // Has indicates an expected call of Has. func (mr *MockDBMockRecorder) Has(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper()