Add basic test for getbestblockhash.

And move the getblock/getblockcount so they are in order.
This commit is contained in:
Owain G. Ainsworth 2013-10-25 18:36:27 +01:00
parent d1ac7b9384
commit ebc4c17162

View file

@ -276,20 +276,11 @@ var jsoncmdtests = []struct {
},
},
{
name: "basic ping",
name: "basic getbestblockhash",
f: func() (Cmd, error) {
return NewPingCmd(float64(1))
return NewGetBestBlockHashCmd(float64(1))
},
result: &PingCmd{
id: float64(1),
},
},
{
name: "basic getblockcount",
f: func() (Cmd, error) {
return NewGetBlockCountCmd(float64(1))
},
result: &GetBlockCountCmd{
result: &GetBestBlockHashCmd{
id: float64(1),
},
},
@ -304,6 +295,24 @@ var jsoncmdtests = []struct {
Hash: "somehash",
},
},
{
name: "basic getblockcount",
f: func() (Cmd, error) {
return NewGetBlockCountCmd(float64(1))
},
result: &GetBlockCountCmd{
id: float64(1),
},
},
{
name: "basic ping",
f: func() (Cmd, error) {
return NewPingCmd(float64(1))
},
result: &PingCmd{
id: float64(1),
},
},
}
func TestCmds(t *testing.T) {