Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

Implement a wrapper for getblock with verbosity value 2#329

Open
danielost wants to merge 1 commit into
rust-bitcoin:masterfrom
danielost:feature/getblock-verbosity-2
Open

Implement a wrapper for getblock with verbosity value 2#329
danielost wants to merge 1 commit into
rust-bitcoin:masterfrom
danielost:feature/getblock-verbosity-2

Conversation

@danielost

Copy link
Copy Markdown

Changes

  • Add get_block_txs method that calls getblock with verbosity value 2
  • Add GetBlockTxResult struct to json
  • Utilize composition in GetBlockResult and GetBlockTxResult to get rid of duplicate fields

@danielost danielost changed the title Implement getblock with verbosity value 2 Implement a wrapper for getblock with verbosity value 2 Feb 13, 2024
@0xB10C

0xB10C commented Apr 18, 2024

Copy link
Copy Markdown
Contributor

I was excited to see this when looking for a way to call getblock <hash> 2 to get the transaction fee of transactions it that block. However, the proposed implementation only deserializes the the hex field of each transaction. This is essentially the same as calling get_block_info() (if information about e.g. the next block or the number of confirmations are wanted) and get_block() for the raw transactions without any metadata.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants