Skip to content

Commit

Permalink
Bump deps and cleanup migration (#432)
Browse files Browse the repository at this point in the history
* Bump minor cw version.

* Update optimizer and rust version.

* Mars ver to 2.1.0, cleanup migrations, fix clippy.
  • Loading branch information
piobab authored Aug 19, 2024
1 parent 3e01592 commit cb42c74
Show file tree
Hide file tree
Showing 82 changed files with 148 additions and 1,852 deletions.
151 changes: 75 additions & 76 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ members = [
]

[workspace.package]
version = "2.0.0"
version = "2.1.0"
authors = [
"Gabe R. <[email protected]>",
"Larry Engineer <[email protected]>",
"Piotr B. <[email protected]>",
"Piotr B. <[email protected]>",
"Bob v.d. H. <[email protected]>",
"Mark Watney <[email protected]>",
"Gabe R. <[email protected]>",
"Larry Engineer <[email protected]>",
"Spike Spiegel <[email protected]>",
"Brianna M. <[email protected]>",
"Ahmad Kaouk",
Expand All @@ -64,8 +64,8 @@ apollo-utils = "0.1.2"
astroport = "2.8.0"
astroport-v5 = { package = "astroport", version = "5.2.0" }
bech32 = "0.11.0"
cosmwasm-schema = "1.5.5"
cosmwasm-std = "1.5.5"
cosmwasm-schema = "1.5.7"
cosmwasm-std = "1.5.7"
cw2 = "1.1.2"
cw721 = { git = "https://github.com/CosmWasm/cw-nfts/", branch = "main" }
cw721-base = { git = "https://github.com/CosmWasm/cw-nfts/", branch = "main", features = ["library"] }
Expand Down
6 changes: 3 additions & 3 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ default_to_workspace = false
# Directory with wasm files used by integration tests (another directory can be used instead, for example 'artifacts' from rust-optimizer)
ARTIFACTS_DIR_PATH = "target/wasm32-unknown-unknown/release"
# If you bump this version, verify RUST_VERSION correctness
RUST_OPTIMIZER_VERSION = "0.15.1"
# Use rust version from rust-optimizer Dockerfile (see https://github.com/CosmWasm/optimizer/blob/v0.15.1/Dockerfile#L1)
RUST_OPTIMIZER_VERSION = "0.16.0"
# Use rust version from rust-optimizer Dockerfile (see https://github.com/CosmWasm/optimizer/blob/v0.16.0/Dockerfile#L1)
# to be sure that we compile / test against the same version
RUST_VERSION = "1.75.0"
RUST_VERSION = "1.78.0"

[tasks.install-stable]
script = '''
Expand Down
13 changes: 1 addition & 12 deletions contracts/account-nft/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ use cosmwasm_std::{
};
use cw2::set_contract_version;
use cw721_base::Cw721Contract;
use mars_types::account_nft::{ExecuteMsg, InstantiateMsg, MigrateV1ToV2, NftConfig, QueryMsg};
use mars_types::account_nft::{ExecuteMsg, InstantiateMsg, NftConfig, QueryMsg};

use crate::{
error::ContractError,
execute::{burn, mint, update_config},
migrations::{self},
query::{query_config, query_next_id},
state::{CONFIG, NEXT_ID},
};
Expand Down Expand Up @@ -68,11 +67,6 @@ pub fn execute(
ExecuteMsg::Burn {
token_id,
} => burn(deps, env, info, token_id),
ExecuteMsg::Migrate(msg) => match msg {
MigrateV1ToV2::BurnEmptyAccounts {
limit,
} => migrations::v2_0_0::burn_empty_accounts(deps, limit),
},
_ => Parent::default().execute(deps, env, info, msg.try_into()?).map_err(Into::into),
}
}
Expand All @@ -85,8 +79,3 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult<Binary> {
_ => Parent::default().query(deps, env, msg.try_into()?),
}
}

#[cfg_attr(not(feature = "library"), entry_point)]
pub fn migrate(deps: DepsMut, _env: Env, _msg: Empty) -> Result<Response, ContractError> {
migrations::v2_0_0::migrate(deps)
}
1 change: 0 additions & 1 deletion contracts/account-nft/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pub mod contract;
pub mod error;
pub mod execute;
pub mod migrations;
pub mod query;
pub mod state;
1 change: 0 additions & 1 deletion contracts/account-nft/src/migrations/mod.rs

This file was deleted.

138 changes: 0 additions & 138 deletions contracts/account-nft/src/migrations/v2_0_0.rs

This file was deleted.

18 changes: 1 addition & 17 deletions contracts/account-nft/tests/tests/helpers/mock_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use mars_mock_credit_manager::msg::ExecuteMsg::SetAccountKindResponse;
use mars_mock_rover_health::msg::ExecuteMsg::SetHealthResponse;
use mars_types::{
account_nft::{
ExecuteMsg, ExecuteMsg::UpdateConfig, MigrateV1ToV2, NftConfigUpdates, QueryMsg,
UncheckedNftConfig,
ExecuteMsg, ExecuteMsg::UpdateConfig, NftConfigUpdates, QueryMsg, UncheckedNftConfig,
},
health::{AccountKind, HealthValuesResponse},
};
Expand Down Expand Up @@ -154,21 +153,6 @@ impl MockEnv {
)
}

pub fn burn_empty_accounts(
&mut self,
sender: &Addr,
limit: Option<u32>,
) -> AnyResult<AppResponse> {
self.app.execute_contract(
sender.clone(),
self.nft_contract.clone(),
&ExecuteMsg::Migrate(MigrateV1ToV2::BurnEmptyAccounts {
limit,
}),
&[],
)
}

pub fn propose_new_minter(
&mut self,
sender: &Addr,
Expand Down
2 changes: 0 additions & 2 deletions contracts/account-nft/tests/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
mod helpers;

mod test_burn_allowance;
mod test_burn_empty_accounts;
mod test_instantiate;
mod test_migration;
mod test_mint;
mod test_proposed_minter;
mod test_update_config;
Loading

0 comments on commit cb42c74

Please sign in to comment.