-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixups, burning tokens still doesn't work
- Loading branch information
1 parent
0e39a50
commit f2f40b2
Showing
3 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 41 additions & 6 deletions
47
contracts/external/cw-abc/src/test_tube/integration_tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,57 @@ | ||
use crate::msg::ExecuteMsg; | ||
use crate::msg::{ | ||
CommonsPhaseConfigResponse, CurveInfoResponse, DenomResponse, ExecuteMsg, QueryMsg, | ||
}; | ||
|
||
use super::test_env::{TestEnv, TestEnvBuilder}; | ||
|
||
use cosmwasm_std::coins; | ||
use osmosis_test_tube::OsmosisTestApp; | ||
use cw_tokenfactory_issuer::msg::QueryMsg as IssuerQueryMsg; | ||
use osmosis_test_tube::{Account, OsmosisTestApp}; | ||
|
||
#[test] | ||
fn test_happy_path() { | ||
let app = OsmosisTestApp::new(); | ||
|
||
let env = TestEnvBuilder::new(); | ||
let TestEnv { abc, accounts, .. } = env.default_setup(&app); | ||
let builder = TestEnvBuilder::new(); | ||
let env = builder.default_setup(&app); | ||
let TestEnv { | ||
ref abc, | ||
ref accounts, | ||
ref tf_issuer, | ||
.. | ||
} = env; | ||
|
||
// Buy tokens | ||
abc.execute(&ExecuteMsg::Buy {}, &coins(1000000, "uosmo"), &accounts[0]) | ||
.unwrap(); | ||
|
||
// TODO query curve | ||
// Query denom | ||
let denom = tf_issuer | ||
.query::<DenomResponse>(&IssuerQueryMsg::Denom {}) | ||
.unwrap() | ||
.denom; | ||
println!("Denom {:?}", denom); | ||
|
||
// TODO burn | ||
// Query balances | ||
let balances = env.bank().query_all_balances( | ||
&osmosis_test_tube::osmosis_std::types::cosmos::bank::v1beta1::QueryAllBalancesRequest { | ||
address: accounts[0].address(), | ||
pagination: None, | ||
}, | ||
).unwrap(); | ||
println!("{:?}", balances); | ||
|
||
// Query curve | ||
let curve_info: CurveInfoResponse = abc.query(&QueryMsg::CurveInfo {}).unwrap(); | ||
println!("Curve {:?}", curve_info); | ||
|
||
let phase: CommonsPhaseConfigResponse = abc.query(&QueryMsg::PhaseConfig {}).unwrap(); | ||
println!("Phase {:?}", phase); | ||
|
||
// Burn | ||
abc.execute(&ExecuteMsg::Burn {}, &coins(900000, denom), &accounts[0]) | ||
.unwrap(); | ||
|
||
let curve_info: CurveInfoResponse = abc.query(&QueryMsg::CurveInfo {}).unwrap(); | ||
println!("Curve {:?}", curve_info); | ||
} |