ZcashFoundation / zcash-grant-system

The Zcash Foundation Grant System
https://grants.zfnd.org
MIT License
11 stars 8 forks source link

Rework Contribution Privacy #456

Closed AMStrix closed 5 years ago

AMStrix commented 5 years ago

Closes #448.

Screen Shot 2019-06-09 at 9 36 01 AM

Screen Shot 2019-06-09 at 9 36 55 AM

What this does

Notes

Testing

  1. clear your local DB & flask db upgrade
  2. create two users
    • User A + set user's refund address (settings > account > refund address)
    • User B + no refund address
  3. create, stake, approve + publish a proposal
  4. Anonymous Sign-out, then contribute 0.1 ZEC to the proposal
    • after clicking "Fund this project" ensure that the disclaimer for unattributed contributions shows up
    • review verbiage
    • click "I accept"
    • payment info shows up, click "I've sent it", see "Thank you" message and click "Done"
  5. Refund Address/No Attribution Sign-in with User A, then enter 0.2 ZEC into the proposal contribution field
    • ensure that "Contribute without attribution" is set by default, leave it selected
    • click "Fund this project"
    • should see payment info, click "I've sent it", then "Done"
  6. No Refund Address/Attribution Sign-in with User B, then enter 0.3 ZEC into contribution field
    • select "Attribute contribution publicly", click "Fund this project"
    • ensure Refund address setting modal appears, do not set a refund address
    • click "I don't want a refund, consider it a donation instead"
    • payment info should appear, click "I've sent it", then click "Done"
  7. admin: Financials > Contributions should only have "staking 100% 0.025"
  8. admin: Contributions > edit each of the pending contributions by setting the "Transaction ID" of each
  9. admin: Financials > Contributions should have "funding 96% 0.6"
  10. frontend: Proposal > Contributors (tab) should have three contributions and only one attributed to User B for 0.3 ZEC
  11. frontend: Authenticate as User B and visit User A's Profile > Funded tab, there should be 0 contributions
  12. frontend: Authenticate as User A and visit User A's Profile > Funded tab, there should be 1 private Contribution for 0.2 ZEC
    • visit User B's Profile > Funded tab, there should be 1 contribution for 0.3 ZEC
  13. admin: from proposal detail "Cancel & refund" the proposal
  14. admin: Financials > Contributions should have
    refunding 32% 0.2
    donation 64%  0.4
    staking   4%   0.025
  15. admin: Home page should have one action item "ready to be refunded", click the action item link
    • there should be one Contribution from User A for 0.2 ZEC on the list page, click on the contribution
    • set a payment id (can be any string) and "Mark Refunded"
    • go back to Home, action item should be cleared
  16. admin: Contributions > filter by "Donations", there should be two Contributions one from User B and the other from Anonymous
  17. admin: Financials > Contributions should be:
    refunded 32% 0.2
    donation 64%  0.4
    staking   4%   0.025