From 60eb7111f32963c86485610fc3fa8d9057e834be Mon Sep 17 00:00:00 2001 From: Giovanni Sanchez <108043524+sisyphusSmiling@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:45:38 -0600 Subject: [PATCH] update instances of Collection.getIDs().length with .getLength() --- contracts/NonFungibleToken-v2.cdc | 2 +- scripts/get_collection_length.cdc | 2 +- scripts/get_collection_length_from_storage.cdc | 2 +- tests/scripts/get_nft_metadata.cdc | 2 +- tests/scripts/resolve_nft_views.cdc | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/NonFungibleToken-v2.cdc b/contracts/NonFungibleToken-v2.cdc index 74ae5318..c8c53a85 100644 --- a/contracts/NonFungibleToken-v2.cdc +++ b/contracts/NonFungibleToken-v2.cdc @@ -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!" } } diff --git a/scripts/get_collection_length.cdc b/scripts/get_collection_length.cdc index b67b462e..1045ff6e 100644 --- a/scripts/get_collection_length.cdc +++ b/scripts/get_collection_length.cdc @@ -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() } diff --git a/scripts/get_collection_length_from_storage.cdc b/scripts/get_collection_length_from_storage.cdc index 4474acab..dbfcc30e 100644 --- a/scripts/get_collection_length_from_storage.cdc +++ b/scripts/get_collection_length_from_storage.cdc @@ -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() } diff --git a/tests/scripts/get_nft_metadata.cdc b/tests/scripts/get_nft_metadata.cdc index da170146..a7aee553 100644 --- a/tests/scripts/get_nft_metadata.cdc +++ b/tests/scripts/get_nft_metadata.cdc @@ -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 diff --git a/tests/scripts/resolve_nft_views.cdc b/tests/scripts/resolve_nft_views.cdc index 80eb8ce0..14fb06dd 100644 --- a/tests/scripts/resolve_nft_views.cdc +++ b/tests/scripts/resolve_nft_views.cdc @@ -34,7 +34,7 @@ access(all) fun main(): Bool { assert(Type() == collectionData.providerLinkedType) let coll <- collectionData.createEmptyCollection() - assert(0 == coll.getIDs().length) + assert(0 == coll.getLength()) destroy <- coll