btcjson: add test for null params in searchrawtransactions

Closes PR #1476.
This commit is contained in:
Anirudha Bose 2020-09-18 00:10:32 +02:00 committed by John C. Vernaleo
parent e5521de652
commit f4024160f3

View file

@ -1201,6 +1201,26 @@ func TestChainSvrCmds(t *testing.T) {
FilterAddrs: &[]string{"1Address"}, FilterAddrs: &[]string{"1Address"},
}, },
}, },
{
name: "searchrawtransactions",
newCmd: func() (interface{}, error) {
return btcjson.NewCmd("searchrawtransactions", "1Address", 0, 5, 10, "null", true, []string{"1Address"})
},
staticCmd: func() interface{} {
return btcjson.NewSearchRawTransactionsCmd("1Address",
btcjson.Int(0), btcjson.Int(5), btcjson.Int(10), nil, btcjson.Bool(true), &[]string{"1Address"})
},
marshalled: `{"jsonrpc":"1.0","method":"searchrawtransactions","params":["1Address",0,5,10,null,true,["1Address"]],"id":1}`,
unmarshalled: &btcjson.SearchRawTransactionsCmd{
Address: "1Address",
Verbose: btcjson.Int(0),
Skip: btcjson.Int(5),
Count: btcjson.Int(10),
VinExtra: nil,
Reverse: btcjson.Bool(true),
FilterAddrs: &[]string{"1Address"},
},
},
{ {
name: "sendrawtransaction", name: "sendrawtransaction",
newCmd: func() (interface{}, error) { newCmd: func() (interface{}, error) {