Page MenuHomePhabricator

[Cashtab] Use in-node chronik to calculate airdrops
ClosedPublic

Authored by bytesofman on Mar 22 2024, 11:41.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABCe54c03ecbda3: [Cashtab] Use in-node chronik to calculate airdrops
Summary

Use in-node chronik to calculate airdrop txs instead of SLPDB

This dramatically increases the speed of airdrop calculations. What used to take 30s to 90s, depending on the token history, is now instantaneous or within 10s.

Large diff, but

  • All new functions are unit tested
  • Integration tests are added to Airdrop.js confirming expected behavior

Various knock-on impacts of this diff

  • mock-chronik-client had to be updated to properly mock the features used (new tokenId endpoint)
  • lots of etoken: address conversion functions no longer necessary (these worked with the format returned by etoken-list)
  • etoken-list is no longer used and can be deprecated
  • tokendb.kingbch.com is officially obsolete and will be shut down
  • we do not need a progress bar for the airdrop calculation. This will almost always be "instant," and only takes some time for tokens with a large amount of holders. we continue to lock the UI and show a spinner while Cashtab is calculating an airdrop.
Test Plan

npm test

This diff is live at https://cashtab-local-dev.netlify.app/

Diff Detail

Repository
rABC Bitcoin ABC
Branch
slpv1-mints
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 27989
Build 55526: Build Diffcashtab-tests
Build 55525: arc lint + arc unit

Event Timeline

Tail of the build log:

  run `npm fund` for details

found 0 vulnerabilities
/work/cashtab /work/modules/mock-chronik-client /work/abc-ci-builds/cashtab-tests
npm WARN deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm WARN deprecated @babel/plugin-proposal-private-methods@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
npm WARN deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm WARN deprecated @babel/plugin-proposal-private-property-in-object@7.21.11: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm WARN deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm WARN deprecated domexception@4.0.0: Use your platform's native DOMException instead
npm WARN deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0

added 1716 packages, and audited 1717 packages in 23s

262 packages are looking for funding
  run `npm fund` for details

