Skip to content

Commit

Permalink
update ipfs url for rich html
Browse files Browse the repository at this point in the history
  • Loading branch information
austinkline committed Dec 22, 2023
1 parent ace35f5 commit 7b3716e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contracts/WrappedEditions.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub contract WrappedEditions {

let params = "?username=".concat(username).concat("&raffleTickets=").concat(wrapped.tickets.toString())
let htmlMedia = MetadataViews.Media(
file: MetadataViews.IPFSFile("QmfPkn13gbBNVK6bKtdqyUEa92bmqDy8aVQqGj3pByyyoP".concat(params), nil), mediaType: "text/html"
file: MetadataViews.IPFSFile("QmRfVR98oe6qxeWFcnY9tfM2CLUJg3rvxbBPS5LjYwp69Z".concat(params), nil), mediaType: "text/html"
)
let imageMedia = MetadataViews.Media(
file: MetadataViews.HTTPFile(url: self.baseImageUrl.concat(nft.serial.toString())), mediaType: "image/jpeg"
Expand Down
6 changes: 3 additions & 3 deletions test/FlowtyWrapped_tests.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fun setup() {
let start: UInt64? = nil
let end: UInt64? = nil
let baseImageUrl: String = "https://example.com/image/"
let baseHtmlUrl: String = "QmfPkn13gbBNVK6bKtdqyUEa92bmqDy8aVQqGj3pByyyoP"
let baseHtmlUrl: String = "QmRfVR98oe6qxeWFcnY9tfM2CLUJg3rvxbBPS5LjYwp69Z"
registerEdition(rafflesAcct: Test.getAccount(Address(0x0000000000000007)), removeAfterReveal: removeAfterReveal, start: start, end: end, baseImageUrl: baseImageUrl, baseHtmlUrl: baseHtmlUrl)

}
Expand Down Expand Up @@ -185,7 +185,7 @@ pub fun testMediasIpfsUrl() {

let ipfsMedia = medias.items[0]
let ipfsUrl = ipfsMedia.file.uri()
assert(ipfsUrl == "ipfs://QmfPkn13gbBNVK6bKtdqyUEa92bmqDy8aVQqGj3pByyyoP?username=user1&raffleTickets=1", message: "unexpected ipfs url")
assert(ipfsUrl == "ipfs://QmRfVR98oe6qxeWFcnY9tfM2CLUJg3rvxbBPS5LjYwp69Z?username=user1&raffleTickets=1", message: "unexpected ipfs url")
}

pub fun testIpfsUrlNoName() {
Expand All @@ -201,7 +201,7 @@ pub fun testIpfsUrlNoName() {

let ipfsMedia = medias.items[0]
let ipfsUrl = ipfsMedia.file.uri()
assert(ipfsUrl == "ipfs://QmfPkn13gbBNVK6bKtdqyUEa92bmqDy8aVQqGj3pByyyoP?username=".concat(acct.address.toString()).concat("&raffleTickets=1"), message: "unexpected ipfs url")
assert(ipfsUrl == "ipfs://QmRfVR98oe6qxeWFcnY9tfM2CLUJg3rvxbBPS5LjYwp69Z?username=".concat(acct.address.toString()).concat("&raffleTickets=1"), message: "unexpected ipfs url")
}

pub fun testDrawRaffle() {
Expand Down

0 comments on commit 7b3716e

Please sign in to comment.