Skip to content

Commit

Permalink
update instances of Collection.getIDs().length with .getLength()
Browse files Browse the repository at this point in the history
  • Loading branch information
sisyphusSmiling committed Nov 6, 2023
1 parent 3c50d77 commit 60eb711
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contracts/NonFungibleToken-v2.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ access(all) contract NonFungibleToken {
/// and returns it to the caller so that they can own NFTs
access(all) fun createEmptyCollection(): @{Collection} {
post {
result.getIDs().length == 0: "The created collection must be empty!"
result.getLength() == 0: "The created collection must be empty!"
}
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/get_collection_length.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ access(all) fun main(address: Address): Int {
collectionData.publicPath
) ?? panic("Could not borrow capability from public collection")

return collectionRef.getIDs().length
return collectionRef.getLength()
}
2 changes: 1 addition & 1 deletion scripts/get_collection_length_from_storage.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ access(all) fun main(address: Address): Int {
from: collectionData.storagePath
) ?? panic("Could not borrow reference to collection from storage")

return collectionRef.getIDs().length
return collectionRef.getLength()
}
2 changes: 1 addition & 1 deletion tests/scripts/get_nft_metadata.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ access(all) fun main(address: Address, id: UInt64): Bool {
assert(nil == nftMetadata.license)

let coll <- nftCollectionView.createEmptyCollection()
assert(0 == coll.getIDs().length)
assert(0 == coll.getLength())
destroy <- coll

return true
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/resolve_nft_views.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ access(all) fun main(): Bool {
assert(Type<auth(NonFungibleToken.Withdrawable) &ExampleNFT.Collection>() == collectionData.providerLinkedType)

let coll <- collectionData.createEmptyCollection()
assert(0 == coll.getIDs().length)
assert(0 == coll.getLength())

destroy <- coll

Expand Down

0 comments on commit 60eb711

Please sign in to comment.