Page MenuHomePhabricator

[cashtab-faucet, ecash-wallet, ecash-lib] Implement ecash-wallet in cashtab-faucet and make requisite mvp improvements
ClosedPublic

Authored by bytesofman on Jul 19 2025, 04:35.

Details

Summary

Implement ecash-wallet in cashtab-faucet

Remove all code obsoleted by ecash-wallet

Test Plan

npm test

Diff Detail

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

Event Timeline

lint, update CI, update dockerfile, update getWallet script, remove now-unused dep

bytesofman added inline comments.
apps/cashtab-faucet/src/routes.test.ts
86 ↗(On Diff #54905)

the only difference between this tx and the previous one is the order of inputs, changing the txid

inputs and outputs are otherwise identical, can verify by inspecting in electrumabc

this is true for all the token rawtx mocks that are changed

apps/cashtab-faucet/test/vectors.ts
1053 ↗(On Diff #54905)

we lose this test because, as the comments here say -- there is actually enough XEC to send this tx in this test. Our bootleg wallet in cashtab-faucet was not smart enough to figure this out. But ecash-wallet is.

So, this no longer throws an error.

cashtab-faucet.Dockerfile
81 ↗(On Diff #54905)

need to add new dep to prod dockerfile

contrib/teamcity/build-configurations.yml
825 ↗(On Diff #54905)

we should run the cashtab-faucet tests whenever ecash-wallet changes, so we can be sure we haven't changed anything unexpected in the behavior of ecash-wallet

modules/ecash-lib/src/consts.ts
11 ↗(On Diff #54905)

we should keep this somewhere

realistically I do not think we should ever be using 899 in ecash-lib

modules/ecash-wallet/README.md
26 ↗(On Diff #54905)

we haven't published 1.0.0 yet, so add these changes here, it will publish as 1.0.0 when this lands

imo these changes are all useful practical improvements that are important for any dev to actually use ecash-wallet

modules/ecash-wallet/src/wallet.test.ts
33 ↗(On Diff #54905)

we stop making Wallet the default export

It's always confusing having a default export and then other various necessary but non-default exports. just treat them all the same.

modules/ecash-wallet/src/wallet.ts
365 ↗(On Diff #54905)

discovered this extra space in error msg from cashtab-faucet tests

513 ↗(On Diff #54905)

it's easier to store rawTxs as hex strings in mocks for tests. In this way, we can set the mock-chronik-client broadcastTx endpoint with a hex string rawTx and get our expected txid.

if we do this with uint8arrays, storing mocks is trickier.

broadcastTx will accept uint8array or hex str.

This revision is now accepted and ready to land.Jul 20 2025, 05:33

correct params passed in index, rebase