From 3638fc744483fdd01801161665b4880f67154af2 Mon Sep 17 00:00:00 2001 From: Nozim Mehrubonov Date: Fri, 29 Sep 2023 00:57:15 +0100 Subject: [PATCH] Replace contract source encoding to utf8 (#218) --- cadence/transactions/init.cdc | 2 +- src/init.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cadence/transactions/init.cdc b/cadence/transactions/init.cdc index 899bfd8..33bce21 100644 --- a/cadence/transactions/init.cdc +++ b/cadence/transactions/init.cdc @@ -1,5 +1,5 @@ transaction(code: String, key: String, initAccountsLabels: [String]) { prepare(acct: AuthAccount) { - acct.contracts.add(name: "FCL", code: code.decodeHex(), key: key, initAccountsLabels: initAccountsLabels) + acct.contracts.add(name: "FCL", code: code.utf8, key: key, initAccountsLabels: initAccountsLabels) } } diff --git a/src/init.ts b/src/init.ts index c94094d..294a5dd 100644 --- a/src/init.ts +++ b/src/init.ts @@ -60,7 +60,7 @@ export async function initializeWallet(config: { .send([ fcl.transaction(initTransaction), fcl.args([ - fcl.arg(Buffer.from(FCLContract, "utf8").toString("hex"), t.String), + fcl.arg(FCLContract, t.String), fcl.arg(encodeServiceKey(flowAccountPublicKey), t.String), fcl.arg(initAccountsLabels, t.Array(t.String)), ]),