2 vulnerabilities (1 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> cashtab@2.4.3 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

[eslint] 
src/components/Airdrop/Airdrop.js
  Line 37:19:   'tokenConfig' is defined but never used            no-unused-vars
  Line 85:22:   'cashtabCache' is assigned a value but never used  no-unused-vars
  Line 206:9:   Unreachable code                                   no-unreachable
  Line 210:13:  'airdropList' is not defined                       no-undef
  Line 243:13:  'airdropList' is not defined                       no-undef
  Line 250:17:  'airdropList' is not defined                       no-undef
  Line 260:38:  'airdropList' is not defined                       no-undef
  Line 262:21:  'airdropList' is not defined                       no-undef
  Line 267:14:  'airdropList' is not defined                       no-undef
  Line 283:46:  'airdropList' is not defined                       no-undef
  Line 287:13:  'airdropList' is not defined                       no-undef
  Line 298:38:  'airdropList' is not defined                       no-undef
  Line 303:21:  'airdropList' is not defined                       no-undef
  Line 308:18:  'airdropList' is not defined                       no-undef
  Line 323:37:  'airdropList' is not defined                       no-undef
  Line 327:9:   'airdropList' is not defined                       no-undef
  Line 342:13:  'airdropList' is not defined                       no-undef
  Line 354:13:  'airdropList' is not defined                       no-undef

Search for the keywords to learn more about each error.


Build cashtab-tests failed with exit code 1
bytesofman edited the test plan for this revision. (Show Details)

minor version bump cashtab and extension

Failed tests logs:

====== CashTab Unit Tests: <Home /> Renders backup warning and QR Code if user loads with a new wallet ======
Error: expect(element).not.toBeInTheDocument()

expected document not to contain element, found <div class="sc-jqCOkK ldKGvf" data-testid="loading-ctn" /> instead

Ignored nodes: comments, script, style
<html>
  <head />
  <body>
    <div>
      <div
        class="ant-spin-nested-loading css-dev-only-do-not-override-1rqnfsa"
      >
        <div>
          <div
            aria-busy="true"
            aria-live="polite"
            class="ant-spin ant-spin-spinning css-dev-only-do-not-override-1rqnfsa"
          >
            <span
              aria-label="loading"
              class="anticon anticon-loading anticon-spin cashLoadingIcon ant-spin-dot"
              role="img"
            >
              <svg
                aria-hidden="true"
                data-icon="loading"
                fill="currentColor"
                focusable="false"
                height="1em"
                viewBox="0 0 1024 1024"
                width="1em"
              >
                <path
                  d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"
                />
              </svg>
            </span>
          </div>
        </div>
        <div
          class="ant-spin-container ant-spin-blur"
        >
          <div
            class="sc-hgHYgh iyvBLw"
          >
            <div
              class="sc-bEjcJn fIGcdH"
            >
              <div
                class="sc-ePZHVD OwwaU"
              >
                <div
                  class="sc-jqCOkK ldKGvf"
                  data-testid="loading-ctn"
                />
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>...
    at toBeInTheDocument (/work/cashtab/src/components/Home/__tests__/Home.test.js:140:61)
    at runWithExpensiveErrorDiagnosticsDisabled (/work/cashtab/node_modules/@testing-library/dom/dist/config.js:47:12)
    at checkCallback (/work/cashtab/node_modules/@testing-library/dom/dist/wait-for.js:124:77)
    at checkRealTimersCallback (/work/cashtab/node_modules/@testing-library/dom/dist/wait-for.js:118:16)
    at Timeout.task [as _onTimeout] (/work/cashtab/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)
    at listOnTimeout (node:internal/timers:573:17)
    at processTimers (node:internal/timers:514:7)
====== CashTab Unit Tests: <Airdrop /> We can ignore addresses with less than a token balance for a token with decimals ======
Error: thrown: "Exceeded timeout of 120000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
    at it (/work/cashtab/src/components/Airdrop/__tests__/Airdrop.test.js:214:5)
    at _dispatchDescribe (/work/cashtab/node_modules/jest-circus/build/index.js:91:26)
    at describe (/work/cashtab/node_modules/jest-circus/build/index.js:55:5)
    at Object.describe (/work/cashtab/src/components/Airdrop/__tests__/Airdrop.test.js:59:1)
    at Runtime._execModule (/work/cashtab/node_modules/jest-runtime/build/index.js:1439:24)
    at Runtime._loadModule (/work/cashtab/node_modules/jest-runtime/build/index.js:1022:12)
    at Runtime.requireModule (/work/cashtab/node_modules/jest-runtime/build/index.js:882:12)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:106:12)
====== CashTab Unit Tests: <SignVerifyMsg /> Notification is rendered upon successfully verifying a message ======
Error: thrown: "Exceeded timeout of 120000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
    at it (/work/cashtab/src/components/SignVerifyMsg/__tests__/SignVerifyMsg.test.js:117:5)
    at _dispatchDescribe (/work/cashtab/node_modules/jest-circus/build/index.js:91:26)
    at describe (/work/cashtab/node_modules/jest-circus/build/index.js:55:5)
    at Object.describe (/work/cashtab/src/components/SignVerifyMsg/__tests__/SignVerifyMsg.test.js:49:1)
    at Runtime._execModule (/work/cashtab/node_modules/jest-runtime/build/index.js:1439:24)
    at Runtime._loadModule (/work/cashtab/node_modules/jest-runtime/build/index.js:1022:12)
    at Runtime.requireModule (/work/cashtab/node_modules/jest-runtime/build/index.js:882:12)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:106:12)
