Tests and typos.

Increase test coverage.

Fix spelling and typos in a comment.

Minor update to todo in README.md
This commit is contained in:
John C. Vernaleo 2013-07-11 13:46:32 -04:00
parent e3c9ebd26f
commit 796df5b105
4 changed files with 9 additions and 5 deletions

View file

@ -58,7 +58,8 @@ $ go get github.com/conformal/btcjson
## TODO
- Add data structures for remaining commands.
- Increase test coverage to 100%
- Increase test coverage to 100%.
- Add https support.
## GPG Verification Key

View file

@ -35,8 +35,11 @@ var resulttests = []struct {
{"getinfo", []byte(`{"error":null,"result":null}`), false, false},
{"getinfo", []byte(`{"error":null,"id":1,"result":[{"a":"b"}]}`), false, false},
{"getblock", []byte(`{"error":null,"id":1,"result":[{"a":"b"}]}`), false, false},
{"getblock", []byte(`{"result":{"hash":"000000","confirmations":16007,"size":325648},"error":null,"id":1}`), false, true},
{"getrawtransaction", []byte(`{"error":null,"id":1,"result":[{"a":"b"}]}`), false, false},
{"getrawtransaction", []byte(`{"error":null,"id":1,"result":{"hex":"somejunk","version":1}}`), false, true},
{"decoderawtransaction", []byte(`{"error":null,"id":1,"result":[{"a":"b"}]}`), false, false},
{"decoderawtransaction", []byte(`{"error":null,"id":1,"result":{"Txid":"something"}}`), false, true},
{"getaddressesbyaccount", []byte(`{"error":null,"id":1,"result":[{"a":"b"}]}`), false, false},
{"getaddressesbyaccount", []byte(`{"error":null,"id":1,"result":["test"]}`), false, true},
}

View file

@ -674,8 +674,8 @@ func readResultCmd(cmd string, message []byte) (Reply, error) {
}
result.Result = res
// For commands that return a single item, we get it with the
// correct concrete type for free (but treat them seperately
// for clarity.
// correct concrete type for free (but treat them separately
// for clarity).
case "getblockcount":
err = json.Unmarshal(message, &result)
if err != nil {

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/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 85.00% (51/60)
github.com/conformal/btcjson/jsonapi.go readResultCmd 90.16% (55/61)
github.com/conformal/btcjson/jsonapi.go RpcCommand 66.67% (18/27)
github.com/conformal/btcjson --------------- 95.91% (422/440)
github.com/conformal/btcjson --------------- 96.60% (426/441)