From 220d54279bb3df1f5758c2c387bab2ffa6a979b7 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Wed, 3 Jul 2024 15:15:27 +0200 Subject: [PATCH] review --- .../stardust/test_outputs/alias_ownership.rs | 21 ++++++++++--------- .../src/stardust/test_outputs/mod.rs | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/crates/iota-genesis-builder/src/stardust/test_outputs/alias_ownership.rs b/crates/iota-genesis-builder/src/stardust/test_outputs/alias_ownership.rs index 9a784fa486f..eab738f1d31 100644 --- a/crates/iota-genesis-builder/src/stardust/test_outputs/alias_ownership.rs +++ b/crates/iota-genesis-builder/src/stardust/test_outputs/alias_ownership.rs @@ -47,12 +47,15 @@ pub(crate) async fn outputs() -> anyhow::Result> { for alias_owner in alias_owners { let alias_output_header = random_output_header(&mut rng); - let alias_output = AliasOutputBuilder::new_with_amount(1_000_000, AliasId::new(rng.gen())) - .add_unlock_condition(GovernorAddressUnlockCondition::new(alias_owner)) - .add_unlock_condition(StateControllerAddressUnlockCondition::new(alias_owner)) - .finish() - .unwrap(); - let alias_address = alias_output.alias_address(&alias_output_header.output_id()); + let alias_output = AliasOutputBuilder::new_with_amount( + 1_000_000, + (&alias_output_header.output_id()).into(), + ) + .add_unlock_condition(GovernorAddressUnlockCondition::new(alias_owner)) + .add_unlock_condition(StateControllerAddressUnlockCondition::new(alias_owner)) + .finish() + .unwrap(); + let alias_address = AliasAddress::new(*alias_output.alias_id()); // let this alias own various other assets, that may themselves own other assets let max_depth = rng.gen_range(1usize..5); @@ -70,10 +73,8 @@ pub(crate) async fn outputs() -> anyhow::Result> { 0 => { // alias let (output_header, alias) = random_alias_output(&mut rng, owning_addr); - owning_addresses.push_back(( - depth + 1, - alias.alias_address(&output_header.output_id()).into(), - )); + owning_addresses + .push_back((depth + 1, AliasAddress::new(*alias.alias_id()).into())); outputs.push((output_header, alias.into())); } 1 => { diff --git a/crates/iota-genesis-builder/src/stardust/test_outputs/mod.rs b/crates/iota-genesis-builder/src/stardust/test_outputs/mod.rs index 75492767b0f..a530daa9283 100644 --- a/crates/iota-genesis-builder/src/stardust/test_outputs/mod.rs +++ b/crates/iota-genesis-builder/src/stardust/test_outputs/mod.rs @@ -75,10 +75,10 @@ pub async fn add_snapshot_test_outputs + core::fmt::Debug, const let mut vested_index = u32::MAX; let new_outputs = [ + alias_ownership::outputs().await?, stardust_mix::outputs(&mut vested_index).await?, vesting_schedule_entity::outputs(&mut vested_index).await?, vesting_schedule_iota_airdrop::outputs(&mut vested_index).await?, - alias_ownership::outputs().await?, ] .concat(); let new_amount = new_outputs.iter().map(|o| o.1.amount()).sum::();