Page MenuHomePhabricator

[Cashtab] Airdrop Option - exclusion list
ClosedPublic

Authored by emack on Mar 24 2022, 10:28.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC60933b10e70d: [Cashtab] Airdrop Option - exclusion list
Summary

As per T2143:

Option to exclude a list of addresses from the airdrop recipients list. This includes both the filtering out of the address and the overall pro rata calculation of airdrop for each address.

Additional addresses in the ignore list are to be separated by a comma.

Test Plan
  • add only one single address to the ignore list and ensure it is reflected in calculations
  • add more than one address to the ignore list, separated by a comma and ensure they are reflected in calculations
  • duplicate a particular address in the ignore list and ensure it does not cause calculation issues
  • ensure once an initial calculation is outputted, subsequent edits to the ignore list will still trigger address validation
  • test an ignore list where the addresses represent the entirety of the full recipients list, and ensure the 'no holders found for etoken ID...' error message is displayed and the loading dialogues are deactivated.
  • test the following scenarios for activation/deactivation of the Calculate Airdrop button
    1. invalid etoken ID + invalid total airdrop figure = disabled
    2. valid etoken ID + invalid total airdrop figure = disabled
    3. valid etoken ID + valid total airdrop figure = enabled
    4. ensure ignore address list textarea input is disabled if the checkbox is unchecked
    5. valid etoken ID + valid total airdrop figure + checked ignore option + invalid ignore addresses = disabled
    6. valid etoken ID + invalid total airdrop figure + checked ignore option + valid ignore addresses = disabled
    7. valid etoken ID + valid total airdrop figure + checked ignore option + empty ignore addresses = disabled
  • regression test the routing from the send etoken screen to the airdrop screen
  • ensure bitcoincash: and slp: addresses including their prefix-less versions, are invalidated
  • ensure valid ecash: addresses and their prefix-less versions are validated
  • ensure valid etoken: addresses and their prefix-less versions are invalidated

Diff Detail

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

Event Timeline

emack requested review of this revision.Mar 24 2022, 10:28

Tail of the build log:

/work/web/cashtab /work/abc-ci-builds/cashtab-tests
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'eslint-plugin-jest@25.3.4',
npm WARN EBADENGINE   required: { node: '^12.13.0 || ^14.15.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/experimental-utils@5.9.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/scope-manager@5.9.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/types@5.9.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/typescript-estree@5.9.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@typescript-eslint/visitor-keys@5.9.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'eslint-visitor-keys@3.1.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm notice 
npm notice New major version of npm available! 7.7.6 -> 8.5.5
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.5.5>
npm notice Run `npm install -g npm@8.5.5` to update!
npm notice 
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! errno ERR_SOCKET_TIMEOUT
npm ERR! request to https://registry.npmjs.org/@ant-design%2freact-slick failed, reason: Socket timeout

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-03-24T10_29_46_120Z-debug.log
Build cashtab-tests failed with exit code 1
bytesofman added inline comments.
web/cashtab/src/components/Airdrop/Airdrop.js
439 ↗(On Diff #32988)

Use a switch instead of a checkbox

444 ↗(On Diff #32988)

Ignore custom addresses?

446 ↗(On Diff #32988)

Only show this field if switch is checked.

This revision now requires changes to proceed.Mar 30 2022, 16:59
emack marked 3 inline comments as done.

Conditional rendering of exclusion textarea and adjusted switch component and labelling.

image.png (264×422 px, 23 KB)

Input is invalid if in format of <address>,<space><address>

comma separated list with spaces in between should be okay.

To recreate, copy paste an address, type comma + space, then copy paste another address

This revision now requires changes to proceed.Mar 31 2022, 16:42

Applied regex to remove all whitepaces in exclusion list rather than just trailing ones.

This revision is now accepted and ready to land.Apr 5 2022, 16:13
This revision was automatically updated to reflect the committed changes.