Page MenuHomePhabricator

[ecash-lib] Add a Tx deserialization method
ClosedPublic

Authored by Fabien on Jul 21 2025, 13:16.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABCf4de7e80c68c: [ecash-lib] Add a Tx deserialization method
Summary

This makes it possible to build a transaction from the raw hex.

Test Plan
npm test

Diff Detail

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

Event Timeline

Fabien requested review of this revision.Jul 21 2025, 13:16
Fabien updated this revision to Diff 54929.

Update the changelog in the readme

bytesofman added a subscriber: bytesofman.
bytesofman added inline comments.
modules/ecash-lib/package.json
3 ↗(On Diff #54929)

keep min mind that when the stacked diff is landed, we will skip publishing 4.1.0 and publish 4.2.0

imo this is fine, just worth noting.

modules/ecash-lib/src/tx.test.ts
127 ↗(On Diff #54929)

it is nice to have a generic test here, but would be helpful to see this happen with a real rawtx as well, something that's been broadcast and is on the blockchain

174 ↗(On Diff #54929)

not sure why we need this Buffer.from(<bytes>).toString('hex') -- can we not use ecash-lib's toHex?

227 ↗(On Diff #54929)

if it's worth testing this behavior, we should add the specific error msg we expect from each of these instead of a generic "we expect it to throw" test

This revision now requires changes to proceed.Jul 21 2025, 16:25
Fabien marked 3 inline comments as done.Jul 21 2025, 21:03
Fabien added inline comments.
modules/ecash-lib/package.json
3 ↗(On Diff #54929)

If the next diff is accepted, yes. I don't think I need to assume it would be nor hold on releasing this version which is useful on its own.

This revision is now accepted and ready to land.Jul 22 2025, 10:28
This revision was automatically updated to reflect the committed changes.