Page MenuHomePhabricator

[Chronik] Add `TxId::new` and `TxId::hash`
ClosedPublic

Authored by tobias_ruck on Dec 19 2023, 23:13.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC3e4a4bb8d4e9: [Chronik] Add `TxId::new` and `TxId::hash`
Summary

Helpers when dealing with txids.

Depends on D15007.

Test Plan

cargo test -p bitcoinsuite-core

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK added inline comments.
chronik/bitcoinsuite-core/src/tx/txid.rs
51 ↗(On Diff #43675)

In D15012 I see that you are using TxId::from. Is this different?

chronik/bitcoinsuite-core/src/tx/txid.rs
51 ↗(On Diff #43675)

TxId::from and TxId::new are the same except new can be used in a const context, as in the doctest of new

This revision is now accepted and ready to land.Dec 20 2023, 11:55