Skip to content

feat(zcash): add blocks list and block detail pages - #408

Open
MatiasOS wants to merge 3 commits into
issue-398-zcash-dashboardfrom
issue-398-zcash-blocks
Open

MatiasOS wants to merge 3 commits into
issue-398-zcash-dashboardfrom
issue-398-zcash-blocks

Conversation

@MatiasOS

Copy link
Copy Markdown
Member

Description

Adds the Zcash blocks list (/zec/blocks) and block detail (/zec/block/:filter) pages, plus their tzec equivalents.

  • Blocks list: costs one getblock call per block. Rows fill in as each call returns, so the page stays usable on rate-limited gateways. Pagination uses ?fromBlock, the same as Bitcoin.
  • Block page: everything comes from a single getblock(height, 2) call. It shows:
    • Zcash-specific header fields: the hex nonce, the Equihash solution, block commitments, the final Sapling and Orchard roots, and note commitment tree sizes (including Ironwood).
    • Coinbase outputs.
    • The number of shielded transactions in each pool.
    • The value pools after this block.

Related Issue

Part of #398. Stacked on #407.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Performance improvement
  • Other (please describe):

Changes Made

  • ZcashBlocksPage, ZcashBlockPage and ZcashBlockDisplay.
  • ZcashValuePools now takes the pools directly, so the block page can reuse it.
  • Routes and lazy exports for zec|tzec/blocks and zec|tzec/block/:filter.
  • zcash locale strings and tooltips.zcash.block in all 5 locales.
  • Styles for the pool chips, coinbase outputs and the Equihash solution row.
  • A hermetic e2e spec at e2e/tests/shared/mocked/zcash-blocks.spec.ts.

Screenshots (if applicable)

Checked locally against mocked RPC data at desktop width and at 400px.

Checklist

  • I have run npm run format:fix and npm run lint:fix
  • I have run npm run typecheck with no errors
  • I have run tests with npm run test:run
  • I have tested my changes locally
  • I have updated documentation if needed
  • My code follows the project's architecture patterns

Additional Notes

  • There are no per-block fee totals. Zebra doesn't return transparent input values, so a block total would need a lookup for every input. Per-transaction fees are handled on the transaction page, in the next PR.
  • The coinbase address, transaction and address links point to pages that later PRs in the stack add.
  • In dev, React StrictMode can send the block request twice. The e2e spec therefore checks which blocks are requested rather than how many requests are made.
  • Tests:
    • npm run test:run: 150 passing.
    • Hermetic Zcash e2e specs (dashboard and blocks): 4 passing.

Block details come from a single getblock call and surface Zcash header fields (hex nonce, Equihash solution, commitment roots, note commitment tree sizes), coinbase outputs, per-pool shielded transaction counts and value pools after the block.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant