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(sui-genesis-builder): implement creation of basic outputs #159

Merged
merged 27 commits into from
May 14, 2024

Conversation

kodemartin
Copy link
Contributor

@kodemartin kodemartin commented May 1, 2024

Description of change

This patch implements the transformation logic for basic outputs in the sui_genesis_builder::stardust::migration::Executor.

It follows the basic_migration_graph logic with the following exceptions (cc: @miker83z):

  • The owner of generated owned basic-output object is not the hash of the unlock address, but the 32-byte array of the address.

It further amends the existing implementation in sui_genesis_builder::stardust::migration according to the following:

  • All create_{<output-kind>_objects update the executor store internally and do not return the created objects. Less pure, but more ergonomic.

Will rebase to squash fixups before merging.

Links to any relevant issues

Resolves #112

Type of change

Choose a type of change, and delete any options that are not relevant.

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

How the change has been tested

cargo build -p sui-genesis-builder

Change checklist

Tick the boxes that are relevant to your changes, and delete any items that are not.

  • 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

@kodemartin kodemartin marked this pull request as draft May 1, 2024 15:52
Copy link
Member

@samuel-rufi samuel-rufi left a comment

Choose a reason for hiding this comment

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

Hey @kodemartin, absolutely fantastic work. Could follow it well.

I have added already a few thoughts in advance while reading it.

crates/sui-genesis-builder/src/stardust/migration.rs Outdated Show resolved Hide resolved
crates/sui-genesis-builder/src/stardust/migration.rs Outdated Show resolved Hide resolved
crates/sui-genesis-builder/src/stardust/migration.rs Outdated Show resolved Hide resolved
crates/sui-genesis-builder/src/stardust/migration.rs Outdated Show resolved Hide resolved
crates/sui-genesis-builder/src/stardust/migration.rs Outdated Show resolved Hide resolved
crates/sui-genesis-builder/src/stardust/migration.rs Outdated Show resolved Hide resolved
crates/sui-genesis-builder/src/stardust/migration.rs Outdated Show resolved Hide resolved
crates/sui-genesis-builder/src/stardust/migration.rs Outdated Show resolved Hide resolved
@kodemartin kodemartin marked this pull request as ready for review May 10, 2024 14:13
@kodemartin kodemartin self-assigned this May 10, 2024
Copy link
Contributor

@miker83z miker83z left a comment

Choose a reason for hiding this comment

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

Just a couple of oversights! Then it's ready to be merged

@miker83z
Copy link
Contributor

Also, the PR description should be aligned with the latest commits!

@kodemartin kodemartin requested a review from miker83z May 14, 2024 15:22
@kodemartin
Copy link
Contributor Author

Also, the PR description should be aligned with the latest commits!

Updated.

@kodemartin kodemartin merged commit d083156 into develop May 14, 2024
20 of 35 checks passed
@kodemartin kodemartin deleted the 112-migrate-basic-outputs branch May 14, 2024 16:13
@miker83z miker83z added this to the L1SC/IOTA-Framework milestone May 14, 2024
@miker83z miker83z added the sc-platform Issues related to the Smart Contract Platform group. label May 14, 2024
alexsporn pushed a commit that referenced this pull request Sep 6, 2024
* feat(sui-genesis-builder): store TypeOrigin of native tokens

* refactor(sui-genesis-builder): split stardust::types module

* feat(sui-genesis-builder): add unlock types

* feat(sui-genesis-builder): add BasicOutput type

* refactor(sui-genesis-builder): use OutputHeader while creating outputs

* feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects

* feat(sui-genesis-builder): fix native-token object ids during migration

* fix(sui-genesis-builder): correct BasicOutput::type_ module and name

Co-authored-by: Philipp Gackstatter <[email protected]>

* fix(sui-genesis-builder): load packages and input objects correctly

* fix(sui-genesis-builder): dummy transfer Bag object

* fix(sui-genesis-builder): native token coins get updated after split

* fix(sui-genesis-builder): native token coins get updated after create bag

* fix: clippy

* refactor(sui-genesis-builder): store ObjectID in Executor::native_tokens

* fix(sui-genesis-builder): transform simple basic outputs into coins

* fix(sui-genesis-builder): use fresh ids for native tokens

* fix(sui-genesis-builder): generate native token coins object id from TxContext

* fix(sui-genesis-builder): sort all the outputs

* fix(sui-genesis-builder): use string as a bag key

* fix(sui-genesis-builder): amend public-transfer flag of coin object

Co-authored-by: Mirko Zichichi <[email protected]>

* fix(sui-genesis-builder): basic output objects

* refactor(sui-genesis-builder): remove bag from written objects

---------

Co-authored-by: Philipp Gackstatter <[email protected]>
Co-authored-by: Mirko Zichichi <[email protected]>
alexsporn pushed a commit that referenced this pull request Sep 6, 2024
* feat(sui-genesis-builder): store TypeOrigin of native tokens

* refactor(sui-genesis-builder): split stardust::types module

* feat(sui-genesis-builder): add unlock types

* feat(sui-genesis-builder): add BasicOutput type

* refactor(sui-genesis-builder): use OutputHeader while creating outputs

* feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects

* feat(sui-genesis-builder): fix native-token object ids during migration

* fix(sui-genesis-builder): correct BasicOutput::type_ module and name

Co-authored-by: Philipp Gackstatter <[email protected]>

* fix(sui-genesis-builder): load packages and input objects correctly

* fix(sui-genesis-builder): dummy transfer Bag object

* fix(sui-genesis-builder): native token coins get updated after split

* fix(sui-genesis-builder): native token coins get updated after create bag

* fix: clippy

* refactor(sui-genesis-builder): store ObjectID in Executor::native_tokens

* fix(sui-genesis-builder): transform simple basic outputs into coins

* fix(sui-genesis-builder): use fresh ids for native tokens

* fix(sui-genesis-builder): generate native token coins object id from TxContext

* fix(sui-genesis-builder): sort all the outputs

* fix(sui-genesis-builder): use string as a bag key

* fix(sui-genesis-builder): amend public-transfer flag of coin object

Co-authored-by: Mirko Zichichi <[email protected]>

* fix(sui-genesis-builder): basic output objects

* refactor(sui-genesis-builder): remove bag from written objects

---------

Co-authored-by: Philipp Gackstatter <[email protected]>
Co-authored-by: Mirko Zichichi <[email protected]>
alexsporn pushed a commit that referenced this pull request Sep 6, 2024
* feat(sui-genesis-builder): store TypeOrigin of native tokens

* refactor(sui-genesis-builder): split stardust::types module

* feat(sui-genesis-builder): add unlock types

* feat(sui-genesis-builder): add BasicOutput type

* refactor(sui-genesis-builder): use OutputHeader while creating outputs

* feat(sui-genesis-builder): implement stardust::migration::Executor::create_basic_objects

* feat(sui-genesis-builder): fix native-token object ids during migration

* fix(sui-genesis-builder): correct BasicOutput::type_ module and name

Co-authored-by: Philipp Gackstatter <[email protected]>

* fix(sui-genesis-builder): load packages and input objects correctly

* fix(sui-genesis-builder): dummy transfer Bag object

* fix(sui-genesis-builder): native token coins get updated after split

* fix(sui-genesis-builder): native token coins get updated after create bag

* fix: clippy

* refactor(sui-genesis-builder): store ObjectID in Executor::native_tokens

* fix(sui-genesis-builder): transform simple basic outputs into coins

* fix(sui-genesis-builder): use fresh ids for native tokens

* fix(sui-genesis-builder): generate native token coins object id from TxContext

* fix(sui-genesis-builder): sort all the outputs

* fix(sui-genesis-builder): use string as a bag key

* fix(sui-genesis-builder): amend public-transfer flag of coin object

Co-authored-by: Mirko Zichichi <[email protected]>

* fix(sui-genesis-builder): basic output objects

* refactor(sui-genesis-builder): remove bag from written objects

---------

Co-authored-by: Philipp Gackstatter <[email protected]>
Co-authored-by: Mirko Zichichi <[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 (L1SC)]: Transformation Logic for Basic Outputs
5 participants