Skip to content

Commit

Permalink
Update Cadence tests to latest API features
Browse files Browse the repository at this point in the history
  • Loading branch information
m-Peter committed Oct 18, 2023
1 parent 8a6faba commit 5419494
Show file tree
Hide file tree
Showing 19 changed files with 1,123 additions and 1,100 deletions.
680 changes: 358 additions & 322 deletions flow.json

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions scripts/test/add_nft_provider_factory.cdc

This file was deleted.

16 changes: 0 additions & 16 deletions scripts/test/add_nft_receiver_factory.cdc

This file was deleted.

16 changes: 16 additions & 0 deletions scripts/test/add_type_to_factory.cdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import "CapabilityFactory"
import "NFTProviderFactory"

import "NonFungibleToken"

pub fun main(address: Address, type: Type): Bool {
let managerRef = getAuthAccount(address).borrow<&CapabilityFactory.Manager>(
from: CapabilityFactory.StoragePath
) ?? panic("CapabilityFactory Manager not found")

let nftProviderFactory = NFTProviderFactory.Factory()

managerRef.addFactory(type, nftProviderFactory)

return true
}
13 changes: 0 additions & 13 deletions scripts/test/get_ft_all_factory.cdc

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/test/get_ft_balance_factory.cdc

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/test/get_ft_provider_factory.cdc

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/test/get_ft_receiver_balance_factory.cdc

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/test/get_ft_receiver_factory.cdc

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/test/get_nft_collection_public_factory.cdc

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/test/get_nft_provider_collection_factory.cdc

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/test/get_nft_provider_factory.cdc

This file was deleted.

16 changes: 0 additions & 16 deletions scripts/test/get_nft_receiver_factory.cdc

This file was deleted.

13 changes: 13 additions & 0 deletions scripts/test/get_type_from_factory.cdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import "NonFungibleToken"

import "CapabilityFactory"

pub fun main(address: Address, type: Type): Bool {
let managerRef = getAuthAccount(address).borrow<&CapabilityFactory.Manager>(
from: CapabilityFactory.StoragePath
) ?? panic("CapabilityFactory Manager not found")

let factory = managerRef.getFactory(type)

return factory != nil
}
Loading

0 comments on commit 5419494

Please sign in to comment.