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

feature/query-helpers #48

Merged
merged 3 commits into from
Feb 24, 2023
Merged

feature/query-helpers #48

merged 3 commits into from
Feb 24, 2023

Conversation

boyswan
Copy link
Contributor

@boyswan boyswan commented Feb 21, 2023

This PR contains a handful of updates/changes:

  • Make metadata field naming convention consistent base_uri, part_uri

  • Refactor rmrk::config::Config to allow better composition. Split Config trait into individual functions with relevant trait bounds.

  • Remove cargo flags mintable, equippable as they were actually redundant. Compiled wasm contract size is the same with/without them - the only difference is in the rmrk crate dependency size at build-time. It might be better to reserve these flags for future configurable backends (psp34, uniques, etc) where conditional compilation may be required.

  • Add rmrk::query::Query trait, for ui-based helpers. Tried a few different approaches but ran into various limitations - this feels the most versatile for now. Fetching children directly would lead to gas-limits quickly being hit, hence the Token type containing IDs. Not 100% satisfied with having two fields (pending & accepted) for assets/children, however this was the cleanest way to avoid introducing new duplicate types. The reason some functions are cross-contract builders is due to the impl potentially not existing on a child contract, so need to be able to directly handle the error otherwise the call will trap. Currently no tests for these, as it'll be much easier with e2e tests once we update to ink 4.0.

  • Add getter methods required for Query functions get_asset, get_pending_token_assets, get_pending_children, get_accepted_children

@boyswan boyswan changed the title Query helpers feature/query-helpers Feb 21, 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.

LGTM

@boyswan boyswan merged commit f25399f into main Feb 24, 2023
@boyswan boyswan deleted the feature/query-helpers branch February 24, 2023 12:13
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

2 participants