Skip to content

Commit

Permalink
workspace-optimizer happy
Browse files Browse the repository at this point in the history
  • Loading branch information
MightOfOaks committed Sep 14, 2023
1 parent abe6eb6 commit ccc44d7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 46 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ serde_json = "1.0"
env_logger = "0.9.0"
test-context = "0.1.4"
once_cell = "1.13.0"
rand = "0.8"
rand = "0.8.5"
itertools = "0.10.5"

[profile.release]
Expand Down
2 changes: 0 additions & 2 deletions contracts/vip/minter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ cw721-base = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
sg-multi-test = { workspace = true }
sg-std = { workspace = true }
sg-name = "1.2.5"
stargaze-vip-collection = { path = "../collection", features = ["library"] }

[dev-dependencies]
Expand Down
44 changes: 2 additions & 42 deletions contracts/vip/minter/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ use std::env;
use cosmwasm_std::entry_point;
use cosmwasm_std::{
ensure, instantiate2_address, to_binary, Addr, Binary, CodeInfoResponse, ContractInfoResponse,
Deps, DepsMut, Env, Event, MessageInfo, Response, StdError, StdResult, Timestamp, Uint128, WasmMsg,
Deps, DepsMut, Env, Event, MessageInfo, Response, StdError, StdResult, Timestamp, Uint128,
WasmMsg,
};
use cw2::set_contract_version;

Expand Down Expand Up @@ -250,45 +251,4 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {

#[cfg(test)]
mod tests {
use crate::msg::InstantiateMsg;
use cosmwasm_std::{to_binary, Addr, Event, WasmMsg, Empty};
use cw_multi_test::{App, Contract, ContractWrapper, Executor};

fn minter_contract() -> Box<dyn Contract<Empty>> {
let contract = ContractWrapper::new(super::instantiate, super::execute, super::query);
Box::new(contract)
}

fn collection_contract() -> Box<dyn Contract<Empty>> {
let contract = ContractWrapper::new(
stargaze_vip_collection::contract::execute,
stargaze_vip_collection::contract::instantiate,
stargaze_vip_collection::contract::query,
);
Box::new(contract)
}
#[test]
fn try_instantiate() {
let mut app = App::default();
let minter_code_id = app.store_code(minter_contract());
let collection_code_id = app.store_code(collection_contract());

let creator = Addr::unchecked("creator");

let init_msg = InstantiateMsg {
collection_code_id,
update_interval: 100,
};
let msg = WasmMsg::Instantiate {
admin: None,
code_id: minter_code_id,
msg: to_binary(&init_msg).unwrap(),
funds: vec![],
label: "vip-minter".to_string(),
};
let response = app.execute(creator, msg.into());

assert!(response.is_ok());
assert!(response.unwrap().has_event(&Event::new("instantiate")));
}
}

0 comments on commit ccc44d7

Please sign in to comment.