Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent double minting #185

Merged
merged 5 commits into from
Oct 6, 2023
Merged

fix: prevent double minting #185

merged 5 commits into from
Oct 6, 2023

Conversation

wa0x6e
Copy link
Contributor

@wa0x6e wa0x6e commented Sep 30, 2023

🧿 Current issues / What's wrong ?

Second part of the following pitch: https://www.notion.so/snapshotlabs/NFT-claimer-minting-constrains-de9705b71aca4b1aa57ff62b47d1824a

Based on #184

🚧 Changes

  • Prevent minting when the address has already minted from the same proposal

🛠️ Tests

  • Run a local instance of this branch (Copy and set the missing env var from /test/.env.test)
  • Run a local instance of snapshot feat: nft claimer snapshot#3885 (set the VITE_SIDEKICK_URL in .env to your local sidekick instance)
  • On a proposal you have voted and minted, if you try to mint, it should return an error
  • On a proposal you have voted but not minted, if you try to mint, it should mint

As of now, the UI only return "Invalid data submitted" message on error. UI needs some refactoring to check if user already voted, and show am error another message, instead of starting the mint and failing from sidekick validation.

@codecov
Copy link

codecov bot commented Sep 30, 2023

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (c169783) 56.26% compared to head (ab63771) 56.31%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #185      +/-   ##
==========================================
+ Coverage   56.26%   56.31%   +0.04%     
==========================================
  Files          19       19              
  Lines        1619     1655      +36     
  Branches      120      122       +2     
==========================================
+ Hits          911      932      +21     
- Misses        697      712      +15     
  Partials       11       11              
Files Coverage Δ
src/lib/nftClaimer/mint.ts 100.00% <100.00%> (ø)
src/lib/nftClaimer/utils.ts 62.45% <51.61%> (-1.52%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wa0x6e wa0x6e changed the base branch from mint-snapit-only-on-voter to main October 5, 2023 17:03
@wa0x6e wa0x6e requested a review from ChaituVR October 5, 2023 17:03
Copy link
Member

@ChaituVR ChaituVR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utAck

@wa0x6e wa0x6e merged commit d2c9929 into main Oct 6, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants