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

feat(iota-genesis-builder): Allow Shimmer test outputs generation #1699

Merged
merged 12 commits into from
Aug 14, 2024

Conversation

miker83z
Copy link
Contributor

@miker83z miker83z commented Aug 7, 2024

Description of change

This PR allows to generate a test output snapshot starting from a Shimmer Hornet snapshot.

The generated test output snapshot includes addresses derived with the network coin type (IOTA or Shimmer) and uses the correct network total supply. After this changes, then, it is possible to produce Hornet snapshots containing test outputs able to be given as input to the Move objects snapshot generation script for generating Shimmer and IOTA snapshots.

Links to any relevant issues

Fixes #1660

Type of change

  • Enhancement (a non-breaking change which adds functionality)

How the change has been tested

  1. cargo run --release --example snapshot_only_test_outputs --features="test-outputs" -- iota --snapshot-path ../latest-full_snapshot-iota.bin
  2. cargo run --release --bin iota-genesis-builder -- --disable-global-snapshot-verification iota --snapshot-path ../test-latest-full_snapshot-iota.bin --target-network alphanet-test
  3. cargo run --release --example snapshot_only_test_outputs --features="test-outputs" -- shimmer --snapshot-path ../latest-full_snapshot-shimmer.bin
  4. cargo run --release --bin iota-genesis-builder -- --disable-global-snapshot-verification shimmer --snapshot-path ../test-latest-full_snapshot-shimmer.bin --target-network alphanet-test
  5. target/release/iota genesis --working-dir ../test_iota_config -f --with-faucet --num-validators 4 --local-migration-snapshots ./stardust_object_snapshot-iota.bin ./stardust_object_snapshot-shimmer.bin

Change checklist

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes

@miker83z miker83z added the sc-platform Issues related to the Smart Contract Platform group. label Aug 7, 2024
@miker83z miker83z requested review from lzpap and Thoralf-M August 7, 2024 18:36
@miker83z miker83z self-assigned this Aug 7, 2024
@miker83z miker83z requested a review from kodemartin as a code owner August 7, 2024 18:36
pub(crate) async fn outputs(rng: &mut StdRng) -> anyhow::Result<Vec<(OutputHeader, Output)>> {
pub(crate) async fn outputs(
rng: &mut StdRng,
coin_type: u32,
Copy link
Contributor

@DaughterOfMars DaughterOfMars Aug 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use an enum?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was with the enum before! Pls check this comment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is private testing code, I think it's fair to avoid unnecessary code duplication here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh I think that was a bad change

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree, but as I've said in the original comment, I'm not super strongly opinionated, up to Mirko.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is private testing code

I think this reply is enough 😄

@miker83z
Copy link
Contributor Author

@kodemartin pls merge it when you'll come back, if something should be changed maybe @Thoralf-M or @valeriyr could help you! 😄 🏖️

@kodemartin kodemartin merged commit 324751d into develop Aug 14, 2024
27 of 31 checks passed
@kodemartin kodemartin deleted the sc-platform/shimmer-test-outputs branch August 14, 2024 19:33
bingyanglin pushed a commit that referenced this pull request Aug 19, 2024
)

* feat(iota-genesis-builder): allow shimmer test outputs generation

* fix(iota-genesis-builder): adapt the other example

* fix(iota-genesis-builder): differentiate between shimmer and iota coin type

* fix(iota-genesis-builder): use u32 instead of CoinType

* fix(iota-genesis-builder): fix example about

* fix(iota-genesis-builder): storage deposit amounts (#1811)

---------

Co-authored-by: Thibault Martinez <[email protected]>
alexsporn pushed a commit that referenced this pull request Sep 6, 2024
)

* feat(iota-genesis-builder): allow shimmer test outputs generation

* fix(iota-genesis-builder): adapt the other example

* fix(iota-genesis-builder): differentiate between shimmer and iota coin type

* fix(iota-genesis-builder): use u32 instead of CoinType

* fix(iota-genesis-builder): fix example about

* fix(iota-genesis-builder): storage deposit amounts (#1811)

---------

Co-authored-by: Thibault Martinez <[email protected]>
alexsporn pushed a commit that referenced this pull request Sep 6, 2024
)

* feat(iota-genesis-builder): allow shimmer test outputs generation

* fix(iota-genesis-builder): adapt the other example

* fix(iota-genesis-builder): differentiate between shimmer and iota coin type

* fix(iota-genesis-builder): use u32 instead of CoinType

* fix(iota-genesis-builder): fix example about

* fix(iota-genesis-builder): storage deposit amounts (#1811)

---------

Co-authored-by: Thibault Martinez <[email protected]>
alexsporn pushed a commit that referenced this pull request Sep 6, 2024
)

* feat(iota-genesis-builder): allow shimmer test outputs generation

* fix(iota-genesis-builder): adapt the other example

* fix(iota-genesis-builder): differentiate between shimmer and iota coin type

* fix(iota-genesis-builder): use u32 instead of CoinType

* fix(iota-genesis-builder): fix example about

* fix(iota-genesis-builder): storage deposit amounts (#1811)

---------

Co-authored-by: Thibault Martinez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sc-platform Issues related to the Smart Contract Platform group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task (VM-Language)]: Create a test-output snapshot for Shimmer assets
5 participants