Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix miss named var #114

Merged
merged 2 commits into from
Feb 8, 2024
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
4 changes: 2 additions & 2 deletions cep18/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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}"),
Expand Down
4 changes: 2 additions & 2 deletions tests/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand All @@ -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(
Expand Down
Loading