Skip to content

Commit

Permalink
removes the unnecessary ContractError
Browse files Browse the repository at this point in the history
  • Loading branch information
gangov committed Nov 21, 2024
1 parent 68f4075 commit c27fb82
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions contracts/deployer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl CollectionsDeployer {
deployed_collection
}

pub fn query_all_collections(env: &Env) -> Result<Vec<String>, ContractError> {
pub fn query_all_collections(env: &Env) -> Vec<String> {
let maybe_all = env
.storage()
.persistent()
Expand All @@ -86,13 +86,13 @@ impl CollectionsDeployer {
)
});

Ok(maybe_all)
maybe_all
}

pub fn query_collection_by_creator(
env: &Env,
creator: Address,
) -> Result<Vec<CollectionByCreatorResponse>, ContractError> {
) -> Vec<CollectionByCreatorResponse> {
let data_key = DataKey::Creator(creator);
let maybe_collections = env
.storage()
Expand All @@ -106,7 +106,7 @@ impl CollectionsDeployer {
.extend_ttl(&data_key, LIFETIME_THRESHOLD, BUMP_AMOUNT)
});

Ok(maybe_collections)
maybe_collections
}
}

Expand All @@ -128,14 +128,6 @@ pub enum DataKey {
Creator(Address),
}

#[contracterror]
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
#[repr(u32)]
pub enum ContractError {
NoCollectionsSaved = 0,
CreatorHasNoCollections = 1,
}

pub fn set_initialized(env: &Env) {
env.storage().instance().set(&DataKey::IsInitialized, &());
env.storage()
Expand Down

0 comments on commit c27fb82

Please sign in to comment.