Skip to content

Commit

Permalink
deprecate public interface
Browse files Browse the repository at this point in the history
  • Loading branch information
fkenji committed Aug 8, 2024
1 parent 5c912bc commit 0fe9518
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 29 deletions.
20 changes: 2 additions & 18 deletions contracts/MarketTopShotOldVersion.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,8 @@ access(all) contract Market {
//
// The interface that a user can publish their sale as
// to allow others to access their sale
access(all) resource interface SalePublic {
access(all) var cutPercentage: UFix64
access(all) fun purchase(tokenID: UInt64, buyTokens: @DapperUtilityCoin.Vault): @TopShot.NFT {
post {
result.id == tokenID: "The ID of the withdrawn token must be the same as the requested ID"
}
}
access(all) fun getPrice(tokenID: UInt64): UFix64?
access(all) fun getIDs(): [UInt64]
access(all) fun borrowMoment(id: UInt64): &TopShot.NFT? {
// If the result isn't nil, the id of the returned reference
// should be the same as the argument to the function
post {
(result == nil) || (result?.id == id):
"Cannot borrow Moment reference: The ID of the returned reference is incorrect"
}
}
}
/// Deprecated: This is no longer used for defining access control anymore.
access(all) resource interface SalePublic {}

// SaleCollection
//
Expand Down
13 changes: 2 additions & 11 deletions contracts/TopShot.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -1039,17 +1039,8 @@ access(all) contract TopShot: NonFungibleToken {
// This is the interface that users can cast their Moment Collection as
// to allow others to deposit Moments into their Collection. It also allows for reading
// the IDs of Moments in the Collection.
access(all) resource interface MomentCollectionPublic : NonFungibleToken.CollectionPublic {
access(all) fun batchDeposit(tokens: @{NonFungibleToken.Collection})
access(all) fun borrowMoment(id: UInt64): &TopShot.NFT? {
// If the result isn't nil, the id of the returned reference
// should be the same as the argument to the function
post {
(result == nil) || (result?.id == id):
"Cannot borrow Moment reference: The ID of the returned reference is incorrect"
}
}
}
/// Deprecated: This is no longer used for defining access control anymore.
access(all) resource interface MomentCollectionPublic : NonFungibleToken.CollectionPublic {}

// Collection is a resource that every user who owns NFTs
// will store in their account to manage their NFTS
Expand Down

0 comments on commit 0fe9518

Please sign in to comment.