Add buildXecSwap to build a normal XEC tx with leftover change, sized for a known number of counterparty P2PKH token inputs. Postage methods are unchanged.
Details
- Reviewers
- None
- Group Reviewers
Restricted Project
- cd modules/ecash-wallet && npm test
- BUILD_DIR=<abc-build> npm run integration-tests -- --grep 'XEC atomic swap'
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- postage-xec-change
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Event Timeline
Build Bitcoin ABC Diffs / Diff Testing (ai-review) passed.
CodeRabbit Review
Diff : committed changes only
Compare : HEAD → master
Directory : work
────────────────────────────────────────
(\(\
(• .•) GPU-powered code review. It's the future.
────────────────────────────────────────────────────────────────────────
major [Functional Correctness] → ]8;;vscode://file//work/modules/ecash-wallet/src/wallet.ts:3013modules/ecash-wallet/src/wallet.ts:3013-3026]8;; Validate the final postage transaction size. ChainedTxType.NONE does not prove that the transaction fits maxTxSersize. XEC serialization overflow is detected only after signing in build(). This method returns a one-step plan even if the new change output makes the transaction exceed action.maxTxSersize or MAX_TX_SERSIZE. After the final HD change rebuild, compare partiallySignedTx.serSize() with the configured limit. Throw a clear error because buildPostageWithChange() cannot construct the required chained transaction.
────────────────────────────────────────
Review complete
1 finding ✔
Major 1
5 files reviewed:
- modules/ecash-wallet/README.md
- modules/ecash-wallet/package.json
- modules/ecash-wallet/src/wallet.test.ts
- modules/ecash-wallet/src/wallet.ts
- modules/ecash-wallet/test/postage.test.ts
────────────────────────────────────────
Print all AI prompts: coderabbit review --show-prompts
Tail of the build log:
/work /work/abc-ci-builds/ai-review Connecting to CodeRabbit... 0s elapsed Preparing review... 2s elapsed ✗ Review limit reached Limit details: You’ve used all 5 included reviews currently available. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. You're only billed for reviews past your plan's rate limits ($0.25/file). You can wait 3 minutes for the limit to reset. https://app.coderabbit.ai/settings/billing?tab=usage&orgId=79839cd4-7849-4bd5-8d6d-5ecaf453356e Build ai-review failed with exit code 1
Abandoning as there are no near term plans for using this.
This is a good proof of concept though. Once we have the alp-dex AMM going and a trading pair live, this is the kind of approach we could use to support an XEC<>TOKEN AMM instead of just TOKEN<>TOKEN