diff --git a/contract/contract/src/base/errors.rs b/contract/contract/src/base/errors.rs index d365f51..a758e1c 100644 --- a/contract/contract/src/base/errors.rs +++ b/contract/contract/src/base/errors.rs @@ -107,3 +107,12 @@ mod tests { assert!(SecondCrowdfundingError::EventSoldOut < SecondCrowdfundingError::EventExpired); } } + +#[contracterror] +#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] +#[repr(u32)] +pub enum EventError { + EventNotFound = 1, + EventExpired = 2, + EventNotActive = 3, +} diff --git a/contract/contract/src/crowdfunding.rs b/contract/contract/src/crowdfunding.rs index ac13dc0..9aee6fb 100644 --- a/contract/contract/src/crowdfunding.rs +++ b/contract/contract/src/crowdfunding.rs @@ -2,16 +2,16 @@ use soroban_sdk::{contract, contractimpl, Address, BytesN, Env, String, Vec}; use crate::base::{ - errors::{CrowdfundingError, SecondCrowdfundingError}, + errors::{CrowdfundingError, EventError, SecondCrowdfundingError}, events, reentrancy::{ acquire_emergency_lock, reentrancy_lock_logic, release_emergency_lock, release_pool_lock, }, types::{ CampaignDetails, CampaignLifecycleStatus, CampaignMetrics, Contribution, - EmergencyWithdrawal, MultiSigConfig, PoolConfig, PoolContribution, PoolMetadata, - PoolMetrics, PoolState, StorageKey, MAX_DESCRIPTION_LENGTH, MAX_HASH_LENGTH, - MAX_STRING_LENGTH, MAX_URL_LENGTH, + EmergencyWithdrawal, Event, EventStatus, MultiSigConfig, PoolConfig, PoolContribution, + PoolMetadata, PoolMetrics, PoolState, StorageKey, Ticket, TicketType, + MAX_DESCRIPTION_LENGTH, MAX_HASH_LENGTH, MAX_STRING_LENGTH, MAX_URL_LENGTH, }, }; use crate::interfaces::crowdfunding::CrowdfundingTrait; diff --git a/contract/contract/src/interfaces/crowdfunding.rs b/contract/contract/src/interfaces/crowdfunding.rs index 5d21f8d..3c396cd 100644 --- a/contract/contract/src/interfaces/crowdfunding.rs +++ b/contract/contract/src/interfaces/crowdfunding.rs @@ -1,10 +1,10 @@ use soroban_sdk::{Address, BytesN, Env, String, Vec}; use crate::base::{ - errors::CrowdfundingError, + errors::{CrowdfundingError, EventError}, types::{ - CampaignDetails, CampaignLifecycleStatus, PoolConfig, PoolContribution, PoolMetadata, - PoolState, + CampaignDetails, CampaignLifecycleStatus, Event, PoolConfig, PoolContribution, + PoolMetadata, PoolState, TicketType, }, };