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

Flat rate whitelist support [SG-280] #253

Merged
merged 49 commits into from
Apr 25, 2024

Conversation

jason-c-child
Copy link
Contributor

The intent of these changes are to add a flat-rate whitelist to Names. The scope of changes include

  • Add a updatable-whitelist-flatrate contract (largely a modified version of the original whitelist code)
  • The ability to add either type of whitelist to the whitelists array in name-minter
  • Update discount related code to use both whitelist types
  • Update add/remove whitelist functions to support both types

@jason-c-child jason-c-child changed the base branch from main to tasiov/sg-1051-names-renewal January 15, 2024 19:55
@jason-c-child jason-c-child marked this pull request as ready for review January 17, 2024 13:20
@jason-c-child
Copy link
Contributor Author

this
needed
so
many
linter
updates
😭

Copy link

codecov bot commented Jan 17, 2024

Codecov Report

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

Comparison is base (bf97257) 70.68% compared to head (01185e8) 70.51%.

Files Patch % Lines
...racts/whitelist-updatable-flatrate/src/contract.rs 83.90% 28 Missing ⚠️
...tracts/whitelist-updatable-flatrate/src/helpers.rs 0.00% 26 Missing ⚠️
contracts/name-minter/src/contract.rs 71.42% 12 Missing ⚠️
contracts/marketplace/src/msg.rs 0.00% 6 Missing ⚠️
contracts/marketplace/src/query.rs 57.14% 6 Missing ⚠️
contracts/sg721-name/src/helpers.rs 0.00% 4 Missing ⚠️
contracts/marketplace/src/hooks.rs 0.00% 3 Missing ⚠️
contracts/name-minter/src/query.rs 66.66% 3 Missing ⚠️
contracts/marketplace/src/helpers.rs 33.33% 2 Missing ⚠️
contracts/name-minter/src/helpers.rs 0.00% 2 Missing ⚠️
... and 5 more
Additional details and impacted files
@@                       Coverage Diff                        @@
##           tasiov/sg-1051-names-renewal     #253      +/-   ##
================================================================
- Coverage                         70.68%   70.51%   -0.18%     
================================================================
  Files                                26       30       +4     
  Lines                              1699     1930     +231     
================================================================
+ Hits                               1201     1361     +160     
- Misses                              498      569      +71     

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

Copy link
Member

@shanev shanev left a comment

Choose a reason for hiding this comment

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

It looks like this PR includes a version update to CW that changes code in many of the contracts along with the new whitelist. Can they broken into two PRs to make it easier to review? Maybe the CW update first?

@jason-c-child
Copy link
Contributor Author

I've updated this PR to revert the updating of the deprecated functions which is lighting up the linter. I'm not sure why its failing the linter for this while the base branch isn't.

@jason-c-child jason-c-child changed the title Flat rate whitelist support Flat rate whitelist support [SG-280] Mar 6, 2024
Copy link

linear bot commented Mar 6, 2024

contracts/name-minter/src/contract.rs Outdated Show resolved Hide resolved
Comment on lines 169 to 176
let list = whitelists.iter().find(|whitelist| match whitelist {
WhitelistContract::Updatable(updatable) => updatable
.includes(&deps.querier, sender.to_string())
.unwrap_or(false),
WhitelistContract::Flatrate(flatrate) => flatrate
.includes(&deps.querier, sender.to_string())
.unwrap_or(false)
.unwrap_or(false),
});
Copy link
Member

Choose a reason for hiding this comment

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

Remember receiving Generic error: Querier contract error: codespace: wasm, code: 9: execute wasm contract failed errors during on-chain tests in these match statements. Will need to test these on chain again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MightOfOaks I've merged in the changes from the dYDx-airdrop branch. im curious if we can figure out why this is not matching correctly

@jason-c-child jason-c-child merged commit 8c53bdd into tasiov/sg-1051-names-renewal Apr 25, 2024
6 of 8 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.

4 participants