Skip to content

Commit

Permalink
fix: calculate address of all contracts during migration
Browse files Browse the repository at this point in the history
  • Loading branch information
lambda-0x committed Apr 12, 2024
1 parent 39ee46b commit ef843e5
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions crates/sozo/ops/src/migration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,20 @@ async fn update_manifests_and_abis(
.find(|c| c.name == output.name.as_ref().unwrap())
.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,
&[],
migration_output.world_address,
));
});

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

View check run for this annotation

Codecov / codecov/patch

crates/sozo/ops/src/migration/mod.rs#L200-L209

Added lines #L200 - L209 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

0 comments on commit ef843e5

Please sign in to comment.