Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
austinkline committed Sep 9, 2024
1 parent 96d8725 commit 5c94dd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
8 changes: 4 additions & 4 deletions contracts/DropTypes.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ access(all) contract DropTypes {
}

var royaltyRate = 0.0
if let tmp = resolver!.resolveContractView(resourceType: nftType, viewType: Type<MetadataViews.Royalties>()) {
let royalties = tmp as! MetadataViews.Royalties
if let tmpRoyalties = resolver!.resolveContractView(resourceType: nftType, viewType: Type<MetadataViews.Royalties>()) {
let royalties = tmpRoyalties as! MetadataViews.Royalties
for r in royalties.getRoyalties() {
royaltyRate = royaltyRate + r.cut
}
Expand Down Expand Up @@ -276,8 +276,8 @@ access(all) contract DropTypes {
}

var royaltyRate = 0.0
if let tmp = resolver!.resolveContractView(resourceType: nftType, viewType: Type<MetadataViews.Royalties>()) {
let royalties = tmp as! MetadataViews.Royalties
if let tmpRoyalties = resolver!.resolveContractView(resourceType: nftType, viewType: Type<MetadataViews.Royalties>()) {
let royalties = tmpRoyalties as! MetadataViews.Royalties
for r in royalties.getRoyalties() {
royaltyRate = royaltyRate + r.cut
}
Expand Down
16 changes: 0 additions & 16 deletions contracts/nft/BaseCollection.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,6 @@ access(all) contract interface BaseCollection: ViewResolver {
)
case Type<FlowtyDrops.DropResolver>():
return FlowtyDrops.DropResolver(cap: acct.capabilities.get<&{FlowtyDrops.ContainerPublic}>(FlowtyDrops.ContainerPublicPath))
case Type<MetadataViews.NFTCollectionDisplay>():
let c = getAccount(addr).contracts.borrow<&{BaseCollection}>(name: segments[2])!
let tmp = c.MetadataCap.borrow()
if tmp == nil {
return nil
}

return tmp!.collectionInfo.getDisplay()
case Type<MetadataViews.Royalties>():
let c = getAccount(addr).contracts.borrow<&{BaseCollection}>(name: segments[2])!
let tmp = c.MetadataCap.borrow()
if tmp == nil {
return nil
}

return tmp!.collectionInfo.getDisplay()
}

// These views require the {BaseCollection} interface
Expand Down

0 comments on commit 5c94dd6

Please sign in to comment.