Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions contracts/oracle/osmosis/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ pub mod v1_0_1 {

pub fn migrate(deps: DepsMut) -> ContractResult<Response> {
// make sure we're migrating the correct contract and from the correct version
cw2::assert_contract_version(deps.as_ref().storage, CONTRACT_NAME, FROM_VERSION)?;
cw2::assert_contract_version(
deps.as_ref().storage,
&format!("crates.io:{CONTRACT_NAME}"),
FROM_VERSION,
)?;

// map old owner struct to new one
let old_owner = old_state::OWNER.load(deps.storage)?;
Expand All @@ -32,7 +36,11 @@ pub mod v1_0_1 {
)?;

// update contract version
cw2::set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?;
cw2::set_contract_version(
deps.storage,
format!("crates.io:{CONTRACT_NAME}"),
CONTRACT_VERSION,
)?;

Ok(Response::new()
.add_attribute("action", "migrate")
Expand Down Expand Up @@ -83,7 +91,12 @@ pub mod v1_0_1 {
fn migration_owner_from_state_b() {
let mut deps = mock_dependencies();

cw2::set_contract_version(deps.as_mut().storage, CONTRACT_NAME, FROM_VERSION).unwrap();
cw2::set_contract_version(
deps.as_mut().storage,
format!("crates.io:{CONTRACT_NAME}"),
FROM_VERSION,
)
.unwrap();

old_state::OWNER
.save(
Expand Down Expand Up @@ -113,7 +126,12 @@ pub mod v1_0_1 {
fn migration_owner_from_state_c() {
let mut deps = mock_dependencies();

cw2::set_contract_version(deps.as_mut().storage, CONTRACT_NAME, FROM_VERSION).unwrap();
cw2::set_contract_version(
deps.as_mut().storage,
format!("crates.io:{CONTRACT_NAME}"),
FROM_VERSION,
)
.unwrap();

old_state::OWNER
.save(
Expand Down
3 changes: 2 additions & 1 deletion coverage_grcov.Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ LLVM_PROFILE_FILE = "${COVERAGE_PROF_OUTPUT}/coverage-%p-%m.profraw"
[tasks.install-grcov]
condition = { env_not_set = ["SKIP_INSTALL_GRCOV"] }
private = true
install_crate = { crate_name = "grcov" }
command = "cargo"
args = ["install", "grcov", "--locked"]

[tasks.coverage-grcov]
condition = { rust_version = { min = "1.60.0" } }
Expand Down