Skip to content

Commit

Permalink
change ver 2.1.0 to 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
iboss-ptk committed Jan 18, 2024
1 parent d59b372 commit 76cbea2
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 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 contracts/transmuter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["Supanat Potiwarakorn <[email protected]>"]
edition = "2021"
name = "transmuter"
version = "2.1.0"
version = "3.0.0"

exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
Expand Down
4 changes: 2 additions & 2 deletions contracts/transmuter/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use cosmwasm_std::{
};
use thiserror::Error;

use crate::{math::MathError, migrations::v2_1_0};
use crate::{math::MathError, migrations::v3_0_0};

#[derive(Error, Debug, PartialEq)]
pub enum ContractError {
Expand Down Expand Up @@ -189,5 +189,5 @@ pub enum ContractError {
MathError(#[from] MathError),

#[error("Migration Error: {0}")]
MigrationError(#[from] v2_1_0::MigrationError),
MigrationError(#[from] v3_0_0::MigrationError),
}
4 changes: 2 additions & 2 deletions contracts/transmuter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ mod entry_points {
pub fn migrate(
deps: DepsMut,
_env: Env,
msg: migrations::v2_1_0::MigrateMsg,
msg: migrations::v3_0_0::MigrateMsg,
) -> Result<Response, ContractError> {
migrations::v2_1_0::execute_migration(deps, msg)
migrations::v3_0_0::execute_migration(deps, msg)
}
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/transmuter/src/migrations/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pub mod v2_1_0;
pub mod v3_0_0;
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
};

const FROM_VERSION: &str = "2.0.0";
const TO_VERSION: &str = "2.1.0";
const TO_VERSION: &str = "3.0.0";

#[derive(Error, Debug, PartialEq)]
pub enum MigrationError {
Expand Down Expand Up @@ -61,7 +61,7 @@ pub fn execute_migration(deps: DepsMut, msg: MigrateMsg) -> Result<Response, Con
cw2::set_contract_version(deps.storage, CONTRACT_NAME, TO_VERSION)?;

// Return a response with an attribute indicating the method that was executed
Ok(Response::new().add_attribute("method", "v2_1_0/execute_migraiton"))
Ok(Response::new().add_attribute("method", "v3_0_0/execute_migraiton"))
}

fn add_normalization_factor_to_pool_assets(
Expand Down Expand Up @@ -204,7 +204,7 @@ mod tests {

assert_eq!(
res,
Response::new().add_attribute("method", "v2_1_0/execute_migraiton")
Response::new().add_attribute("method", "v3_0_0/execute_migraiton")
);

let TransmuterPool { pool_assets } = Item::new("pool").load(&deps.storage).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion contracts/transmuter/src/test/cases/units/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fn test_migrate_v2_to_v2_1() {
let t = TransmuterContract::new(&app, code_id, pool_id, contract_address.clone());

// --- migrate pool ---
let migrate_msg = crate::migrations::v2_1_0::MigrateMsg {
let migrate_msg = crate::migrations::v3_0_0::MigrateMsg {
asset_configs: vec![
AssetConfig {
denom: "denom1".to_string(),
Expand Down

0 comments on commit 76cbea2

Please sign in to comment.