Skip to content

Commit

Permalink
capitalize Tagline
Browse files Browse the repository at this point in the history
  • Loading branch information
zihehuang committed Nov 1, 2022
1 parent cc5aeb6 commit c097a2c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions contracts/TopShot.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ pub contract TopShot: NonFungibleToken {
}

access(contract) fun updateTagline(tagline: String): UInt32 {
self.metadata["tagline"] = tagline
self.metadata["Tagline"] = tagline

TopShot.playDatas[self.playID] = self
emit PlayUpdated(id: self.playID, metadata: self.metadata)
Expand Down Expand Up @@ -707,7 +707,7 @@ pub contract TopShot: NonFungibleToken {
}

pub fun description(): String {
let playDesc: String? = TopShot.getPlayMetaDataByField(playID: self.data.playID, field: "tagline")
let playDesc: String? = TopShot.getPlayMetaDataByField(playID: self.data.playID, field: "Tagline")

if let desc = playDesc {
if desc.length > 0 {
Expand Down
4 changes: 2 additions & 2 deletions lib/go/contracts/internal/assets/assets.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/go/templates/internal/assets/assets.go

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

2 changes: 1 addition & 1 deletion lib/go/test/topshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func TestMintNFTs(t *testing.T) {
assert.Equal(t, CadenceString("Lebron"), result)

tb.UpdateTagline(t, []cadence.KeyValuePair{{Key: cadence.UInt32(1), Value: CadenceString("lorem ipsum")}})
result = executeScriptAndCheck(t, b, templates.GenerateGetPlayMetadataFieldScript(env), [][]byte{jsoncdc.MustEncode(cadence.UInt32(1)), jsoncdc.MustEncode(cadence.String("tagline"))})
result = executeScriptAndCheck(t, b, templates.GenerateGetPlayMetadataFieldScript(env), [][]byte{jsoncdc.MustEncode(cadence.UInt32(1)), jsoncdc.MustEncode(cadence.String("Tagline"))})
assert.Equal(t, CadenceString("lorem ipsum"), result)
})

Expand Down
4 changes: 2 additions & 2 deletions transactions/admin/update_tagline.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ transaction(plays: {UInt32: String}) {
}

post {
TopShot.getPlayMetaDataByField(playID: self.firstKey, field: "tagline") != nil:
TopShot.getPlayMetaDataByField(playID: self.firstKey, field: "Tagline") != nil:
"first play's tagline doesnt exist"
TopShot.getPlayMetaDataByField(playID: self.lastKey, field: "tagline") != nil:
TopShot.getPlayMetaDataByField(playID: self.lastKey, field: "Tagline") != nil:
"last play's tagline doesnt exist"
}
}

0 comments on commit c097a2c

Please sign in to comment.