====== CashTab Unit Tests: <SignVerifyMsg /> Notification is rendered upon signature verification error ======
Error: thrown: "Exceeded timeout of 120000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
    at it (/work/cashtab/src/components/SignVerifyMsg/__tests__/SignVerifyMsg.test.js:168:5)
    at _dispatchDescribe (/work/cashtab/node_modules/jest-circus/build/index.js:91:26)
    at describe (/work/cashtab/node_modules/jest-circus/build/index.js:55:5)
    at Object.describe (/work/cashtab/src/components/SignVerifyMsg/__tests__/SignVerifyMsg.test.js:49:1)
    at Runtime._execModule (/work/cashtab/node_modules/jest-runtime/build/index.js:1439:24)
    at Runtime._loadModule (/work/cashtab/node_modules/jest-runtime/build/index.js:1022:12)
    at Runtime.requireModule (/work/cashtab/node_modules/jest-runtime/build/index.js:882:12)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:106:12)
====== CashTab Unit Tests: <SendToken /> Renders the burn token success notification upon successful burn tx broadcast ======
Error: thrown: "Exceeded timeout of 120000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
    at it (/work/cashtab/src/components/Send/__tests__/SendToken.test.js:494:5)
    at _dispatchDescribe (/work/cashtab/node_modules/jest-circus/build/index.js:91:26)
    at describe (/work/cashtab/node_modules/jest-circus/build/index.js:55:5)
    at Object.describe (/work/cashtab/src/components/Send/__tests__/SendToken.test.js:74:1)
    at Runtime._execModule (/work/cashtab/node_modules/jest-runtime/build/index.js:1439:24)
    at Runtime._loadModule (/work/cashtab/node_modules/jest-runtime/build/index.js:1022:12)
    at Runtime.requireModule (/work/cashtab/node_modules/jest-runtime/build/index.js:882:12)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:106:12)
====== CashTab Unit Tests: <Configure /> We can add, delete, rename, contacts from the Configure screen, and add a savedWallet as a contact ======
Error: thrown: "Exceeded timeout of 120000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
    at it (/work/cashtab/src/components/Configure/__tests__/Configure.test.js:94:5)
    at _dispatchDescribe (/work/cashtab/node_modules/jest-circus/build/index.js:91:26)
    at describe (/work/cashtab/node_modules/jest-circus/build/index.js:55:5)
    at Object.describe (/work/cashtab/src/components/Configure/__tests__/Configure.test.js:63:1)
    at Runtime._execModule (/work/cashtab/node_modules/jest-runtime/build/index.js:1439:24)
    at Runtime._loadModule (/work/cashtab/node_modules/jest-runtime/build/index.js:1022:12)
    at Runtime.requireModule (/work/cashtab/node_modules/jest-runtime/build/index.js:882:12)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:106:12)
====== CashTab Unit Tests: <Configure /> We can rename the active wallet or a saved wallet, we can add a wallet, we can import a wallet, we can delete a wallet ======
Error: thrown: "Exceeded timeout of 120000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
    at it (/work/cashtab/src/components/Configure/__tests__/Configure.test.js:323:5)
    at _dispatchDescribe (/work/cashtab/node_modules/jest-circus/build/index.js:91:26)
    at describe (/work/cashtab/node_modules/jest-circus/build/index.js:55:5)
    at Object.describe (/work/cashtab/src/components/Configure/__tests__/Configure.test.js:63:1)
    at Runtime._execModule (/work/cashtab/node_modules/jest-runtime/build/index.js:1439:24)
    at Runtime._loadModule (/work/cashtab/node_modules/jest-runtime/build/index.js:1022:12)
    at Runtime.requireModule (/work/cashtab/node_modules/jest-runtime/build/index.js:882:12)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:106:12)
