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

added query to list burnt NFTs #521

Merged
merged 6 commits into from
Jun 14, 2023
Merged

added query to list burnt NFTs #521

merged 6 commits into from
Jun 14, 2023

Conversation

miladz68
Copy link
Contributor

@miladz68 miladz68 commented Jun 8, 2023

This change is Reviewable

@miladz68 miladz68 requested a review from a team as a code owner June 8, 2023 12:15
@miladz68 miladz68 requested review from dzmitryhil, vertex451, ysv and wojtek-coreum and removed request for a team June 8, 2023 12:15
Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 9 files reviewed, 3 unresolved discussions (waiting on @miladz68, @silverspase, @wojtek-coreum, and @ysv)


proto/coreum/asset/nft/v1/query.proto line 129 at r1 (raw file):

}

message QueryBurntNFTsInClassRequest {

@wojtek-coreum @ysv
Do we need them both or we can keep only QueryBurntNFTs with both class_id and nft_id (optional) attributes? So if you query for both and the result is empty then it isn't burnt.


x/asset/nft/keeper/grpc_query.go line 23 at r1 (raw file):

	IsWhitelisted(ctx sdk.Context, classID, nftID string, account sdk.AccAddress) (bool, error)
	GetWhitelistedAccountsForNFT(ctx sdk.Context, classID, nftID string, q *query.PageRequest) ([]string, *query.PageResponse, error)
	ListBurnt(ctx sdk.Context, classID string, q *query.PageRequest) (*query.PageResponse, []string, error)

The name is different from the style we followed before.
I propose:
ListBurnt - >GetBurnt


x/asset/nft/types/keys.go line 114 at r1 (raw file):

// CreateClassBurningKey constructs the key for the burning of non-fungible token.
func CreateClassBurningKey(classID string) ([]byte, error) {

You can use it in the CreateBurningKey as well.

Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewed 9 of 9 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @miladz68, @silverspase, @wojtek-coreum, and @ysv)

Copy link
Contributor Author

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 7 of 9 files reviewed, 3 unresolved discussions (waiting on @dzmitryhil, @silverspase, @wojtek-coreum, and @ysv)


proto/coreum/asset/nft/v1/query.proto line 129 at r1 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

@wojtek-coreum @ysv
Do we need them both or we can keep only QueryBurntNFTs with both class_id and nft_id (optional) attributes? So if you query for both and the result is empty then it isn't burnt.

We already discussed this and decided to go with separate queries.


x/asset/nft/keeper/grpc_query.go line 23 at r1 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

The name is different from the style we followed before.
I propose:
ListBurnt - >GetBurnt

Done.


x/asset/nft/types/keys.go line 114 at r1 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

You can use it in the CreateBurningKey as well.

Doing that will append key length twice. we will need to introduce another helper function to do that properly, which is overkill.

dzmitryhil
dzmitryhil previously approved these changes Jun 12, 2023
Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @silverspase, @wojtek-coreum, and @ysv)

Copy link
Contributor

@ysv ysv left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 9 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @miladz68, @silverspase, and @wojtek-coreum)


proto/coreum/asset/nft/v1/query.proto line 120 at r2 (raw file):

}

message QueryBurntNFTRequest {

What do you think about naming it QueryIsNFTBurntRequest and name it accordingly everywhere: IsNFTBurnt including query service etc

if you disagree I will resolve & approve

Copy link
Contributor Author

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @silverspase, @wojtek-coreum, and @ysv)


proto/coreum/asset/nft/v1/query.proto line 120 at r2 (raw file):

Previously, ysv (Yaroslav Savchuk) wrote…

What do you think about naming it QueryIsNFTBurntRequest and name it accordingly everywhere: IsNFTBurnt including query service etc

if you disagree I will resolve & approve

I don't have a strong opinion here, I also thought about it before and also here and I kind of agree with it. But I in the past I used IsWhitelisted and IsFrozen in previous queries and the result of the discussion was not to use Is prefix. So to follow on the same style I did not use Is Prefix.

Copy link
Contributor Author

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 4 of 9 files reviewed, 1 unresolved discussion (waiting on @dzmitryhil, @silverspase, @wojtek-coreum, and @ysv)


proto/coreum/asset/nft/v1/query.proto line 120 at r2 (raw file):

Previously, miladz68 (milad) wrote…

I don't have a strong opinion here, I also thought about it before and also here and I kind of agree with it. But I in the past I used IsWhitelisted and IsFrozen in previous queries and the result of the discussion was not to use Is prefix. So to follow on the same style I did not use Is Prefix.

I also removed is prefix from the field to completely match the previous style.

Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: 4 of 9 files reviewed, 1 unresolved discussion (waiting on @silverspase, @wojtek-coreum, and @ysv)

Copy link
Contributor

@ysv ysv left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @silverspase and @wojtek-coreum)

@miladz68 miladz68 merged commit 18974b6 into master Jun 14, 2023
@miladz68 miladz68 deleted the milad/list-burnt-nfts branch June 14, 2023 11:42
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