Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
TropicalDog17 committed Nov 22, 2023
1 parent da2d02a commit 42f583c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 25 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
# IDEs
*.iml
.idea

# optimization artifacts
artifacts/
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,5 @@ cw2 = "1.1.1"
schemars = "0.8.15"
serde = { version = "1.0.189", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.49" }

[dev-dependencies]
cw-multi-test = "0.18.0"
3 changes: 2 additions & 1 deletion src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ pub mod execute {
}
pub fn astro_exec(deps: DepsMut, info: MessageInfo) -> Result<Response, ContractError> {
let inj_amount = cw_utils::must_pay(&info, "inj")?.u128();

// Pair of hINJ-INJ on testnet
let pair = "inj1relf3d6yh2e6arv84gaajawskttdq3vptn8qrs";
let swap_astro_msg = pair::ExecuteMsg::Swap {
Expand All @@ -85,7 +86,7 @@ pub mod execute {
max_spread: Some(Decimal::percent(50)),
to: None,
};
assert!(inj_amount > 0);

let exec_cw20_mint_msg = WasmMsg::Execute {
contract_addr: pair.into(),
msg: to_json_binary(&swap_astro_msg)?,
Expand Down
23 changes: 0 additions & 23 deletions src/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ mod tests {
.unwrap();
})
}
fn mock_deps_with_query() -> OwnedDeps<MockStorage, MockApi, MockQuerier, Empty> {
let mock_querier = MockQuerier::<Empty>::new(&[]);
OwnedDeps {
storage: MockStorage::default(),
api: MockApi::default(),
querier: mock_querier,
custom_query_type: PhantomData,
}
}
fn proper_instantiate() -> (App, CwTemplateContract) {
let mut app = mock_app();
let cw_template_id = app.store_code(contract_template());
Expand All @@ -67,18 +58,4 @@ mod tests {

(app, cw_template_contract)
}

mod count {
use super::*;
use crate::msg::ExecuteMsg;

#[test]
fn count() {
let (mut app, cw_template_contract) = proper_instantiate();

let msg = ExecuteMsg::Increment {};
let cosmos_msg = cw_template_contract.call(msg).unwrap();
app.execute(Addr::unchecked(USER), cosmos_msg).unwrap();
}
}
}

0 comments on commit 42f583c

Please sign in to comment.