Page MenuHomePhabricator

[Cashtab] Update transactions index test msg
AbandonedPublic

Authored by emack on Dec 21 2023, 09:02.

Details

Reviewers
bytesofman
Fabien
Group Reviewers
Restricted Project
Summary

The unit tests on master for transactions index is failing due to this expected error message from sending below dust threshold:

image.png (264×977 px, 50 KB)

This was introduced via D14938

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
master
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26029
Build 51632: Build Diffcashtab-tests
Build 51631: arc lint + arc unit

Event Timeline

emack requested review of this revision.Dec 21 2023, 09:02
emack edited the summary of this revision. (Show Details)

Failed tests logs:

====== CashTab Unit Tests: Improved Cashtab transaction broadcasting function sendXec: Sending below dust threshold ======
Error: expect(received).rejects.toThrow(expected)

Expected substring: "Transaction must send more than dust threshold of 546 satoshis"
Received message:   "Transaction output amount must be at least the dust threshold of 546 satoshis"

      58 |     const utxos = wallet.state.nonSlpUtxos;
      59 |
    > 60 |     let { inputs, outputs } = coinSelect(utxos, targetOutputs, feeRate);
         |                                         ^
      61 |
      62 |     // Initialize TransactionBuilder
      63 |     let txBuilder = utxolib.bitgo.createTransactionBuilderForNetwork(

      at coinSelect (node_modules/ecash-coinselect/src/coinSelect.js:49:15)
      at sendXec (src/transactions/index.js:60:41)
      at Object.<anonymous> (src/transactions/__tests__/index.test.js:47:24)
    at Object.toThrow (/work/cashtab/node_modules/jest-circus/node_modules/expect/build/index.js:285:22)
    at Object.<anonymous> (/work/cashtab/src/transactions/__tests__/index.test.js:48:23)
    at Promise.then.completed (/work/cashtab/node_modules/jest-circus/build/utils.js:391:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/work/cashtab/node_modules/jest-circus/build/utils.js:316:10)
    at _callCircusTest (/work/cashtab/node_modules/jest-circus/build/run.js:218:40)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at _runTest (/work/cashtab/node_modules/jest-circus/build/run.js:155:3)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:66:9)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:60:9)
    at run (/work/cashtab/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:389:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:475:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:133:12)

Each failure log is accessible here:
CashTab Unit Tests: Improved Cashtab transaction broadcasting function sendXec: Sending below dust threshold

Failed tests logs:

====== CashTab Unit Tests: Improved Cashtab transaction broadcasting function sendXec: Sending below dust threshold ======
Error: expect(received).rejects.toThrow(expected)

Expected substring: "Transaction must send more than dust threshold of 546 satoshis"
Received message:   "Transaction output amount must be at least the dust threshold of 546 satoshis"

pepe.jfif (720×935 px, 27 KB)

Fabien requested changes to this revision.Dec 21 2023, 10:04
Fabien added a subscriber: Fabien.

maybe you need to rebase ?

Also I don't see the CI fail on master, was it fixed already ?

This revision now requires changes to proceed.Dec 21 2023, 10:04

maybe you need to rebase ?

The issue was due to the ecash-coinselect module (used by Cashtab's transactions unit tests) being outdated locally, which didn't get updated when I rebased Cashtab. Manually rebasing ecash-coinselect fixed this issue.