====== CashTab Unit Tests: <App /> Setting "Send Confirmations" settings will show send confirmations ======
Error: thrown: "Exceeded timeout of 120000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
    at it (/work/cashtab/src/components/__tests__/App.test.js:483:5)
    at _dispatchDescribe (/work/cashtab/node_modules/jest-circus/build/index.js:91:26)
    at describe (/work/cashtab/node_modules/jest-circus/build/index.js:55:5)
    at Object.describe (/work/cashtab/src/components/__tests__/App.test.js:65:1)
    at Runtime._execModule (/work/cashtab/node_modules/jest-runtime/build/index.js:1439:24)
    at Runtime._loadModule (/work/cashtab/node_modules/jest-runtime/build/index.js:1022:12)
    at Runtime.requireModule (/work/cashtab/node_modules/jest-runtime/build/index.js:882:12)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:106:12)
====== CashTab Unit Tests: <App /> If Cashtab starts up with some settings keys missing, the missing keys are migrated to default values ======
Error: expect(received).toEqual(expected) // deep equality

- Expected  - 3
+ Received  + 0

  Object {
    "autoCameraOn": true,
-   "balanceVisible": true,
    "fiatCurrency": "gbp",
-   "hideMessagesFromUnknownSenders": false,
-   "minFeeSends": false,
    "sendModal": true,
  }

Ignored nodes: comments, script, style
<html>
  <head />
  <body>
    <div>
      <div
        class="ant-spin-nested-loading css-dev-only-do-not-override-1rqnfsa"
      >
        <div>
          <div
            aria-busy="true"
            aria-live="polite"
            class="ant-spin ant-spin-spinning css-dev-only-do-not-override-1rqnfsa"
          >
            <span
              aria-label="loading"
              class="anticon anticon-loading anticon-spin cashLoadingIcon ant-spin-dot"
              role="img"
            >
              <svg
                aria-hidden="true"
                data-icon="loading"
                fill="currentColor"
                focusable="false"
                height="1em"
                viewBox="0 0 1024 1024"
                width="1em"
              >
                <path
                  d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"
                />
              </svg>
            </span>
          </div>
        </div>
        <div
          class="ant-spin-container ant-spin-blur"
        >
          <div
            class="sc-hgHYgh iyvBLw"
          >
            <div
              class="sc-bEjcJn fIGcdH"
            >
              <div
                class="sc-ePZHVD OwwaU"
              >
                <div
                  class="sc-jqCOkK ldKGvf"
                  data-testid="loading-ctn"
                />
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>...
    at toEqual (/work/cashtab/src/components/__tests__/App.test.js:590:59)

Each failure log is accessible here:
CashTab Unit Tests: <Home /> Renders backup warning and QR Code if user loads with a new wallet
CashTab Unit Tests: <Airdrop /> We can ignore addresses with less than a token balance for a token with decimals
CashTab Unit Tests: <SignVerifyMsg /> Notification is rendered upon successfully verifying a message
CashTab Unit Tests: <SignVerifyMsg /> Notification is rendered upon signature verification error
CashTab Unit Tests: <SendToken /> Renders the burn token success notification upon successful burn tx broadcast
CashTab Unit Tests: <Configure /> We can add, delete, rename, contacts from the Configure screen, and add a savedWallet as a contact
CashTab Unit Tests: <Configure /> We can rename the active wallet or a saved wallet, we can add a wallet, we can import a wallet, we can delete a wallet
CashTab Unit Tests: <App /> Setting "Send Confirmations" settings will show send confirmations
CashTab Unit Tests: <App /> If Cashtab starts up with some settings keys missing, the missing keys are migrated to default values

spinner back in for bigger calcs

clean up package-lock.json after rebase and removing etoken-list dep

Tail of the build log:

Installing mock-chronik-client dependencies...
/work/modules/mock-chronik-client /work/abc-ci-builds/cashtab-tests

added 236 packages, and audited 237 packages in 1s

35 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
/work/cashtab /work/modules/mock-chronik-client /work/abc-ci-builds/cashtab-tests
npm WARN deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm WARN deprecated @babel/plugin-proposal-private-methods@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
npm WARN deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm WARN deprecated @babel/plugin-proposal-private-property-in-object@7.21.11: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.
npm WARN deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated domexception@4.0.0: Use your platform's native DOMException instead
npm WARN deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm WARN deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
npm WARN deprecated workbox-google-analytics@6.6.0: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained

