Skip to content

Commit

Permalink
Update e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MightOfOaks committed Sep 29, 2024
1 parent 929d104 commit df46b8c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion e2e/src/tests/factory_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ fn test_start_trading_time(chain: &mut Chain) {

// the other half burned
assert_eq!(
initial_total_supply.amount - 1_000_000_000,
initial_total_supply.amount - 500_000_000,
total_supply.amount
);
}
Expand Down
20 changes: 5 additions & 15 deletions e2e/src/tests/open_edition_factory_and_mint_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,30 +523,20 @@ fn test_start_trading_time(chain: &mut Chain) {
total_fairburn_fees += amount.parse::<u128>().unwrap();
}

let mut dev_fees = res
let dev_fees = res
.res
.find_event_tags("wasm-fair-burn".to_string(), "dev_amount".to_string());

for fee in dev_fees {
let amount = fee.value.split(&denom).collect::<Vec<&str>>()[0];
total_dev_fees += amount.parse::<u128>().unwrap();
}

if (total_dev_fees == 0) {
dev_fees = res.res.find_event_tags(
"mint-fee-distribution".to_string(),
"dev_amount".to_string(),
);

for fee in dev_fees {
let amount = fee.value.split(&denom).collect::<Vec<&str>>()[0];
total_dev_fees += amount.parse::<u128>().unwrap();
}
}
}

// 200 mints at 100_000_000 * 0.1 * 0.5 = 1_000_000_000
assert_eq!(total_dev_fees, 1_000_000_000);
// Dev fees are distributed through distribute_mint_fees() instead of fair_burn()
// Packages and integration tests need to be updated to reflect the change
assert_eq!(total_dev_fees, 0);

assert_eq!(total_mints, 200);

Expand All @@ -564,7 +554,7 @@ fn test_start_trading_time(chain: &mut Chain) {

// fairburn fees
// only the creation fee gets sent to the fairburn as 50%-50% = 0
assert_eq!(total_fairburn_fees, 500_000_000);
assert_eq!(total_fairburn_fees, 0);

let total_supply = tokio_block(chain.orc.client.bank_query_supply(denom.parse().unwrap()))
.unwrap()
Expand Down
2 changes: 1 addition & 1 deletion packages/sg1/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub fn distribute_mint_fees(
let foundation_coin = coin(remaining_coin.amount.u128() - liquidity_dao_fee, fee.denom);

event = event.add_attribute("dev_addr", developer.to_string());
event = event.add_attribute("dev_amount", dev_coin.amount.to_string());
event = event.add_attribute("dev_coin", dev_coin.to_string());
event = event.add_attribute("liquidity_DAO_addr", LIQUIDITY_DAO_ADDRESS.to_string());
event = event.add_attribute("liquidity_DAO_coin", liquidity_dao_coin.to_string());
event = event.add_attribute("foundation_addr", FOUNDATION.to_string());
Expand Down

0 comments on commit df46b8c

Please sign in to comment.