Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex6323 committed Jul 3, 2024
1 parent 6482d67 commit 220d542
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,15 @@ pub(crate) async fn outputs() -> anyhow::Result<Vec<(OutputHeader, Output)>> {
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);
Expand All @@ -70,10 +73,8 @@ pub(crate) async fn outputs() -> anyhow::Result<Vec<(OutputHeader, Output)>> {
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 => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ pub async fn add_snapshot_test_outputs<P: AsRef<Path> + 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::<u64>();
Expand Down

0 comments on commit 220d542

Please sign in to comment.