[NOD-408] Remove unimplemented redundant RPC command GetTxOutProof (#461)

This commit is contained in:
Dan Aharoni 2019-11-11 12:53:56 +02:00 committed by Svarog
parent bb75ea5020
commit 9dd025d4da
2 changed files with 0 additions and 76 deletions

View File

@ -539,24 +539,6 @@ func NewGetTxOutCmd(txHash string, vout uint32, includeMempool *bool) *GetTxOutC
}
}
// GetTxOutProofCmd defines the getTxOutProof JSON-RPC command.
type GetTxOutProofCmd struct {
TxIDs []string
BlockHash *string
}
// NewGetTxOutProofCmd returns a new instance which can be used to issue a
// getTxOutProof JSON-RPC command.
//
// The parameters which are pointers indicate they are optional. Passing nil
// for optional parameters will use the default value.
func NewGetTxOutProofCmd(txIDs []string, blockHash *string) *GetTxOutProofCmd {
return &GetTxOutProofCmd{
TxIDs: txIDs,
BlockHash: blockHash,
}
}
// GetTxOutSetInfoCmd defines the getTxOutSetInfo JSON-RPC command.
type GetTxOutSetInfoCmd struct{}
@ -766,19 +748,6 @@ func NewVerifyMessageCmd(address, signature, message string) *VerifyMessageCmd {
}
}
// VerifyTxOutProofCmd defines the verifyTxOutProof JSON-RPC command.
type VerifyTxOutProofCmd struct {
Proof string
}
// NewVerifyTxOutProofCmd returns a new instance which can be used to issue a
// verifyTxOutProof JSON-RPC command.
func NewVerifyTxOutProofCmd(proof string) *VerifyTxOutProofCmd {
return &VerifyTxOutProofCmd{
Proof: proof,
}
}
func init() {
// No special flags for commands in this file.
flags := UsageFlag(0)
@ -816,7 +785,6 @@ func init() {
MustRegisterCmd("getRawTransaction", (*GetRawTransactionCmd)(nil), flags)
MustRegisterCmd("getSubnetwork", (*GetSubnetworkCmd)(nil), flags)
MustRegisterCmd("getTxOut", (*GetTxOutCmd)(nil), flags)
MustRegisterCmd("getTxOutProof", (*GetTxOutProofCmd)(nil), flags)
MustRegisterCmd("getTxOutSetInfo", (*GetTxOutSetInfoCmd)(nil), flags)
MustRegisterCmd("help", (*HelpCmd)(nil), flags)
MustRegisterCmd("invalidateBlock", (*InvalidateBlockCmd)(nil), flags)
@ -832,5 +800,4 @@ func init() {
MustRegisterCmd("uptime", (*UptimeCmd)(nil), flags)
MustRegisterCmd("validateAddress", (*ValidateAddressCmd)(nil), flags)
MustRegisterCmd("verifyMessage", (*VerifyMessageCmd)(nil), flags)
MustRegisterCmd("verifyTxOutProof", (*VerifyTxOutProofCmd)(nil), flags)
}

View File

@ -657,36 +657,6 @@ func TestDAGSvrCmds(t *testing.T) {
IncludeMempool: btcjson.Bool(true),
},
},
{
name: "getTxOutProof",
newCmd: func() (interface{}, error) {
return btcjson.NewCmd("getTxOutProof", []string{"123", "456"})
},
staticCmd: func() interface{} {
return btcjson.NewGetTxOutProofCmd([]string{"123", "456"}, nil)
},
marshalled: `{"jsonrpc":"1.0","method":"getTxOutProof","params":[["123","456"]],"id":1}`,
unmarshalled: &btcjson.GetTxOutProofCmd{
TxIDs: []string{"123", "456"},
},
},
{
name: "getTxOutProof optional",
newCmd: func() (interface{}, error) {
return btcjson.NewCmd("getTxOutProof", []string{"123", "456"},
btcjson.String("000000000000034a7dedef4a161fa058a2d67a173a90155f3a2fe6fc132e0ebf"))
},
staticCmd: func() interface{} {
return btcjson.NewGetTxOutProofCmd([]string{"123", "456"},
btcjson.String("000000000000034a7dedef4a161fa058a2d67a173a90155f3a2fe6fc132e0ebf"))
},
marshalled: `{"jsonrpc":"1.0","method":"getTxOutProof","params":[["123","456"],` +
`"000000000000034a7dedef4a161fa058a2d67a173a90155f3a2fe6fc132e0ebf"],"id":1}`,
unmarshalled: &btcjson.GetTxOutProofCmd{
TxIDs: []string{"123", "456"},
BlockHash: btcjson.String("000000000000034a7dedef4a161fa058a2d67a173a90155f3a2fe6fc132e0ebf"),
},
},
{
name: "getTxOutSetInfo",
newCmd: func() (interface{}, error) {
@ -1063,19 +1033,6 @@ func TestDAGSvrCmds(t *testing.T) {
Message: "test",
},
},
{
name: "verifyTxOutProof",
newCmd: func() (interface{}, error) {
return btcjson.NewCmd("verifyTxOutProof", "test")
},
staticCmd: func() interface{} {
return btcjson.NewVerifyTxOutProofCmd("test")
},
marshalled: `{"jsonrpc":"1.0","method":"verifyTxOutProof","params":["test"],"id":1}`,
unmarshalled: &btcjson.VerifyTxOutProofCmd{
Proof: "test",
},
},
}
t.Logf("Running %d tests", len(tests))