From 941ec8402d009d90cdcbc467eaa3849a51d8366b Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Fri, 25 Dec 2020 16:18:34 -0600 Subject: [PATCH] rpc/jsonrpc/types: Remove v1 getcfilter{,header}. This removes the deprecated types for the v1 getcfilter and getcfilterheader methods along with their tests. This is part of the overall removal of deprecated v1 cfilters. --- rpc/jsonrpc/types/chainsvrcmds.go | 32 -------------------------- rpc/jsonrpc/types/chainsvrcmds_test.go | 28 ---------------------- 2 files changed, 60 deletions(-) diff --git a/rpc/jsonrpc/types/chainsvrcmds.go b/rpc/jsonrpc/types/chainsvrcmds.go index 249f1eae..0491d60e 100644 --- a/rpc/jsonrpc/types/chainsvrcmds.go +++ b/rpc/jsonrpc/types/chainsvrcmds.go @@ -460,36 +460,6 @@ func NewGetBlockSubsidyCmd(height int64, voters uint16) *GetBlockSubsidyCmd { } } -// GetCFilterCmd defines the getcfilter JSON-RPC command. -type GetCFilterCmd struct { - Hash string - FilterType string -} - -// NewGetCFilterCmd returns a new instance which can be used to issue a -// getcfilter JSON-RPC command. -func NewGetCFilterCmd(hash string, filterType string) *GetCFilterCmd { - return &GetCFilterCmd{ - Hash: hash, - FilterType: filterType, - } -} - -// GetCFilterHeaderCmd defines the getcfilterheader JSON-RPC command. -type GetCFilterHeaderCmd struct { - Hash string - FilterType string -} - -// NewGetCFilterHeaderCmd returns a new instance which can be used to issue a -// getcfilterheader JSON-RPC command. -func NewGetCFilterHeaderCmd(hash string, filterType string) *GetCFilterHeaderCmd { - return &GetCFilterHeaderCmd{ - Hash: hash, - FilterType: filterType, - } -} - // GetCFilterV2Cmd defines the getcfilterv2 JSON-RPC command. type GetCFilterV2Cmd struct { BlockHash string @@ -1180,8 +1150,6 @@ func init() { dcrjson.MustRegister(Method("getblockhash"), (*GetBlockHashCmd)(nil), flags) dcrjson.MustRegister(Method("getblockheader"), (*GetBlockHeaderCmd)(nil), flags) dcrjson.MustRegister(Method("getblocksubsidy"), (*GetBlockSubsidyCmd)(nil), flags) - dcrjson.MustRegister(Method("getcfilter"), (*GetCFilterCmd)(nil), flags) - dcrjson.MustRegister(Method("getcfilterheader"), (*GetCFilterHeaderCmd)(nil), flags) dcrjson.MustRegister(Method("getcfilterv2"), (*GetCFilterV2Cmd)(nil), flags) dcrjson.MustRegister(Method("getchaintips"), (*GetChainTipsCmd)(nil), flags) dcrjson.MustRegister(Method("getcoinsupply"), (*GetCoinSupplyCmd)(nil), flags) diff --git a/rpc/jsonrpc/types/chainsvrcmds_test.go b/rpc/jsonrpc/types/chainsvrcmds_test.go index eb709f2f..fe85b142 100644 --- a/rpc/jsonrpc/types/chainsvrcmds_test.go +++ b/rpc/jsonrpc/types/chainsvrcmds_test.go @@ -341,34 +341,6 @@ func TestChainSvrCmds(t *testing.T) { Voters: 256, }, }, - { - name: "getcfilter", - newCmd: func() (interface{}, error) { - return dcrjson.NewCmd(Method("getcfilter"), "123", "extended") - }, - staticCmd: func() interface{} { - return NewGetCFilterCmd("123", "extended") - }, - marshalled: `{"jsonrpc":"1.0","method":"getcfilter","params":["123","extended"],"id":1}`, - unmarshalled: &GetCFilterCmd{ - Hash: "123", - FilterType: "extended", - }, - }, - { - name: "getcfilterheader", - newCmd: func() (interface{}, error) { - return dcrjson.NewCmd(Method("getcfilterheader"), "123", "extended") - }, - staticCmd: func() interface{} { - return NewGetCFilterHeaderCmd("123", "extended") - }, - marshalled: `{"jsonrpc":"1.0","method":"getcfilterheader","params":["123","extended"],"id":1}`, - unmarshalled: &GetCFilterHeaderCmd{ - Hash: "123", - FilterType: "extended", - }, - }, { name: "getcfilterv2", newCmd: func() (interface{}, error) {