All tests pass
This commit is contained in:
parent
57cb8e4b11
commit
a310aa6e74
3 changed files with 7 additions and 8 deletions
|
@ -151,7 +151,7 @@ func TestMethodUsageText(t *testing.T) {
|
|||
{
|
||||
name: "getblock",
|
||||
method: "getblock",
|
||||
expected: `getblock "hash" (verbosity=1)`,
|
||||
expected: `getblock "hash" (verbosity=0)`,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ func ExampleMarshalCmd() {
|
|||
// convenience function for creating a pointer out of a primitive for
|
||||
// optional parameters.
|
||||
blockHash := "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
|
||||
gbCmd := btcjson.NewGetBlockCmd(blockHash, btcjson.Int(1))
|
||||
gbCmd := btcjson.NewGetBlockCmd(blockHash, btcjson.Int(0))
|
||||
|
||||
// Marshal the command to the format suitable for sending to the RPC
|
||||
// server. Typically the client would increment the id here which is
|
||||
|
@ -38,7 +38,7 @@ func ExampleMarshalCmd() {
|
|||
fmt.Printf("%s\n", marshalledBytes)
|
||||
|
||||
// Output:
|
||||
// {"jsonrpc":"1.0","method":"getblock","params":["000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",1],"id":1}
|
||||
// {"jsonrpc":"1.0","method":"getblock","params":["000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",0],"id":1}
|
||||
}
|
||||
|
||||
// This example demonstrates how to unmarshal a JSON-RPC request and then
|
||||
|
@ -46,7 +46,7 @@ func ExampleMarshalCmd() {
|
|||
func ExampleUnmarshalCmd() {
|
||||
// Ordinarily this would be read from the wire, but for this example,
|
||||
// it is hard coded here for clarity.
|
||||
data := []byte(`{"jsonrpc":"1.0","method":"getblock","params":["000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",1],"id":1}`)
|
||||
data := []byte(`{"jsonrpc":"1.0","method":"getblock","params":["000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",0],"id":1}`)
|
||||
|
||||
// Unmarshal the raw bytes from the wire into a JSON-RPC request.
|
||||
var request btcjson.Request
|
||||
|
|
|
@ -162,10 +162,9 @@ var helpDescsEnUS = map[string]string{
|
|||
// GetBlockCmd help.
|
||||
"getblock--synopsis": "Returns information about a block given its hash.",
|
||||
"getblock-hash": "The hash of the block",
|
||||
"getblock-verbose": "Specifies the block is returned as a JSON object instead of hex-encoded string",
|
||||
"getblock-verbosetx": "Specifies that each transaction is returned as a JSON object and only applies if the verbose flag is true (btcd extension)",
|
||||
"getblock--condition0": "verbose=false",
|
||||
"getblock--condition1": "verbose=true",
|
||||
"getblock-verbosity": "Specifies whether the block data should be returned as a hex-encoded string (0), as parsed data with a slice of TXIDs (1), or as parsed data with parsed transaction data (2) ",
|
||||
"getblock--condition0": "verbosity=0",
|
||||
"getblock--condition1": "verbosity=1",
|
||||
"getblock--result0": "Hex-encoded bytes of the serialized block",
|
||||
|
||||
// GetBlockChainInfoCmd help.
|
||||
|
|
Loading…
Add table
Reference in a new issue