HomePhabricator

[Chronik] Add `bitcoinsuite_core::Tx` et al., move away from `chronik_bridge…

Description

[Chronik] Add bitcoinsuite_core::Tx et al., move away from chronik_bridge::ffi::Tx et al.

Summary:
Using the ffi structs directly everywhere is a bit crude, e.g. the txid is [u8; 32] and not TxId.

The new structs are kept very close to those in ffi, with a few differences:

  1. Coin is optional, this is so we can eventually parse txs, which doesn't contain the coin.
  2. We have both Tx and TxMut, one to build txs and the other one as immutable struct for them. Tx auto-derefs to TxMut, so anything taking &self that we add to TxMut will also work for Tx.

Depends on D13530.

Test Plan: ninja check-crates && ninja check-functional

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

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

Details

Provenance
tobias_ruckAuthored on Apr 1 2023, 22:29
tobias_ruckPushed on Apr 3 2023, 10:57
Reviewer
Restricted Project
Differential Revision
D13531: [Chronik] Add `bitcoinsuite_core::Tx` et al., move away from `chronik_bridge::ffi::Tx` et al.
Parents
rABC94fd0bb6c1b8: [Chronik] Add `OP_RETURN` opcode and `Script::is_opreturn`
Branches
Unknown
Tags
Unknown