Add a few more commands with known types.

This commit is contained in:
John C. Vernaleo 2013-07-12 12:39:12 -04:00
parent 796df5b105
commit a0dd367cd9
2 changed files with 4 additions and 3 deletions

View file

@ -676,7 +676,8 @@ func readResultCmd(cmd string, message []byte) (Reply, error) {
// For commands that return a single item, we get it with the // For commands that return a single item, we get it with the
// correct concrete type for free (but treat them separately // correct concrete type for free (but treat them separately
// for clarity). // for clarity).
case "getblockcount": case "getblockcount", "getbalance", "getblocknumber", "getgenerate",
"getconnetioncount", "getdifficulty", "gethashespersec":
err = json.Unmarshal(message, &result) err = json.Unmarshal(message, &result)
if err != nil { if err != nil {
err = fmt.Errorf("Error unmarshalling json reply: %v", err) err = fmt.Errorf("Error unmarshalling json reply: %v", err)

View file

@ -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/jsonfxns.go GetRaw 100.00% (6/6)
github.com/conformal/btcjson/jsonapi.go jsonWithArgs 100.00% (5/5) 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 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/jsonapi.go RpcCommand 66.67% (18/27)
github.com/conformal/btcjson --------------- 96.60% (426/441) github.com/conformal/btcjson --------------- 96.59% (425/440)