added 1723 packages, and audited 1724 packages in 23s

269 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

> cashtab@2.5.0 build
> node scripts/build.js

Creating an optimized production build...

Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.

Failed to compile.

Module not found: Error: Can't resolve 'vm' in '/work/cashtab/node_modules/asn1.js/lib/asn1'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "vm": require.resolve("vm-browserify") }'
	- install 'vm-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "vm": false }


Build cashtab-tests failed with exit code 1

back out unrelated dep changes

bytesofman edited the summary of this revision. (Show Details)
bytesofman added inline comments.
cashtab/extension/public/manifest.json
6 ↗(On Diff #46393)

bump the extension, significant upgrade

cashtab/package-lock.json
22 ↗(On Diff #46393)

obsolete. imo should just be deprecated. Was never really used from the command line, and the entire app is built around SLPDB which should also go.

cashtab/src/chronik/index.js
921 ↗(On Diff #46393)

we no longer need to return this in etoken format; previously had to be as etoken-list returned all the other addresses that way

cashtab/src/components/Airdrop/Airdrop.js
16 ↗(On Diff #46393)

no reason for the whole component to be in a collapse

17 ↗(On Diff #46393)

we maintain UI-locking during airdrop calculations, as it is possible for it to take ~seconds for larger calculations. However we lose the progress bar which never really worked right anyway.

cashtab/src/components/App.js
620 ↗(On Diff #46388)

now airdrops are calculated instantly. we do not need a loader spinner for the ~1 minute it used to take SLPDB to do this.

cashtab/src/components/Common/EnhancedInputs.js
310 ↗(On Diff #46388)

We are entering a token qty here, so it should be a string, as token quantities can exceed js max safe number

cashtab/src/utils/cashMethods.js
37 ↗(On Diff #46393)

we no longer need any of these helper conversion functions

emack requested changes to this revision.Mar 22 2024, 23:44
emack added a subscriber: emack.

Error workflow:

  1. 100 XEC airdrop for 1c6c9c64d70b285befe733f175d0f384538576876bd280b10587df81279d3f5e, which should give you the following:

image.png (149×466 px, 20 KB)

  1. Toggle Ignore eToken minter address

image.png (136×458 px, 16 KB)

  1. Set Minimum eToken holder balance to 100 which correctly shows the following

image.png (136×399 px, 12 KB)

  1. Remove the Minimum eToken holder balance filter, recalculate airdrop, and note it is still calculating as if the minimum token balance is in play.

image.png (134×403 px, 12 KB)

This issue occurs for both pro rata and communist mode.

This isn't an issue when applying and un-applying ignore custom addresses. ignoring minter address, ignoring own address. It's just specific to min holder balance.

This revision now requires changes to proceed.Mar 22 2024, 23:44

Error workflow:

  1. 100 XEC airdrop for 1c6c9c64d70b285befe733f175d0f384538576876bd280b10587df81279d3f5e, which should give you the following:

image.png (149×466 px, 20 KB)

  1. Toggle Ignore eToken minter address

image.png (136×458 px, 16 KB)

  1. Set Minimum eToken holder balance to 100 which correctly shows the following

image.png (136×399 px, 12 KB)

  1. Remove the Minimum eToken holder balance filter, recalculate airdrop, and note it is still calculating as if the minimum token balance is in play.

image.png (134×403 px, 12 KB)

This issue occurs for both pro rata and communist mode.

This isn't an issue when applying and un-applying ignore custom addresses. ignoring minter address, ignoring own address. It's just specific to min holder balance.

good catch. added a routione to clear this state when the switch toggles.

rebase, version bump, clear ignoreMinEtokenBalanceAmount when switch toggles

This revision is now accepted and ready to land.Mar 23 2024, 09:46