-
Notifications
You must be signed in to change notification settings - Fork 28
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 feature uniqueness check on the FT and NFT asset issuance. #481
Conversation
There was a problem hiding this 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 r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @miladz68, @silverspase, and @ysv)
x/asset/ft/types/msgs.go
line 58 at r1 (raw file):
featuresSet := make(map[Feature]struct{}) for _, feature := range msg.Features { if _, ok := featuresSet[feature]; ok {
ok -> exists, because it is not "ok" if value exists
x/asset/nft/types/msgs.go
line 63 at r1 (raw file):
featuresSet := make(map[ClassFeature]struct{}) for _, feature := range msg.Features { if _, ok := featuresSet[feature]; ok {
ok -> exists
There was a problem hiding this 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, 2 unresolved discussions (waiting on @miladz68, @silverspase, @wojtek-coreum, and @ysv)
x/asset/ft/types/msgs.go
line 58 at r1 (raw file):
Previously, wojtek-coreum (Wojtek) wrote…
ok -> exists, because it is not "ok" if value exists
Didn't get your comment.
There was a problem hiding this 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 r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @silverspase, @wojtek-coreum, and @ysv)
x/asset/ft/types/msgs.go
line 58 at r1 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
Didn't get your comment.
I think wojtek means that exists
is a better name than ok
, and I agree
x/asset/nft/types/msgs.go
line 63 at r1 (raw file):
Previously, wojtek-coreum (Wojtek) wrote…
ok -> exists
agreed
There was a problem hiding this 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, 2 unresolved discussions (waiting on @dzmitryhil, @silverspase, @wojtek-coreum, and @ysv)
There was a problem hiding this 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, 2 unresolved discussions (waiting on @miladz68, @silverspase, @wojtek-coreum, and @ysv)
x/asset/ft/types/msgs.go
line 58 at r1 (raw file):
Previously, miladz68 (milad) wrote…
I think wojtek means that
exists
is a better name thanok
, and I agree
Ok, updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 5 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @dzmitryhil, @miladz68, @silverspase, and @wojtek-coreum)
x/asset/ft/types/msgs.go
line 59 at r2 (raw file):
for _, feature := range msg.Features { if _, exists := featuresSet[feature]; exists { return sdkerrors.Wrapf(ErrInvalidInput, "duplicated features in the features list")
I propose to use lo.FindDuplicates
instead of duplicating this logic in FT & NFT
x/asset/ft/types/msgs.go
line 59 at r2 (raw file):
for _, feature := range msg.Features { if _, exists := featuresSet[feature]; exists { return sdkerrors.Wrapf(ErrInvalidInput, "duplicated features in the features list")
I think it would be beneficial to include features which are duplicated in this error ?
There was a problem hiding this 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: all files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @silverspase, and @wojtek-coreum)
There was a problem hiding this 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, 2 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)
x/asset/ft/types/msgs.go
line 59 at r2 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
I propose to use
lo.FindDuplicates
instead of duplicating this logic in FT & NFT
Done.
Code quote:
exists := featuresSet[feature]; exis
x/asset/ft/types/msgs.go
line 59 at r2 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
I think it would be beneficial to include features which are duplicated in this error ?
Done.
There was a problem hiding this 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 r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)
There was a problem hiding this 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 r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @silverspase and @wojtek-coreum)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 5 files at r1, 2 of 2 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @wojtek-coreum)
This change is