From 0f6d56a792b2dc2badf7fd269f2f485e3db36298 Mon Sep 17 00:00:00 2001 From: Gangov <6922910+gangov@users.noreply.github.com> Date: Wed, 14 Aug 2024 11:03:47 +0300 Subject: [PATCH] couple more query fns --- Cargo.lock | 7 +++++++ Makefile | 2 +- contracts/deployer/src/lib.rs | 12 ++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a89a1624..81e374d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -705,6 +705,13 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "phoenix-multisig-deployer" +version = "1.0.0" +dependencies = [ + "soroban-sdk", +] + [[package]] name = "phoenix-nft-auctions" version = "1.0.0" diff --git a/Makefile b/Makefile index c524dab6..0c1802c8 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SUBDIRS := contracts/collections +SUBDIRS := contracts/collections contracts/deployer BUILD_FLAGS ?= default: build diff --git a/contracts/deployer/src/lib.rs b/contracts/deployer/src/lib.rs index 7f660f45..d9b06efa 100644 --- a/contracts/deployer/src/lib.rs +++ b/contracts/deployer/src/lib.rs @@ -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 { + todo!(); + } + + pub fn query_collection_by_admin(env: &Env, admin: Address) -> Vec { + todo!() + } } // ---------- Storage types ---------- @@ -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 = env .storage() .persistent()