From a0dd367cd9c19fee617a7bfe75199317f6c12bf5 Mon Sep 17 00:00:00 2001 From: "John C. Vernaleo" Date: Fri, 12 Jul 2013 12:39:12 -0400 Subject: [PATCH] Add a few more commands with known types. --- jsonapi.go | 3 ++- test_coverage.txt | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/jsonapi.go b/jsonapi.go index e07d5aa0..aef9321f 100644 --- a/jsonapi.go +++ b/jsonapi.go @@ -676,7 +676,8 @@ func readResultCmd(cmd string, message []byte) (Reply, error) { // For commands that return a single item, we get it with the // correct concrete type for free (but treat them separately // for clarity). - case "getblockcount": + case "getblockcount", "getbalance", "getblocknumber", "getgenerate", + "getconnetioncount", "getdifficulty", "gethashespersec": err = json.Unmarshal(message, &result) if err != nil { err = fmt.Errorf("Error unmarshalling json reply: %v", err) diff --git a/test_coverage.txt b/test_coverage.txt index 4c58d3ec..642e5261 100644 --- a/test_coverage.txt +++ b/test_coverage.txt @@ -6,7 +6,7 @@ github.com/conformal/btcjson/jsonfxns.go MarshallAndSend 100.00% (7/7) github.com/conformal/btcjson/jsonfxns.go GetRaw 100.00% (6/6) github.com/conformal/btcjson/jsonapi.go jsonWithArgs 100.00% (5/5) github.com/conformal/btcjson/jsonapi.go IsValidIdType 100.00% (3/3) -github.com/conformal/btcjson/jsonapi.go readResultCmd 90.16% (55/61) +github.com/conformal/btcjson/jsonapi.go readResultCmd 90.00% (54/60) github.com/conformal/btcjson/jsonapi.go RpcCommand 66.67% (18/27) -github.com/conformal/btcjson --------------- 96.60% (426/441) +github.com/conformal/btcjson --------------- 96.59% (425/440)