-
Notifications
You must be signed in to change notification settings - Fork 18
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(genesis-builder): Always destroy allocation objects when picked #5028
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 4 Skipped Deployments
|
Data::Move(_) => GasCoin::try_from(&object) | ||
.map(|gas| gas.value()) | ||
.or_else(|_| TimeLock::<Balance>::try_from(&object).map(|t| t.locked().value())) | ||
.or_else(|_| AliasOutput::try_from(&object).map(|a| a.balance.value())) | ||
.or_else(|_| BasicOutput::try_from(&object).map(|b| b.balance.value())) | ||
.or_else(|_| NftOutput::try_from(&object).map(|n| n.balance.value())) | ||
.unwrap_or(0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance we can avoid this by checking a type byte or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That object
is encoded through a Move Struct, so unfortunately I don't see an easy change to support a type byte.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yaay, it worked! 🎉
Total Number of Validators: 4
Total Number of Migration Objects: 4561398
Total Number of Objects/Packages: 4561441
Total Supply of Iota: 4600000000000000000 NANOS or 4600000000 IOTA
Total Amount of StakedIota: 45000000000000000 NANOS or 45000000 IOTA
…5028) * fix: examine genesis checkpoint * chore: clippy and fmt * refactor: is_maybe to try_from * chore: remove unused functions * refactor: remove unwrap from func * chore: remove unused to_bytes funcs * chore: cargo fmt * chore: correct spelling * fix(genesis-inspector): consider TimelockedStakedIota as a stake * feat(genesis-builder): validate migration objects after build * fix(genesis-builder): always destroy allocation objects when picked * revert changes to pick_objects_for_allocation * fix(iota-genesis-builder): destroy timelocks after split PTB * fix(migration_tx_data): add timelock gas balance check --------- Co-authored-by: nonast <29281463+nonast@users.noreply.github.com>
…5028) * fix: examine genesis checkpoint * chore: clippy and fmt * refactor: is_maybe to try_from * chore: remove unused functions * refactor: remove unwrap from func * chore: remove unused to_bytes funcs * chore: cargo fmt * chore: correct spelling * fix(genesis-inspector): consider TimelockedStakedIota as a stake * feat(genesis-builder): validate migration objects after build * fix(genesis-builder): always destroy allocation objects when picked * revert changes to pick_objects_for_allocation * fix(iota-genesis-builder): destroy timelocks after split PTB * fix(migration_tx_data): add timelock gas balance check --------- Co-authored-by: nonast <29281463+nonast@users.noreply.github.com>
…5028) (#5081) * fix: examine genesis checkpoint * chore: clippy and fmt * refactor: is_maybe to try_from * chore: remove unused functions * refactor: remove unwrap from func * chore: remove unused to_bytes funcs * chore: cargo fmt * chore: correct spelling * fix(genesis-inspector): consider TimelockedStakedIota as a stake * feat(genesis-builder): validate migration objects after build * fix(genesis-builder): always destroy allocation objects when picked * revert changes to pick_objects_for_allocation * fix(iota-genesis-builder): destroy timelocks after split PTB * fix(migration_tx_data): add timelock gas balance check --------- Co-authored-by: Mirko Zichichi <miker83z@proton.me> Co-authored-by: nonast <29281463+nonast@users.noreply.github.com>
Description of change
Fixes #5024 (it also adds a validation of the migrated objects after the genesis build)
Type of change
How the change has been tested
cargo run --release --bin iota genesis-ceremony build-unsigned-checkpoint --local-migration-snapshots stardust_object_snapshot.bin
Change checklist