diff --git a/contracts/proposal/dao-proposal-single/src/testing/do_votes.rs b/contracts/proposal/dao-proposal-single/src/testing/do_votes.rs index ecd72e325..a97e23c23 100644 --- a/contracts/proposal/dao-proposal-single/src/testing/do_votes.rs +++ b/contracts/proposal/dao-proposal-single/src/testing/do_votes.rs @@ -1,7 +1,7 @@ -use cosmwasm_std::{coins, Addr, Uint128}; +use cosmwasm_std::{coins, Addr, Coin, Uint128}; use cw20::Cw20Coin; -use cw_multi_test::{App, BankSudo, Executor}; +use cw_multi_test::{App, BankSudo, Executor, SudoMsg}; use dao_interface::state::ProposalModule; use dao_pre_propose_single as cppbps; @@ -96,6 +96,17 @@ where { let mut app = App::default(); + // Mint some ujuno so that it exists for native staking tests + // Otherwise denom validation will fail + app.sudo(SudoMsg::Bank(BankSudo::Mint { + to_address: "sodenomexists".to_string(), + amount: vec![Coin { + amount: Uint128::new(10), + denom: "ujuno".to_string(), + }], + })) + .unwrap(); + let mut initial_balances = votes .iter() .map(|TestSingleChoiceVote { voter, weight, .. }| Cw20Coin { diff --git a/contracts/voting/dao-voting-native-staked/src/tests.rs b/contracts/voting/dao-voting-native-staked/src/tests.rs index cb45c8594..52e6d0023 100644 --- a/contracts/voting/dao-voting-native-staked/src/tests.rs +++ b/contracts/voting/dao-voting-native-staked/src/tests.rs @@ -1046,7 +1046,7 @@ fn test_active_threshold_percent_rounds_up() { #[test] fn test_active_threshold_none() { - let mut app = App::default(); + let mut app = mock_app(); let staking_id = app.store_code(staking_contract()); let addr = instantiate_staking( &mut app, @@ -1140,7 +1140,7 @@ fn test_update_active_threshold() { #[test] #[should_panic(expected = "Active threshold percentage must be greater than 0 and less than 1")] fn test_active_threshold_percentage_gt_100() { - let mut app = App::default(); + let mut app = mock_app(); let staking_id = app.store_code(staking_contract()); instantiate_staking( &mut app, @@ -1158,7 +1158,7 @@ fn test_active_threshold_percentage_gt_100() { #[test] #[should_panic(expected = "Active threshold percentage must be greater than 0 and less than 1")] fn test_active_threshold_percentage_lte_0() { - let mut app = App::default(); + let mut app = mock_app(); let staking_id = app.store_code(staking_contract()); instantiate_staking( &mut app, @@ -1176,7 +1176,7 @@ fn test_active_threshold_percentage_lte_0() { #[test] #[should_panic(expected = "Absolute count threshold cannot be greater than the total token supply")] fn test_active_threshold_absolute_count_invalid() { - let mut app = App::default(); + let mut app = mock_app(); let staking_id = app.store_code(staking_contract()); instantiate_staking( &mut app, @@ -1185,7 +1185,7 @@ fn test_active_threshold_absolute_count_invalid() { denom: DENOM.to_string(), unstaking_duration: Some(Duration::Height(5)), active_threshold: Some(ActiveThreshold::AbsoluteCount { - count: Uint128::new(301), + count: Uint128::new(3000000000000000000), }), }, ); @@ -1193,7 +1193,7 @@ fn test_active_threshold_absolute_count_invalid() { #[test] fn test_add_remove_hooks() { - let mut app = App::default(); + let mut app = mock_app(); let staking_id = app.store_code(staking_contract()); let addr = instantiate_staking( &mut app,