rpcserver: Remove unused Filterer interface.
This removes the Filterer interface and related test infrastructure since it is no longer used as of the removal of the v1 cfilter code.
This commit is contained in:
parent
fb9d839148
commit
d1888af4e5
@ -530,24 +530,6 @@ type BlockTemplater interface {
|
||||
UpdateBlockTime(header *wire.BlockHeader) error
|
||||
}
|
||||
|
||||
// Filterer provides an interface for retrieving a block's committed filter or
|
||||
// committed filter header.
|
||||
//
|
||||
// The interface contract requires that all of these methods are safe for
|
||||
// concurrent access.
|
||||
//
|
||||
// Deprecated: This will be removed in the next major version. Use FiltererV2
|
||||
// instead.
|
||||
type Filterer interface {
|
||||
// FilterByBlockHash returns the serialized contents of a block's regular or
|
||||
// extended committed filter.
|
||||
FilterByBlockHash(h *chainhash.Hash, filterType wire.FilterType) ([]byte, error)
|
||||
|
||||
// FilterHeaderByBlockHash returns the serialized contents of a block's regular
|
||||
// or extended committed filter header.
|
||||
FilterHeaderByBlockHash(h *chainhash.Hash, filterType wire.FilterType) ([]byte, error)
|
||||
}
|
||||
|
||||
// FiltererV2 provides an interface for retrieving a block's version 2 GCS
|
||||
// filter.
|
||||
//
|
||||
|
||||
@ -6136,9 +6136,6 @@ type Config struct {
|
||||
// LogManager defines the log manager for the RPC server to use.
|
||||
LogManager LogManager
|
||||
|
||||
// Filterer defines the filterer for the RPC server to use.
|
||||
Filterer Filterer
|
||||
|
||||
// FiltererV2 defines the V2 filterer for the RPC server to use.
|
||||
FiltererV2 FiltererV2
|
||||
}
|
||||
|
||||
@ -923,26 +923,6 @@ func (s *testSanityChecker) CheckBlockSanity(block *dcrutil.Block) error {
|
||||
return s.checkBlockSanityErr
|
||||
}
|
||||
|
||||
// testFilterer provides a mock filterer by implementing the Filterer interface.
|
||||
type testFilterer struct {
|
||||
filterByBlockHash []byte
|
||||
filterByBlockHashErr error
|
||||
filterHeaderByBlockHash []byte
|
||||
filterHeaderByBlockHashErr error
|
||||
}
|
||||
|
||||
// FilterByBlockHash returns a mocked regular or extended committed filter for
|
||||
// the given block hash.
|
||||
func (f *testFilterer) FilterByBlockHash(h *chainhash.Hash, filterType wire.FilterType) ([]byte, error) {
|
||||
return f.filterByBlockHash, f.filterByBlockHashErr
|
||||
}
|
||||
|
||||
// FilterHeaderByBlockHash returns a mocked regular or extended committed filter
|
||||
// header for the given block hash.
|
||||
func (f *testFilterer) FilterHeaderByBlockHash(h *chainhash.Hash, filterType wire.FilterType) ([]byte, error) {
|
||||
return f.filterHeaderByBlockHash, f.filterHeaderByBlockHashErr
|
||||
}
|
||||
|
||||
// testFiltererV2 provides a mock V2 filterer by implementing the FiltererV2
|
||||
// interface.
|
||||
type testFiltererV2 struct {
|
||||
@ -1315,7 +1295,6 @@ type rpcTest struct {
|
||||
mockConnManager *testConnManager
|
||||
mockClock *testClock
|
||||
mockLogManager *testLogManager
|
||||
mockFilterer *testFilterer
|
||||
mockFiltererV2 *testFiltererV2
|
||||
mockTxMempooler *testTxMempooler
|
||||
mockMiningAddrs []dcrutil.Address
|
||||
@ -7758,9 +7737,6 @@ func testRPCServerHandler(t *testing.T, tests []rpcTest) {
|
||||
if test.mockSanityChecker != nil {
|
||||
rpcserverConfig.SanityChecker = test.mockSanityChecker
|
||||
}
|
||||
if test.mockFilterer != nil {
|
||||
rpcserverConfig.Filterer = test.mockFilterer
|
||||
}
|
||||
if test.mockFiltererV2 != nil {
|
||||
rpcserverConfig.FiltererV2 = test.mockFiltererV2
|
||||
}
|
||||
|
||||
@ -3897,9 +3897,6 @@ func newServer(ctx context.Context, listenAddrs []string, db database.DB, chainP
|
||||
if s.addrIndex != nil {
|
||||
rpcsConfig.AddrIndexer = s.addrIndex
|
||||
}
|
||||
if s.cfIndex != nil {
|
||||
rpcsConfig.Filterer = s.cfIndex
|
||||
}
|
||||
|
||||
s.rpcServer, err = rpcserver.New(&rpcsConfig)
|
||||
if err != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user