From 56b94aa43a465f5b085857ca1edbcbc6280ead77 Mon Sep 17 00:00:00 2001 From: ashlee <100004665+web3ashlee@users.noreply.github.com> Date: Wed, 20 Dec 2023 13:23:05 -0600 Subject: [PATCH] TestGetRaffleManager (#34) Co-authored-by: ash --- scripts/raffle/borrow_raffle_manager.cdc | 6 ++++++ test/FlowtyWrapped_tests.cdc | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 scripts/raffle/borrow_raffle_manager.cdc diff --git a/scripts/raffle/borrow_raffle_manager.cdc b/scripts/raffle/borrow_raffle_manager.cdc new file mode 100644 index 0000000..43b013a --- /dev/null +++ b/scripts/raffle/borrow_raffle_manager.cdc @@ -0,0 +1,6 @@ +import "FlowtyRaffles" + +pub fun main(addr: Address) { + getAccount(addr).getCapability<&FlowtyRaffles.Manager{FlowtyRaffles.ManagerPublic}>(FlowtyRaffles.ManagerPublicPath).borrow() + ?? panic("unable to borrow manager") +} \ No newline at end of file diff --git a/test/FlowtyWrapped_tests.cdc b/test/FlowtyWrapped_tests.cdc index 833a228..48a9059 100644 --- a/test/FlowtyWrapped_tests.cdc +++ b/test/FlowtyWrapped_tests.cdc @@ -41,6 +41,10 @@ pub fun testSetupManager() { txExecutor("setup_flowty_wrapped.cdc", [acct], [], nil) } +pub fun testGetRaffleManager(){ + scriptExecutor("raffle/borrow_raffle_manager.cdc", [rafflesAcct.address]) +} + pub fun testMint() { let acct = Test.createAccount() setupForMint(acct: acct)