HomePhabricator

[Chronik] Add `VerifyContext`, `verify` and `TokenTx` to bitcoinsuite-slp

Description

[Chronik] Add VerifyContext, verify and TokenTx to bitcoinsuite-slp

Summary:

  1. Add TokenTx and TokenTxEntry to represent a verified tx.
  2. Add VerifyContext with a verify method to verify a ColoredTx. The context bundles all the data required to verify txs.
  3. Add a few common helper consts and functions to simplify tests.
  4. Add a boatload of test_verify_* tests to test all kinds of scenarios.

There is one panic in VerifyContext (instead of returning a Result) to simplify the code; it indicates the context has been used incorrectly, which is usually a good application for panics.

Test Plan: cargo test -p bitcoinsuite-slp

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

Subscribers: bytesofman

Differential Revision: https://reviews.bitcoinabc.org/D15046

Details

Provenance
tobias_ruckAuthored on Dec 28 2023, 17:46
tobias_ruckPushed on Jan 4 2024, 21:24
Reviewer
Restricted Project
Differential Revision
D15046: [Chronik] Add `VerifyContext`, `verify` and `TokenTx` to bitcoinsuite-slp
Parents
rABC2888898e7a21: [chronik] Don't sync after each generate in chronik_avalanche
Branches
Unknown
Tags
Unknown