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

Catalog updates #63

Merged
merged 3 commits into from
Apr 13, 2023
Merged

Catalog updates #63

merged 3 commits into from
Apr 13, 2023

Conversation

boyswan
Copy link
Contributor

@boyswan boyswan commented Apr 12, 2023

Currently it's not possible to access Catalog modules without manually depending on the rmrk_catalog crate. This breaks the current convention of the single rmrk crate entrypoint.

This PR exposes the catalog modules via the rmrk entrypoint crate, and updates the catalog_example dependencies.

Other fixes:

  • Handle invalid utf8 metadata with RmrkError instead of empty string
  • Fallible constructor in catalog_example

@boyswan boyswan requested a review from Maar-io April 12, 2023 22:31
@boyswan boyswan changed the title Catalog entrypoint Catalog updates Apr 12, 2023
Copy link
Contributor

@Maar-io Maar-io left a comment

Choose a reason for hiding this comment

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

Two observations.

Main idea with Catolog being separate contract is re-usability of the Catalog contract., as well as lowering the contract size. Wouldn't this change include Catalog in every contract?

Many functions names are changed in this PR. The naming of the functions was a copy the EVM version.

@boyswan
Copy link
Contributor Author

boyswan commented Apr 13, 2023

Main idea with Catolog being separate contract is re-usability of the Catalog contract., as well as lowering the contract size. Wouldn't this change include Catalog in every contract?

So the Catalog will still be used as a separate contract and this shouldn't effect the size due to dead code elimination at compile time. The size of the final contract will be determined by the amount of code that is actually used from rmrk, not everything that's available in the lib.

For example if we have a contract that only implements the Minting trait, the Nesting/Equippable/etc impls will not be included in the compiled contract. This will be the same for the catalog - only the Catalog impl will contribute towards the final size.

@boyswan boyswan marked this pull request as draft April 13, 2023 14:11
@boyswan boyswan marked this pull request as ready for review April 13, 2023 19:13
@boyswan boyswan merged commit 35eced9 into main Apr 13, 2023
8 checks passed
@boyswan boyswan deleted the fix/catalog-entry branch April 13, 2023 19:53
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.

None yet

3 participants