From ebc4c17162231a9097732f0a68ff87b86f95eefb Mon Sep 17 00:00:00 2001 From: "Owain G. Ainsworth" Date: Fri, 25 Oct 2013 18:36:27 +0100 Subject: [PATCH] Add basic test for getbestblockhash. And move the getblock/getblockcount so they are in order. --- jsoncmd_test.go | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/jsoncmd_test.go b/jsoncmd_test.go index 41ed52a9e..0e7d9c634 100644 --- a/jsoncmd_test.go +++ b/jsoncmd_test.go @@ -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) {