From 1b1bf17e25d0b24955ebd88a59276dad1a6733d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n?= <30974986+deuszex@users.noreply.github.com> Date: Thu, 8 Feb 2024 16:37:34 +0100 Subject: [PATCH 1/2] fix miss named var --- cep18/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cep18/src/main.rs b/cep18/src/main.rs index 1876451..87ef439 100644 --- a/cep18/src/main.rs +++ b/cep18/src/main.rs @@ -369,7 +369,7 @@ pub fn upgrade(name: &str) { .map(ContractPackageHash::new) .unwrap_or_revert_with(Cep18Error::MissingPackageHashForUpgrade); - let previous_contract_version = runtime::get_key(&format!("{CONTRACT_NAME_PREFIX}{name}")) + let previous_contract_hash = runtime::get_key(&format!("{CONTRACT_NAME_PREFIX}{name}")) .unwrap_or_revert() .into_hash() .map(ContractHash::new) @@ -378,7 +378,7 @@ pub fn upgrade(name: &str) { let (contract_hash, contract_version) = storage::add_contract_version(contract_package_hash, entry_points, NamedKeys::new()); - storage::disable_contract_version(contract_package_hash, previous_contract_version) + storage::disable_contract_version(contract_package_hash, previous_contract_hash) .unwrap_or_revert(); runtime::put_key( &format!("{CONTRACT_NAME_PREFIX}{name}"), From b4c544ad23cf60fb6d5db93632ff53be6763b784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n?= <30974986+deuszex@users.noreply.github.com> Date: Thu, 8 Feb 2024 16:38:42 +0100 Subject: [PATCH 2/2] Update var name --- tests/src/migration.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/migration.rs b/tests/src/migration.rs index 9454076..bb60f8b 100644 --- a/tests/src/migration.rs +++ b/tests/src/migration.rs @@ -26,7 +26,7 @@ fn should_upgrade_contract_version() { .into_t() .unwrap(); - let install_request_1 = ExecuteRequestBuilder::standard( + let upgrade_request = ExecuteRequestBuilder::standard( *DEFAULT_ACCOUNT_ADDR, CEP18_CONTRACT_WASM, runtime_args! { @@ -38,7 +38,7 @@ fn should_upgrade_contract_version() { ) .build(); - builder.exec(install_request_1).expect_success().commit(); + builder.exec(upgrade_request).expect_success().commit(); let version_1: u32 = builder .query(