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

Add collection info - RPC call #792

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

KarishmaBothara
Copy link
Contributor

@KarishmaBothara KarishmaBothara commented Feb 22, 2024

Description

As the NFT collection grow in size with new token minted in it.. Storage to get collection info fails to get the huge data. This PR provides RPC method to get collection information from collection id. It has all the information except for collection owner

PR checklist

  • Describe the added/changed/fixed/removed behaviour
  • Tag related issue(s)
  • Add appropriate unit tests and/or integration tests to the integration test repository

@KarishmaBothara KarishmaBothara marked this pull request as draft February 22, 2024 10:17
@KarishmaBothara KarishmaBothara marked this pull request as ready for review February 23, 2024 10:14
pallet/nft/src/impls.rs Outdated Show resolved Hide resolved
pallet/nft/src/impls.rs Outdated Show resolved Hide resolved
pallet/nft/src/impls.rs Outdated Show resolved Hide resolved
pallet/nft/src/impls.rs Outdated Show resolved Hide resolved
pallet/nft/src/impls.rs Outdated Show resolved Hide resolved
pallet/nft/src/impls.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@JasonTulp JasonTulp left a comment

Choose a reason for hiding this comment

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

Looking good, some fields I don't think are needed in this RPC call. I also think we should have a think about whether it would make sense to have one RPC for all information, or multiple RPC calls for each individual part. What do you think?

@KarishmaBothara
Copy link
Contributor Author

Looking good, some fields I don't think are needed in this RPC call. I also think we should have a think about whether it would make sense to have one RPC for all information, or multiple RPC calls for each individual part. What do you think?

Thanks for your review.. I think the reason for this rpc call is, storage collection_info would fail, ownedTokens list if it is too huge, then the storage retrieval fails.. so an alternative to that without ownedTokens info

@KarishmaBothara KarishmaBothara changed the title Add collection info - RPC call (WIP) Add collection info - RPC call Mar 14, 2024
pallet/nft/src/types.rs Outdated Show resolved Hide resolved
e2e/test/NftRPC.test.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@JasonTulp JasonTulp left a comment

Choose a reason for hiding this comment

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

Looking good! The separate struct looks like the better option for sure. Few minor comments left to address

pallet/nft/src/impls.rs Outdated Show resolved Hide resolved
pallet/nft/src/impls.rs Outdated Show resolved Hide resolved
pallet/nft/src/types.rs Show resolved Hide resolved
runtime/src/lib.rs Outdated Show resolved Hide resolved
pallet/nft/src/impls.rs Outdated Show resolved Hide resolved
pallet/nft/rpc/runtime-api/Cargo.toml Outdated Show resolved Hide resolved
@KarishmaBothara KarishmaBothara requested review from JasonTulp and removed request for ken-futureverse October 22, 2024 06:37
@@ -19,6 +19,7 @@ default = ["std"]
std = [
"codec/std",
"sp-api/std",
"codec/std",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can sp-ruintime be removed from the cargo.toml?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I end up with errors on removing sp-runtime

pallet/nft/src/impls.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@JasonTulp JasonTulp left a comment

Choose a reason for hiding this comment

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

lgtm, 2 more small comments. Needs a review from someone else before merging. Nice work Karishma

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.

3 participants