Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions contract/contract/src/base/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
8 changes: 4 additions & 4 deletions contract/contract/src/crowdfunding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions contract/contract/src/interfaces/crowdfunding.rs
Original file line number Diff line number Diff line change
@@ -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,
},
};

Expand Down
Loading