Page MenuHomePhabricator

[ecash-lib] Add txid computation from the Tx object
ClosedPublic

Authored by Fabien on Jul 21 2025, 14:06.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC59d8b9fd610e: [ecash-lib] Add txid computation from the Tx object
Summary

In order to efficiently use the txid subscription from chronik we need to compute this txid. Doing so makes it possible to get the tx added to mempool event from chronik after it is broadcast.

Depends on D18393.

Test Plan
npm test

Event Timeline

Fabien requested review of this revision.Jul 21 2025, 14:06
Fabien updated this revision to Diff 54931.

Update the version and the changelog in the readme

bytesofman added a subscriber: bytesofman.
bytesofman added inline comments.
modules/ecash-lib/src/tx.test.ts
247–251

this kind of conditional in the test suite can be useful when writing the tests, where maybe we want to see some unexpected errors in the logs and iterate toward better tests -- but is not really doing anything otherwise, should not stay in the final diff

261–265

same

274–278

same

modules/ecash-lib/src/tx.ts
166

can this be referenced somewhere, e.g. is this defined in the node src/?

This revision now requires changes to proceed.Jul 22 2025, 10:32
modules/ecash-lib/src/tx.test.ts
247–251

that's a debug leftover, good catch

Point the txid.h for a reference implementation, remove debug leftover.

looks good tho CI could take some time

This revision is now accepted and ready to land.Jul 22 2025, 11:43