From 13f78d13306a85dbe57887d4026e88e27b2d0c29 Mon Sep 17 00:00:00 2001 From: Bjarte Stien Karlsen Date: Sun, 25 Apr 2021 21:44:44 +0200 Subject: [PATCH] added new transactions --- tasks/unlink/main.go | 15 +++++++++++++++ transactions/unlink_art.cdc | 16 ++++++++++++++++ transactions/unlink_flow.cdc | 8 ++++++++ 3 files changed, 39 insertions(+) create mode 100644 tasks/unlink/main.go create mode 100644 transactions/unlink_art.cdc create mode 100644 transactions/unlink_flow.cdc diff --git a/tasks/unlink/main.go b/tasks/unlink/main.go new file mode 100644 index 0000000..709f723 --- /dev/null +++ b/tasks/unlink/main.go @@ -0,0 +1,15 @@ +package main + +import ( + "github.com/bjartek/go-with-the-flow/gwtf" +) + +//NB! start from root dir with makefile +func main() { + + flow := gwtf.NewGoWithTheFlowEmulator() + flow.CreateAccount("marketplace", "artist", "buyer1", "buyer2") + + flow.TransactionFromFile("unlink_flow").SignProposeAndPayAs("buyer1").RunPrintEventsFull() + flow.TransactionFromFile("setup/mint_tokens").SignProposeAndPayAsService().AccountArgument("buyer1").UFix64Argument("1000.0").RunPrintEventsFull() +} diff --git a/transactions/unlink_art.cdc b/transactions/unlink_art.cdc new file mode 100644 index 0000000..c9c2b05 --- /dev/null +++ b/transactions/unlink_art.cdc @@ -0,0 +1,16 @@ + + +//local emulator +import FungibleToken from 0xee82856bf20e2aa6 +import NonFungibleToken, Content, Art, Auction, Versus from 0xf8d6e0586b0a20c7 +//testnet +//import Versus from 0x01cf0e2f2f715450 + + +transaction() { + prepare(account: AuthAccount) { + //never do this.. extremely dangerous + log("Unlinking art for ".concat(account.address.toString())) + account.unlink(Art.CollectionPublicPath) + } +} \ No newline at end of file diff --git a/transactions/unlink_flow.cdc b/transactions/unlink_flow.cdc new file mode 100644 index 0000000..a38febc --- /dev/null +++ b/transactions/unlink_flow.cdc @@ -0,0 +1,8 @@ + +transaction() { + prepare(account: AuthAccount) { + //never do this.. extremely dangerous + log("Unlinking flowTokenReciver for ".concat(account.address.toString())) + account.unlink(/public/flowTokenReceiver) + } +} \ No newline at end of file