You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
5c34507 core_write: Rename calculate_fee to have_undo for clarity (fyquah)
8edf620 release-notes: Add release note about getblock verbosity level 3. (fyquah)
459104b rest: Add test for prevout fields in getblock (fyquah)
4330af6 rpc: Add test for level 3 verbosity getblock rpc call. (fyquah)
51dbc16 rpc: Add level 3 verbosity to getblock RPC call. (fyquah)
3cc9534 rpc: Replace boolean argument for tx details with enum class. (fyquah)
Pull request description:
Author of bitcoin#21245 expressed [time issues](bitcoin#21245 (comment)) in the original PR. Given that bitcoin#21245 has received a lot of review*, I have decided to open this new pull request with [modifications required to get ACK from luke-jr ](bitcoin#21245 (comment)) and a few nits of mine.
### Original PR description
> Display the prevout in transaction inputs when calling getblock level 3 verbosity. This PR affects the existing `/rest/block` API by adding a `prevout` fields to tx inputs. This is mentioned in the change to the release notes.
>
> I added some functional tests that
>
> * checks that the RPC call still works when TxUndo can't be found
>
> * Doesn't display the "value" or "scriptPubKey" of the previous output when at a lower verbosity level
>
>
> This "completes" the issue bitcoin#18771
### Possible improvements
* kiminuo@b0bf4f2 - I can include even this commit to this PR if deemed useful or I can leave it for a follow-up PR. See bitcoin#21245 (comment) for more context.
### Examples
Examples of the `getblock` output with various verbose levels. Note that `000000000000001f682b188971cc1a121546be4e9d5baf22934fdc7f538288d5` contains only 2 transactions.
#### Verbose level 0
```bash
./bitcoin-cli -testnet getblock 000000000000001f682b188971cc1a121546be4e9d5baf22934fdc7f538288d5 0
```
##### Verbose level 1
```bash
./bitcoin-cli -testnet getblock 000000000000001f682b188971cc1a121546be4e9d5baf22934fdc7f538288d5 1
```
##### Verbose level 2
```bash
./bitcoin-cli -testnet getblock 000000000000001f682b188971cc1a121546be4e9d5baf22934fdc7f538288d5 2
```
##### Verbose level 3
```bash
./bitcoin-cli -testnet getblock 000000000000001f682b188971cc1a121546be4e9d5baf22934fdc7f538288d5 3
```
#### REST
```bash
curl -H "content-type:text/plain;" http://127.0.0.1:18332/rest/block/000000000000001f682b188971cc1a121546be4e9d5baf22934fdc7f538288d5.json
```
<sub>* ... and my everyday obsessive checking of my email inbox whether the PR moves forward.</sub>
Edit laanwj: Removed at symbol from message, and large example output to prevent it from all ending up in the commit message.
ACKs for top commit:
0xB10C:
ACK 5c34507
meshcollider:
utACK 5c34507
theStack:
ACK 5c34507 👘
promag:
Concept ACK 5c34507
Tree-SHA512: bbff120d8fd76e617b723b102b0c606e0d8eb27f21c631d5f4cdab0892137c4bc7c65b1df144993405f942c91be47a26e80480102af55bff22621c19f518aea3
"\nIf verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.\n"
933
940
"If verbosity is 1, returns an Object with information about block <hash>.\n"
934
-
"If verbosity is 2, returns an Object with information about block <hash> and information about each transaction. \n",
941
+
"If verbosity is 2, returns an Object with information about block <hash> and information about each transaction.\n"
942
+
"If verbosity is 3, returns an Object with information about block <hash> and information about each transaction, including prevout information for inputs (only for unpruned blocks in the current best chain).\n",
935
943
{
936
944
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
937
945
{"verbosity|verbose", RPCArg::Type::NUM, RPCArg::Default{1}, "0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data"},
0 commit comments