From a310aa6e7464e9624eb8078260e248c28c8f67bb Mon Sep 17 00:00:00 2001 From: jalavosus Date: Thu, 5 Mar 2020 06:35:34 -0500 Subject: [PATCH] All tests pass --- btcjson/cmdinfo_test.go | 2 +- btcjson/example_test.go | 6 +++--- rpcserverhelp.go | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/btcjson/cmdinfo_test.go b/btcjson/cmdinfo_test.go index 61a693e4..471fccfc 100644 --- a/btcjson/cmdinfo_test.go +++ b/btcjson/cmdinfo_test.go @@ -151,7 +151,7 @@ func TestMethodUsageText(t *testing.T) { { name: "getblock", method: "getblock", - expected: `getblock "hash" (verbosity=1)`, + expected: `getblock "hash" (verbosity=0)`, }, } diff --git a/btcjson/example_test.go b/btcjson/example_test.go index cbca495b..73dd8040 100644 --- a/btcjson/example_test.go +++ b/btcjson/example_test.go @@ -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 diff --git a/rpcserverhelp.go b/rpcserverhelp.go index cc6935b5..cee24075 100644 --- a/rpcserverhelp.go +++ b/rpcserverhelp.go @@ -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.