Page MenuHomePhabricator

[ecash-agora] take method only supports taking by the taking wallet
ClosedPublic

Authored by bytesofman on Tue, Oct 28, 16:28.

Details

Summary

Depends on D18846

Oversight in copypasta params. When we call take() with a wallet, we do not want to support taking to some other address that is not the wallet address.

Some niche use cases may want to do this, they can use the existing acceptTx method.

Test Plan

npm test, CI

Diff Detail

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

Event Timeline

Failed tests logs:

====== AgoraPartial SLP: AgoraPartial SLP 1000 for 1sat/token, dust accept, must allowUnspendable.AgoraPartial SLP AgoraPartial SLP 1000 for 1sat/token, dust accept, must allowUnspendable ======
Error: Insufficient input sats (2333): Can only pay for 695 fees, but 1186 required
    at TxBuilder.sign (/work/modules/ecash-lib/src/txBuilder.ts:204:23)
    at AgoraOffer.take (src/agora.ts:293:34)
    at takeSlpOffer (tests/partial-helper-slp.ts:143:48)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Context.<anonymous> (tests/partial.slp.test.ts:500:32)

Each failure log is accessible here:
AgoraPartial SLP: AgoraPartial SLP 1000 for 1sat/token, dust accept, must allowUnspendable.AgoraPartial SLP AgoraPartial SLP 1000 for 1sat/token, dust accept, must allowUnspendable

add separate routine to fund taker

Failed tests logs:

====== AgoraPartial SLP: AgoraPartial SLP 1000 for 1000sat/token, 1 accept.AgoraPartial SLP AgoraPartial SLP 1000 for 1000sat/token, 1 accept ======
Error: Insufficient input sats (3200): Can only pay for 1107 fees, but 1179 required
    at TxBuilder.sign (/work/modules/ecash-lib/src/txBuilder.ts:204:23)
    at AgoraOffer.take (src/agora.ts:293:34)
    at takeSlpOffer (tests/partial-helper-slp.ts:143:48)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Context.<anonymous> (tests/partial.slp.test.ts:502:32)

Each failure log is accessible here:
AgoraPartial SLP: AgoraPartial SLP 1000 for 1000sat/token, 1 accept.AgoraPartial SLP AgoraPartial SLP 1000 for 1000sat/token, 1 accept

This revision is now accepted and ready to land.Wed, Oct 29, 10:28