Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
harish551 committed Feb 7, 2023
1 parent b9ad4ad commit f69f60f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions types/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/nft"
proto "github.com/gogo/protobuf/proto"
"github.com/gogo/protobuf/proto"
)

const (
Expand Down Expand Up @@ -124,7 +124,7 @@ func (cb ClassBuilder) Build(classID, classURI, classData string) (nft.Class, er

dataMap := make(map[string]interface{})
if err := json.Unmarshal(classDataBz, &dataMap); err != nil {
any, err := codectypes.NewAnyWithValue(&DenomMetadata{
denomMetadata, err := codectypes.NewAnyWithValue(&DenomMetadata{
Creator: creator,
Schema: schema,
Description: description,
Expand All @@ -141,7 +141,7 @@ func (cb ClassBuilder) Build(classID, classURI, classData string) (nft.Class, er
Symbol: symbol,
Description: description,
UriHash: uriHash,
Data: any,
Data: denomMetadata,
}, nil
}
if v, ok := dataMap[ClassKeyName]; ok {
Expand Down Expand Up @@ -218,7 +218,7 @@ func (cb ClassBuilder) Build(classID, classURI, classData string) (nft.Class, er
data = string(dataBz)
}

any, err := codectypes.NewAnyWithValue(&DenomMetadata{
denomMetadata, err := codectypes.NewAnyWithValue(&DenomMetadata{
Creator: creator,
PreviewUri: previewURI,
Description: description,
Expand All @@ -236,7 +236,7 @@ func (cb ClassBuilder) Build(classID, classURI, classData string) (nft.Class, er
Symbol: symbol,
Description: description,
UriHash: uriHash,
Data: any,
Data: denomMetadata,
}, nil
}

Expand All @@ -255,7 +255,7 @@ func (tb TokenBuilder) BuildMetadata(token nft.NFT) (string, error) {

nftMetadata, ok := message.(*ONFTMetadata)
if !ok {
return "", errors.New("unsupport classMetadata")
return "", errors.New("unsupported classMetadata")
}
kvals := make(map[string]interface{})
if len(nftMetadata.Data) > 0 {
Expand Down

0 comments on commit f69f60f

Please sign in to comment.