Skip to content

Commit

Permalink
fix: conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
crnbarr93 committed Nov 19, 2024
1 parent 4474cef commit f86d174
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
9 changes: 0 additions & 9 deletions contracts/non-fungible-tokens/andromeda-crowdfund/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,6 @@ impl MockCrowdfund {
self.query(app, msg)
}

<<<<<<< HEAD
pub fn query_tiers(&self, app: &mut MockApp) -> TiersResponse {
let msg = QueryMsg::Tiers {
start_after: None,
limit: None,
order_by: None,
};
=======
pub fn query_tiers(
&self,
app: &mut MockApp,
Expand All @@ -115,7 +107,6 @@ impl MockCrowdfund {
order_by: Option<OrderBy>,
) -> TiersResponse {
let msg = mock_query_tiers_msg(start_after, limit, order_by);
>>>>>>> 60d6ca65 (fix: amount sold incorrect for tiers with limits (#603))
self.query(app, msg)
}
}
Expand Down
11 changes: 0 additions & 11 deletions contracts/non-fungible-tokens/andromeda-crowdfund/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,7 @@ pub(crate) fn get_tiers(
.take(limit)
.map(|v| {
let (level, tier) = v?;
<<<<<<< HEAD
let sold_amount = TIER_SALES.load(storage, level).unwrap_or_default();
=======
let sold_amount = TIER_SALES.may_load(storage, level)?.unwrap_or_default();
>>>>>>> 60d6ca65 (fix: amount sold incorrect for tiers with limits (#603))
Ok(TierResponseItem { tier, sold_amount })
})
.collect()
Expand Down Expand Up @@ -219,18 +215,11 @@ pub(crate) fn set_tier_orders(
.unwrap_or_default();
sold_amount = sold_amount.checked_add(new_order.amount)?;
if let Some(limit) = tier.limit {
<<<<<<< HEAD
ensure!(limit > sold_amount, ContractError::PurchaseLimitReached {});
}
update_tier(storage, &tier)?;
set_tier_sales(storage, new_order.level.into(), sold_amount)?;

=======
ensure!(limit >= sold_amount, ContractError::PurchaseLimitReached {});
}
update_tier(storage, &tier)?;
set_tier_sales(storage, new_order.level.into(), sold_amount)?;
>>>>>>> 60d6ca65 (fix: amount sold incorrect for tiers with limits (#603))
let mut order = TIER_ORDERS
.load(storage, (new_order.orderer.clone(), new_order.level.into()))
.unwrap_or_default();
Expand Down
4 changes: 2 additions & 2 deletions tests-integration/tests/crowdfund_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ fn test_successful_crowdfund_app_native(setup: TestCase) {
assert_eq!(summary.current_capital, 0);
assert_eq!(summary.current_stage, CampaignStage::ONGOING.to_string());

let tiers = crowdfund.query_tiers(&mut router).tiers;
let tiers = crowdfund.query_tiers(&mut router, None, None, None).tiers;
assert_eq!(tiers.len(), 2);

// Purchase tiers
Expand Down Expand Up @@ -679,7 +679,7 @@ fn test_successful_crowdfund_app_cw20(#[with(false)] setup: TestCase) {
assert_eq!(summary.current_capital, 0);
assert_eq!(summary.current_stage, CampaignStage::ONGOING.to_string());

let tiers = crowdfund.query_tiers(&mut router).tiers;
let tiers = crowdfund.query_tiers(&mut router, None, None, None).tiers;
assert_eq!(tiers.len(), 2);

// Purchase tiers
Expand Down

0 comments on commit f86d174

Please sign in to comment.