Skip to content

Commit

Permalink
fix name delimiter spelling (#169)
Browse files Browse the repository at this point in the history
* fix naming

* fix cli
  • Loading branch information
harish551 authored Apr 16, 2024
1 parent 6dd2b27 commit 69d8e98
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion proto/OmniFlix/itc/v1/itc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ message NFTDetails {
string data = 10;
string uri_hash = 11;
uint64 start_index = 12;
string name_delimeter = 13;
string name_delimiter = 13;
}

message Claim {
Expand Down
2 changes: 1 addition & 1 deletion x/itc/client/cli/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func validate(nft *types.NFTDetails) error {
if nft.StartIndex <= 0 {
return fmt.Errorf("start index is required and should be greater than 0")
}
if nft.NameDelimeter != "" && len(nft.NameDelimeter) > 1 {
if nft.NameDelimiter != "" && len(nft.NameDelimiter) > 1 {
return fmt.Errorf("name delemeter should be a single character string")
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion x/itc/keeper/campaign.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (k Keeper) Claim(ctx sdk.Context, campaign types.Campaign, claimer sdk.AccA
nftTitle := fmt.Sprintf(
"%s %s%d",
campaign.NftMintDetails.Name,
campaign.NftMintDetails.NameDelimeter,
campaign.NftMintDetails.NameDelimiter,
nftIndex,
)
if err := k.nftKeeper.MintONFT(
Expand Down
20 changes: 10 additions & 10 deletions x/itc/types/itc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions x/itc/types/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ func ValidateTokens(tokensA, tokensB sdk.Coin) error {
}

func validateNFTMintDetails(details *NFTDetails) error {
if details == nil || len(details.Name) == 0 || len(details.DenomId) == 0 || len(details.MediaUri) == 0 ||
details.StartIndex <= 0 || len(details.NameDelimeter) != 1 {
if details == nil || len(details.Name) == 0 || len(details.DenomId) == 0 || len(details.MediaUri) == 0 {
return errorsmod.Wrapf(
ErrInvalidNFTMintDetails,
"invalid nft mint details, details should not be nil and name, media_uri can not be empty.")
Expand All @@ -131,7 +130,7 @@ func validateNFTMintDetails(details *NFTDetails) error {
ErrInvalidNFTMintDetails,
"invalid nft mint details, Start Index should be a possitive number.")
}
if len(details.NameDelimeter) != 1 {
if len(details.NameDelimiter) != 1 {
return errorsmod.Wrapf(
ErrInvalidNFTMintDetails,
"invalid nft mint details, Name delemeter should be a symbol string length of one.")
Expand Down

0 comments on commit 69d8e98

Please sign in to comment.