Skip to content

Commit 67c1f25

Browse files
authored
Merge branch 'main' into update_changelog
2 parents 671491a + a5d3d8d commit 67c1f25

File tree

11 files changed

+26
-705
lines changed

11 files changed

+26
-705
lines changed

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/rewards/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ serde_json = { workspace = true }
4646
thiserror = { workspace = true }
4747

4848
[dev-dependencies]
49+
assert_ok = { workspace = true }
4950
cw-multi-test = "0.15.1"
5051

5152
[lints]

contracts/rewards/src/contract.rs

+15-7
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,15 @@ mod query;
1818

1919
const CONTRACT_NAME: &str = env!("CARGO_PKG_NAME");
2020
const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");
21+
const BASE_VERSION: &str = "1.1.0";
2122

2223
#[cfg_attr(not(feature = "library"), entry_point)]
2324
pub fn migrate(
2425
deps: DepsMut,
2526
_env: Env,
2627
_msg: Empty,
2728
) -> Result<Response, axelar_wasm_std::error::ContractError> {
28-
migrations::v1_0_0::migrate(deps.storage)?;
29-
30-
// any version checks should be done before here
29+
cw2::assert_contract_version(deps.storage, CONTRACT_NAME, BASE_VERSION)?;
3130

3231
cw2::set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?;
3332

@@ -191,7 +190,8 @@ pub fn query(
191190

192191
#[cfg(test)]
193192
mod tests {
194-
use cosmwasm_std::testing::{mock_dependencies, mock_env};
193+
use assert_ok::assert_ok;
194+
use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info};
195195
use cosmwasm_std::{coins, Addr, BlockInfo, Uint128};
196196
use cw_multi_test::{App, ContractWrapper, Executor};
197197
use router_api::ChainName;
@@ -203,9 +203,17 @@ mod tests {
203203
#[test]
204204
fn migrate_sets_contract_version() {
205205
let mut deps = mock_dependencies();
206-
207-
#[allow(deprecated)]
208-
migrations::v1_0_0::tests::instantiate_contract(deps.as_mut(), "denom");
206+
let env = mock_env();
207+
let info = mock_info("instantiator", &[]);
208+
assert_ok!(instantiate(
209+
deps.as_mut(),
210+
env,
211+
info,
212+
InstantiateMsg {
213+
governance_address: "governance".to_string(),
214+
rewards_denom: "uaxl".to_string()
215+
}
216+
));
209217

210218
migrate(deps.as_mut(), mock_env(), Empty {}).unwrap();
211219

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pub mod v1_0_0;
1+

contracts/rewards/src/contract/migrations/v1_0_0.rs

-309
This file was deleted.

contracts/service-registry/src/contract.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ mod query;
1818

1919
const CONTRACT_NAME: &str = env!("CARGO_PKG_NAME");
2020
const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");
21+
const BASE_VERSION: &str = "1.0.0";
2122

2223
#[cfg_attr(not(feature = "library"), entry_point)]
2324
pub fn instantiate(
@@ -191,7 +192,7 @@ pub fn migrate(
191192
_env: Env,
192193
_msg: Empty,
193194
) -> Result<Response, axelar_wasm_std::error::ContractError> {
194-
migrations::v0_4_1::migrate(deps.storage)?;
195+
cw2::assert_contract_version(deps.storage, CONTRACT_NAME, BASE_VERSION)?;
195196

196197
cw2::set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?;
197198

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pub mod v0_4_1;
1+

0 commit comments

Comments
 (0)