Skip to content

Commit

Permalink
couple more query fns
Browse files Browse the repository at this point in the history
  • Loading branch information
gangov committed Aug 14, 2024
1 parent dc1847b commit 0f6d56a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SUBDIRS := contracts/collections
SUBDIRS := contracts/collections contracts/deployer
BUILD_FLAGS ?=

default: build
Expand Down
12 changes: 10 additions & 2 deletions contracts/deployer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,18 @@ impl CollectionsDeployer {
let _: Val = env.invoke_contract(&deployed_multisig, &init_fn, init_fn_args);

save_collection_with_generic_key(&env, name.clone());
save_collection_with_admin_key(&env, name, admin);
save_collection_with_admin_address_as_key(&env, name, admin);

deployed_multisig
}

pub fn query_all_collections(env: &Env) -> Vec<String> {
todo!();
}

pub fn query_collection_by_admin(env: &Env, admin: Address) -> Vec<String> {
todo!()
}
}

// ---------- Storage types ----------
Expand Down Expand Up @@ -105,7 +113,7 @@ pub fn save_collection_with_generic_key(env: &Env, name: String) {
.set(&DataKey::AllCollections, &existent_collection);
}

pub fn save_collection_with_admin_key(env: &Env, name: String, admin: Address) {
pub fn save_collection_with_admin_address_as_key(env: &Env, name: String, admin: Address) {
let mut existent_collection: Vec<String> = env
.storage()
.persistent()
Expand Down

0 comments on commit 0f6d56a

Please sign in to comment.