From 49f4cf2390da503f36ee22c79c1cfe00803f163e Mon Sep 17 00:00:00 2001 From: Anirudha Bose Date: Fri, 18 Sep 2020 00:10:32 +0200 Subject: [PATCH] btcjson: add test for null params in searchrawtransactions Closes #1476. --- btcjson/chainsvrcmds_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/btcjson/chainsvrcmds_test.go b/btcjson/chainsvrcmds_test.go index bdf16bbee87..d44a2ece6f3 100644 --- a/btcjson/chainsvrcmds_test.go +++ b/btcjson/chainsvrcmds_test.go @@ -1201,6 +1201,26 @@ func TestChainSvrCmds(t *testing.T) { 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", newCmd: func() (interface{}, error) {