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: calculate address of all contracts during migration #1822

Merged
merged 2 commits into from
Apr 15, 2024
Merged
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
15 changes: 6 additions & 9 deletions crates/sozo/ops/src/migration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,19 +220,17 @@
.find(|c| c.name == output.name)
.expect("contract got migrated, means it should be present here");

let salt = generate_salt(&local.name);
local.inner.address = Some(get_contract_address(
salt,
output.base_class_hash,
&[],
migration_output.world_address,
));

local.inner.base_class_hash = output.base_class_hash;
}
});
}

local_manifest.contracts.iter_mut().for_each(|contract| {
let salt = generate_salt(&contract.name);
contract.inner.address =
Some(get_contract_address(salt, contract.inner.base_class_hash, &[], world_address));
});

Check warning on line 233 in crates/sozo/ops/src/migration/mod.rs

View check run for this annotation

Codecov / codecov/patch

crates/sozo/ops/src/migration/mod.rs#L228-L233

Added lines #L228 - L233 were not covered by tests
// copy abi files from `abi/base` to `abi/deployments/{chain_id}` and update abi path in
// local_manifest
update_manifest_abis(&mut local_manifest, profile_dir, profile_name).await;
Expand Down Expand Up @@ -923,7 +921,6 @@
/// # Returns
/// A [`ResourceData`] object to register in the Dojo resource register
/// on success.
///
async fn upload_on_ipfs_and_create_resource(
ui: &Ui,
element_name: String,
Expand Down
Loading