Skip to content

Commit

Permalink
fix tests and new artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
betterclever committed Feb 6, 2024
1 parent 243bc7e commit 0b8bee5
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 11 deletions.
8 changes: 4 additions & 4 deletions artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cdcb64a51a7a6e6208b45c51db3b2aeaa6308505a9550b28816a3ea4f1d93c27 dexter_governance_admin-aarch64.wasm
f50af83b0eb2d67404d51e92a1f7d79fcc9483851262d7144dcc88a83a670024 dexter_governance_admin.wasm
774689f84687ebb7997eda9a24f4a88226a993ce43162137215908b19ed2730a dexter_governance_admin-aarch64.wasm
6cfeaf03042728146411c3e4bfc45a8a7815c3b605600a0479b6048d650da289 dexter_governance_admin.wasm
876236658baa72f1ece304cf05135ae1dd67588c374675f60cf9271d58183dec dexter_keeper-aarch64.wasm
dac4e21f06f993a0806e03b74214a2209912692d258fc306f92833b0628dee26 dexter_keeper.wasm
ae5ad3167ef067b2d5c4d453effecec56c4894e93652cab834621ddc6f1d2d89 dexter_multi_staking-aarch64.wasm
a9964f8779b740beb8c170a40876868a8f7bd06f9b5f67bab15adc94b62418ce dexter_multi_staking.wasm
3c72bfdb351dd19521c6c3f397685b1b2821c4c677d9a608c8c847bb6750910e dexter_multi_staking-aarch64.wasm
f1c198cb84f88592650649ae179f12f69ea792fd9cf425d95f27a5b7f1e35a03 dexter_multi_staking.wasm
a23ef63a189376be029d0504701ba5a91e5ecf88372825cdb0bee13b63d6cd75 dexter_router-aarch64.wasm
14650a04274408ad1c28c9cf31711b99be8aa6ddb3aafffe375155c5af8815c7 dexter_router.wasm
4d2185b233ea81d17fcf93522e1c047861d1658d0e3decae918491f06ac7e3db dexter_vault-aarch64.wasm
Expand Down
4 changes: 2 additions & 2 deletions artifacts/checksums_intermediate.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
c3cecd0fcb554a14f709d8a714fbbf23db011fe456fb6954c31f76cbda4e2b27 target/wasm32-unknown-unknown/release/dexter_governance_admin.wasm
90e1838f76e6f68b2be068d46df5e6d5a328319b7a132be9e6f2e781fe5b22ac target/wasm32-unknown-unknown/release/dexter_governance_admin.wasm
d07c8ec78fdb3fe52f1f5706bf9eb2235efe7e660e4d45f8f58d5be5d55db5c7 target/wasm32-unknown-unknown/release/dexter_keeper.wasm
0c5a5eda9c5dfc85d063f62b633e4213b38f67300a7d25c8f894fd6f4a9d9af0 target/wasm32-unknown-unknown/release/dexter_multi_staking.wasm
d69e51ef09a756dd77be13726ae08e06f133fd39cb23cc60b6e411d54dcf4843 target/wasm32-unknown-unknown/release/dexter_multi_staking.wasm
22c2d5954d08136dbc16c77bfcf5cc101b72747934262b366f1d6e4198b6e164 target/wasm32-unknown-unknown/release/dexter_router.wasm
bd3c2bcae0be79d586f64eb5bc4d8c331c3d1f8c7862420a545ac6ea8412f39d target/wasm32-unknown-unknown/release/dexter_vault.wasm
7034b5d149df88dc74c735609051ee33515960e3ceac346d78a67c911c1dc770 target/wasm32-unknown-unknown/release/lp_token.wasm
Expand Down
Binary file modified artifacts/dexter_governance_admin-aarch64.wasm
Binary file not shown.
Binary file modified artifacts/dexter_governance_admin.wasm
Binary file not shown.
Binary file modified artifacts/dexter_multi_staking-aarch64.wasm
Binary file not shown.
Binary file modified artifacts/dexter_multi_staking.wasm
Binary file not shown.
31 changes: 26 additions & 5 deletions contracts/multi_staking/tests/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ use dexter::{
};

use crate::utils::{
assert_user_lp_token_balance, bond_lp_tokens, claim_creator_rewards, create_dummy_cw20_token,
create_reward_schedule, disallow_lp_token, mint_cw20_tokens_to_addr, mint_lp_tokens_to_addr,
mock_app, query_balance, query_bonded_lp_tokens, query_cw20_balance, query_token_locks,
query_unclaimed_rewards, setup, setup_generic, store_cw20_contract, unbond_lp_tokens,
unlock_lp_tokens, withdraw_unclaimed_rewards,
assert_user_lp_token_balance, bond_lp_tokens, claim_creator_rewards, create_dummy_cw20_token, create_reward_schedule, disallow_lp_token, mint_cw20_tokens_to_addr, mint_lp_tokens_to_addr, mock_app, query_balance, query_bonded_lp_tokens, query_cw20_balance, query_token_locks, query_unclaimed_rewards, setup, setup_generic, store_cw20_contract, unbond_lp_tokens, unlock_lp_tokens, whitelist_cw20_token_for_rewards, withdraw_unclaimed_rewards
};
pub mod utils;

Expand Down Expand Up @@ -1021,6 +1017,31 @@ fn test_create_cw20_reward_schedule() {
1000_302_000,
);

assert!(result.is_err());

// whitelist cw20 token for rewards
whitelist_cw20_token_for_rewards(
&mut app,
&admin_addr,
&multi_staking_instance,
&cw20_token_addr,
);

// create again
let result = create_reward_schedule(
&mut app,
&admin_addr,
&multi_staking_instance,
&lp_token_addr,
"CW20 reward schedule".to_string(),
AssetInfo::Token {
contract_addr: cw20_token_addr.clone(),
},
Uint128::from(100_000_000u64),
1000_301_000,
1000_302_000,
);

assert!(result.is_ok());

// mint lp tokens to user 1
Expand Down
17 changes: 17 additions & 0 deletions contracts/multi_staking/tests/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ pub fn mint_lp_tokens_to_addr(
.unwrap();
}

pub fn whitelist_cw20_token_for_rewards(
app: &mut App,
admin_addr: &Addr,
multistaking_contract: &Addr,
cw20_addr: &Addr,
) {
app.execute_contract(
admin_addr.clone(),
multistaking_contract.clone(),
&ExecuteMsg::AllowRewardCw20Token {
addr: cw20_addr.clone(),
},
&vec![],
)
.unwrap();
}

pub fn mint_cw20_tokens_to_addr(
app: &mut App,
admin_addr: &Addr,
Expand Down

0 comments on commit 0b8bee5

Please sign in to comment.