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

workspace: add program_transformers #143

Merged

Conversation

fanatid
Copy link
Collaborator

@fanatid fanatid commented Nov 23, 2023

Based on #141

Move program_transformers to separate crate

@fanatid fanatid force-pushed the pt-move-program-transformers branch 2 times, most recently from 75e4825 to 52d1773 Compare December 1, 2023 13:14
@fanatid fanatid force-pushed the pt-move-program-transformers branch from 52d1773 to 5bd27d5 Compare February 5, 2024 22:32
@fanatid
Copy link
Collaborator Author

fanatid commented Feb 5, 2024

Updated!

Cargo.toml Outdated Show resolved Hide resolved
core/Cargo.toml Show resolved Hide resolved
program_transformers/src/token_metadata/v1_asset.rs Outdated Show resolved Hide resolved
program_transformers/src/token_metadata/v1_asset.rs Outdated Show resolved Hide resolved
Comment on lines -68 to +78
tree: Set(tree_id.to_vec()),
level: Set(i),
node_idx: Set(node_idx),
hash: Set(p.node.as_ref().to_vec()),
seq: Set(change_log_event.seq as i64),
leaf_idx: Set(leaf_idx),
tree: ActiveValue::Set(tree_id.to_vec()),
level: ActiveValue::Set(i),
node_idx: ActiveValue::Set(node_idx),
hash: ActiveValue::Set(p.node.as_ref().to_vec()),
seq: ActiveValue::Set(change_log_event.seq as i64),
leaf_idx: ActiveValue::Set(leaf_idx),
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious what's the style choice reasoning for adding the more full path with ActiveValue here? I don't dislike it but it seems like extra typing given that it was already there without it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not familiar with sea-orm and for me, glob import with NoSet / Set looked like magic. Also, just checked https://docs.rs/sea-orm/0.12.14/sea_orm/entity/enum.ActiveValue.html in the docs right now -- this is an enum, we do not usually use enum variants without enum name?
Happy to return NoSet / Set back if that works for you better

@kespinola kespinola merged commit 9e3f11a into metaplex-foundation:main Feb 20, 2024
3 checks passed
@kespinola kespinola deleted the pt-move-program-transformers branch February 20, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants