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

token collection: create spec program #5614

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

buffalojoec
Copy link
Contributor

Ok, I threw this together to see what we think of it. A reference example of using SPL Token Group to make a Collections program.

@buffalojoec buffalojoec force-pushed the 10-16-token-group_create_collections_example branch from 946b876 to c2a8050 Compare October 19, 2023 15:51
@buffalojoec buffalojoec force-pushed the 10-19-token_collections_create_spec_program branch from 3ea69bb to 6c2c09e Compare October 19, 2023 15:51
@buffalojoec buffalojoec force-pushed the 10-16-token-group_create_collections_example branch 2 times, most recently from d2916be to 052500a Compare October 20, 2023 07:45
@buffalojoec buffalojoec force-pushed the 10-19-token_collections_create_spec_program branch from 6c2c09e to 7119ded Compare October 20, 2023 07:45
@buffalojoec buffalojoec force-pushed the 10-16-token-group_create_collections_example branch from 052500a to 8531594 Compare October 20, 2023 08:57
@buffalojoec buffalojoec force-pushed the 10-19-token_collections_create_spec_program branch from 7119ded to 4efcbc1 Compare October 20, 2023 08:57
@buffalojoec buffalojoec force-pushed the 10-16-token-group_create_collections_example branch from 8531594 to 2ce7dd4 Compare October 20, 2023 10:54
Base automatically changed from 10-16-token-group_create_collections_example to master October 20, 2023 13:48
@buffalojoec buffalojoec force-pushed the 10-19-token_collections_create_spec_program branch 2 times, most recently from 5269a5f to ea2dad4 Compare October 23, 2023 12:53
@buffalojoec buffalojoec requested a review from joncinque October 23, 2023 12:53
@buffalojoec buffalojoec force-pushed the 10-19-token_collections_create_spec_program branch from ea2dad4 to 88a4581 Compare October 23, 2023 12:55
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Big fan of the test and the program!

There's a lot of duplicated code between the base example and this one -- it seems like the only difference is the metadata pointer + metadata check, and the ability to have multiple member entries in a group. Anything else?

I'm not sure if there's a good way to resolve that. We could do it through a feature or by exporting everything from the example to be reused here. Or maybe we keep it as is, since it's not too much code. What do you think?

token-collections/program/Cargo.toml Outdated Show resolved Hide resolved
token-collections/program/Cargo.toml Outdated Show resolved Hide resolved
token-collections/program/Cargo.toml Outdated Show resolved Hide resolved
token-collections/program/src/entrypoint.rs Outdated Show resolved Hide resolved
token-collections/program/src/processor.rs Outdated Show resolved Hide resolved
@buffalojoec
Copy link
Contributor Author

Big fan of the test and the program!

There's a lot of duplicated code between the base example and this one -- it seems like the only difference is the metadata pointer + metadata check, and the ability to have multiple member entries in a group. Anything else?

I'm not sure if there's a good way to resolve that. We could do it through a feature or by exporting everything from the example to be reused here. Or maybe we keep it as is, since it's not too much code. What do you think?

Yeah, I agree there's a lot of similarity. Given that it's really only a processor, I've decided to add a commit for importing the example program's processor functions for process_update_group_max_size and process_update_group_authority (turns out they were already pub!).

I think this is the best we can do with sharing code from the example program. Let me know what you think, and if you think it's not confusing to onlookers.

@buffalojoec buffalojoec changed the title token collections: create spec program token collection: create spec program Oct 24, 2023
@buffalojoec buffalojoec force-pushed the 10-19-token_collections_create_spec_program branch 2 times, most recently from 5f137d2 to 7151874 Compare October 24, 2023 17:02
@buffalojoec buffalojoec force-pushed the 10-19-token_collections_create_spec_program branch from 7151874 to 17c963d Compare October 24, 2023 17:25
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks great! I do like the reusing of the example program processors, makes them seem more generally useful

@buffalojoec buffalojoec merged commit 4af4cca into master Oct 25, 2023
7 checks passed
@buffalojoec buffalojoec deleted the 10-19-token_collections_create_spec_program branch October 25, 2023 07:41
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.

2 participants