Page MenuHomePhabricator

[Cashtab] Equal airdrop distribution ratio option
ClosedPublic

Authored by emack on Oct 1 2022, 09:44.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABCbc86cb45331a: [Cashtab] Equal airdrop distribution ratio option
Summary

As per T2687, this diff adds a toggle to the airdrop screen for the distribution ratio.
It's the pro-rata by default, and switching to equal will ensure all recipients will receive the same airdrop amount based on the 'Total XEC Airdrop' figure.

Test Plan

npm test
npm start
test no regression to pro rata distribution
switch to equal ratio and test the recipient amounts are all equal and adds up to the 'Total XEC airdrop' amount
test ignore own address option in equal and prorata ratios
test ignore airdrops below min payment in equal and prorata ratios
test ignore etoken minter address in equal and prorata ratios
test ignore custom addresses in equal and prorata ratios
test with a 'Total XEC Airdrop' figure with a large decimal point (e.g. 100.333333333) and ensure each recipient amount is rounded to 2 decimal points

Diff Detail

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

Event Timeline

emack requested review of this revision.Oct 1 2022, 09:44
bytesofman requested changes to this revision.Oct 4 2022, 16:02

image.png (343×434 px, 27 KB)

I think the "Distribution Ratio" is confusing -- also content jumps when the switch is hit. Remove this label.

web/cashtab/src/components/Airdrop/Airdrop.js
385 ↗(On Diff #35336)

looks like this should just be else {} ? Lose the else if

628 ↗(On Diff #35336)

remove this label

This revision now requires changes to proceed.Oct 4 2022, 16:02

Simplified distribution condition logic and removed label

please rebase to latest master before landing

This revision is now accepted and ready to land.Oct 6 2022, 15:08