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

Add mutable whitelist contract and package #2

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Conversation

shanev
Copy link
Member

@shanev shanev commented Jun 4, 2023

Primitives for whitelists. This introduces packages for the most basic whitelist types as well as a mutable whitelist contract. These will be built on top of for Launchpad's wave mints.

Also introduces the sg_basic_whitelist_query macro to make the whitelist query interface typesafe.

Note: CI tests, schema and type generation will come in a future PR.

@shanev shanev marked this pull request as ready for review June 6, 2023 03:32
use crate::msg::InstantiateMsg;
use crate::state::{Config, CONFIG, WHITELIST};

const CONTRACT_NAME: &str = "crates.io:stargaze-whitelist-mutable";
Copy link
Contributor

Choose a reason for hiding this comment

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

should we rename to stargaze-mutable-whitelist to match

WHITELIST.count(deps.storage)
}

pub fn query_list(deps: Deps) -> StdResult<Vec<String>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

i guess we need to add pagination here

@tasiov
Copy link
Contributor

tasiov commented Jun 6, 2023

We need to add unit tests

@@ -0,0 +1,2 @@
// re-export the proc macros
pub use sg_basic_whitelist_derive::sg_basic_whitelist_query;
Copy link
Contributor

Choose a reason for hiding this comment

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

i havn't seen this before, where there a nested Cargo.toml packages within a workspace, maybe we put the macro Cargo.toml up one level?

@shanev shanev marked this pull request as draft June 18, 2023 18:26
@shanev
Copy link
Member Author

shanev commented Jun 18, 2023

TODO: Implement the interface from cw1

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