From ffe9a9c3469e5ce92d447f58e33b89b657cc4d9e Mon Sep 17 00:00:00 2001 From: lcswillems Date: Mon, 1 Jul 2024 20:38:14 +0200 Subject: [PATCH 1/4] Remove code to remove --- xsuite/src/cli/cli.test.ts | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/xsuite/src/cli/cli.test.ts b/xsuite/src/cli/cli.test.ts index 851c7f78..2d235d70 100644 --- a/xsuite/src/cli/cli.test.ts +++ b/xsuite/src/cli/cli.test.ts @@ -347,24 +347,12 @@ test.concurrent( async () => { using c = newContext(); - // TO BE REMOVED! - // Switch to a rust version compatible with sample contracts on main branch. - await c.cmd('install-rust --toolchain "nightly-2023-12-11"'); - const dir = "contract"; await c.cmd(`new --dir ${dir}`); expect(fs.readdirSync(c.cwd()).length).toEqual(1); const starterChalk = chalk.magenta("blank"); const absDirPath = path.resolve(c.cwd(), dir); expect(c.flushStdout().split("\n")).toEqual([ - //// Must be removed when removing rust version switch (line 350) //// - chalk.blue( - 'Installing Rust: toolchain "nightly-2023-12-11" & target wasm32-unknown-unknown...', - ), - chalk.cyan( - '$ curl --proto =https --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain "nightly-2023-12-11" -t wasm32-unknown-unknown -y', - ), - ////////////////////////////////////////////////////////////////////// chalk.blue(`Downloading contract ${starterChalk} in "${absDirPath}"...`), "", chalk.blue("Installing packages..."), @@ -438,10 +426,6 @@ test.concurrent( chalk.cyan(`$ ${binaryPath} .`), "", ]); - - // Must be removed when removing rust version switch (line 350). - // Switch back to the default rust version. - await c.cmd("install-rust"); }, 100_000, ); From 36935890b1a2b6358a49e0caade280a794e460c9 Mon Sep 17 00:00:00 2001 From: lcswillems Date: Mon, 1 Jul 2024 20:52:01 +0200 Subject: [PATCH 2/4] Release xsuite@0.0.67 --- xsuite/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xsuite/package.json b/xsuite/package.json index d9874648..ec68ff1f 100644 --- a/xsuite/package.json +++ b/xsuite/package.json @@ -1,6 +1,6 @@ { "name": "xsuite", - "version": "0.0.66", + "version": "0.0.67", "license": "MIT", "bin": { "xsuite": "cli.js" From e214fd3168a7b01db705c02ddb822750005ec4ae Mon Sep 17 00:00:00 2001 From: lcswillems Date: Thu, 4 Jul 2024 19:58:15 +0200 Subject: [PATCH 3/4] Remove startWorld --- xsuite/src/world/fsworld.test.ts | 144 +++++++++++++++--------------- xsuite/src/world/lsworld.test.ts | 146 +++++++++++++++---------------- 2 files changed, 143 insertions(+), 147 deletions(-) diff --git a/xsuite/src/world/fsworld.test.ts b/xsuite/src/world/fsworld.test.ts index 93ead429..d8fa4674 100644 --- a/xsuite/src/world/fsworld.test.ts +++ b/xsuite/src/world/fsworld.test.ts @@ -28,7 +28,7 @@ const baseExplorerUrl = "http://explorer.local"; test.concurrent( "FSWorld.proxy.getAccountNonce on empty bech address", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); expect(await world.proxy.getAccountNonce(zeroBechAddress)).toEqual(0); }, ); @@ -36,7 +36,7 @@ test.concurrent( test.concurrent( "FSWorld.proxy.getAccountNonce on empty hex address", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); expect(await world.proxy.getAccountNonce(zeroHexAddress)).toEqual(0); }, ); @@ -44,7 +44,7 @@ test.concurrent( test.concurrent( "FSWorld.proxy.getAccountNonce on empty U8A address", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); expect(await world.proxy.getAccountNonce(zeroU8AAddress)).toEqual(0); }, ); @@ -52,7 +52,7 @@ test.concurrent( test.concurrent( "FSWorld.proxy.getAccountBalance on empty bech address", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); expect(await world.proxy.getAccountBalance(zeroBechAddress)).toEqual(0n); }, ); @@ -60,7 +60,7 @@ test.concurrent( test.concurrent( "FSWorld.proxy.getAccountBalance on empty hex address", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); expect(await world.proxy.getAccountBalance(zeroHexAddress)).toEqual(0n); }, ); @@ -68,23 +68,23 @@ test.concurrent( test.concurrent( "FSWorld.proxy.getAccountBalance on empty U8A address", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); expect(await world.proxy.getAccountBalance(zeroU8AAddress)).toEqual(0n); }, ); test.concurrent("FSWorld.proxy.getAccount on empty bech address", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); assertAccount(await world.proxy.getAccount(zeroBechAddress), emptyAccount); }); test.concurrent("FSWorld.proxy.getAccount on empty hex address", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); assertAccount(await world.proxy.getAccount(zeroHexAddress), emptyAccount); }); test.concurrent("FSWorld.proxy.getAccount on empty U8A address", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); assertAccount(await world.proxy.getAccount(zeroU8AAddress), emptyAccount); }); @@ -107,19 +107,19 @@ test.concurrent("FSWorld.newMainnet", () => { }); test.concurrent("FSWorld.newWallet", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const wallet = world.newWallet(zeroU8AAddress); expect(wallet.toTopU8A()).toEqual(zeroU8AAddress); }); test.concurrent("FSWorld.newContract", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const wallet = world.newWallet(zeroU8AAddress); expect(wallet.toTopU8A()).toEqual(zeroU8AAddress); }); test.concurrent("FSWorld.createWallet - empty wallet", async () => { - using world = await startWorld(); + using world = await FSWorld.start({ explorerUrl: baseExplorerUrl }); const wallet = await world.createWallet(); expect(wallet.explorerUrl).toEqual(`${baseExplorerUrl}/accounts/${wallet}`); expect(getAddressType(wallet)).toEqual("wallet"); @@ -127,20 +127,20 @@ test.concurrent("FSWorld.createWallet - empty wallet", async () => { }); test.concurrent("FSWorld.createWallet - with balance", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const wallet = await world.createWallet({ balance: 10n }); assertAccount(await wallet.getAccount(), { balance: 10n }); }); test.concurrent("FSWorld.createWallet - with address & balance", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const address = createAddressLike("wallet"); const wallet = await world.createWallet({ address, balance: 10n }); assertAccount(await wallet.getAccount(), { address, balance: 10n }); }); test.concurrent("FSWorld.createWallet - with shard", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const wallet0 = await world.createWallet({ address: { shard: 0 } }); const wallet1 = await world.createWallet({ address: { shard: 1 } }); const wallet2 = await world.createWallet({ address: { shard: 2 } }); @@ -153,7 +153,7 @@ test.concurrent("FSWorld.createWallet - with shard", async () => { }); test.concurrent("FSWorld.createContract - empty contract", async () => { - using world = await startWorld(); + using world = await FSWorld.start({ explorerUrl: baseExplorerUrl }); const contract = await world.createContract(); expect(contract.explorerUrl).toEqual( `${baseExplorerUrl}/accounts/${contract}`, @@ -163,26 +163,26 @@ test.concurrent("FSWorld.createContract - empty contract", async () => { }); test.concurrent("FSWorld.createContract - with balance", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const contract = await world.createContract({ balance: 10n }); assertAccount(await contract.getAccount(), { balance: 10n }); }); test.concurrent("FSWorld.createContract - with file:", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const contract = await world.createContract({ code: worldCode }); assertAccount(await contract.getAccount(), { code: worldCode }); }); test.concurrent("FSWorld.createContract - with address & file:", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const address = createAddressLike("vmContract"); const contract = await world.createContract({ address, code: worldCode }); assertAccount(await contract.getAccount(), { address, code: worldCode }); }); test.concurrent("FSWorld.createContract - with shard", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const contract0 = await world.createContract({ address: { shard: 0 } }); const contract1 = await world.createContract({ address: { shard: 1 } }); const contract2 = await world.createContract({ address: { shard: 2 } }); @@ -195,19 +195,19 @@ test.concurrent("FSWorld.createContract - with shard", async () => { }); test.concurrent("FSWorld.getAccountNonce", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const wallet = await world.createWallet({ nonce: 10 }); expect(await world.getAccountNonce(wallet)).toEqual(10); }); test.concurrent("FSWorld.getAccountBalance", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const wallet = await world.createWallet({ balance: 1234 }); expect(await world.getAccountBalance(wallet)).toEqual(1234n); }); test.concurrent("FSWorld.getAccountKvs", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const wallet = await world.createWallet({ kvs: [[e.Str("n"), e.U(1)]] }); expect(await world.getAccountKvs(wallet)).toEqual( e.kvs([[e.Str("n"), e.U(1)]]), @@ -215,13 +215,13 @@ test.concurrent("FSWorld.getAccountKvs", async () => { }); test.concurrent("FSWorld.getAccountWithoutKvs", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const wallet = await world.createWallet({ kvs: [[e.Str("n"), e.U(1)]] }); assertAccount(await world.getAccountWithoutKvs(wallet), { kvs: {} }); }); test.concurrent("FSWorld.getAccount", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const wallet = await world.createWallet({ kvs: [[e.Str("n"), e.U(1)]] }); assertAccount(await world.getAccount(wallet), { kvs: [[e.Str("n"), e.U(1)]], @@ -229,7 +229,7 @@ test.concurrent("FSWorld.getAccount", async () => { }); test.concurrent("FSWorld.getInitialWallets", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const initialAddresses = await world.getInitialAddresses(); const walletWithBalance = world.newWallet(initialAddresses.withBalance[0]); const walletWithStake = world.newWallet(initialAddresses.withStake[0]); @@ -242,7 +242,7 @@ test.concurrent("FSWorld.getInitialWallets", async () => { }); test.concurrent("FSWorld.setAccounts", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const walletAddress = createAddressLike("wallet"); const contractAddress = createAddressLike("vmContract"); await world.setAccounts([ @@ -280,7 +280,7 @@ test.concurrent("FSWorld.setAccounts", async () => { }); test.concurrent("FSWorld.setAccount", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const walletAddress = createAddressLike("wallet"); const contractAddress = createAddressLike("vmContract"); await world.setAccount({ @@ -304,7 +304,7 @@ test.concurrent("FSWorld.setAccount", async () => { }); test.concurrent("FSWorld.query - basic", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { contract } = await createAccounts(world); const { returnData } = await world.query({ callee: contract, @@ -315,7 +315,7 @@ test.concurrent("FSWorld.query - basic", async () => { }); test.concurrent("FSWorld.query - sender", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); const { returnData } = await world.query({ callee: contract, @@ -326,7 +326,7 @@ test.concurrent("FSWorld.query - sender", async () => { }); test.concurrent("FSWorld.query - value", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { contract } = await createAccounts(world); const { returnData } = await world.query({ callee: contract, @@ -337,7 +337,7 @@ test.concurrent("FSWorld.query - value", async () => { }); test.concurrent("FSWorld.query.assertFail - correct parameters", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { contract } = await createAccounts(world); await world .query({ @@ -351,7 +351,7 @@ test.concurrent("FSWorld.query.assertFail - correct parameters", async () => { test.concurrent( "FSWorld.sendTx & FSWorld.resolveTx.assertPending & FSWorld.resolveTx.assertSucceed", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, wallet2 } = await createAccounts(world); const txHash = await world.sendTx({ sender: wallet, @@ -372,7 +372,7 @@ test.concurrent( ); test.concurrent("FSWorld.executeTxs", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, wallet2, wallet3 } = await createAccounts(world); const [{ fee: fee1 }, { fee: fee2 }] = await world.executeTxs([ { @@ -400,7 +400,7 @@ test.concurrent("FSWorld.executeTxs", async () => { }); test.concurrent("FSWorld.executeTx", async () => { - using world = await startWorld(); + using world = await FSWorld.start({ explorerUrl: baseExplorerUrl }); const { wallet, wallet2 } = await createAccounts(world); const { hash, explorerUrl, gasUsed, fee } = await world.executeTx({ sender: wallet, @@ -420,7 +420,7 @@ test.concurrent("FSWorld.executeTx", async () => { }); test.concurrent("FSWorld.transfer", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, wallet2 } = await createAccounts(world); const { fee } = await world.transfer({ sender: wallet, @@ -437,7 +437,7 @@ test.concurrent("FSWorld.transfer", async () => { }); test.concurrent("FSWorld.deployContract", async () => { - using world = await startWorld(); + using world = await FSWorld.start({ explorerUrl: baseExplorerUrl }); const { wallet } = await createAccounts(world); const { contract } = await world.deployContract({ sender: wallet, @@ -458,7 +458,7 @@ test.concurrent("FSWorld.deployContract", async () => { }); test.concurrent("FSWorld.upgradeContract", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); await contract.setAccount({ code: worldCode, @@ -481,7 +481,7 @@ test.concurrent("FSWorld.upgradeContract", async () => { }); test.concurrent("FSWorld.callContract", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); const { fee } = await world.callContract({ sender: wallet, @@ -499,14 +499,14 @@ test.concurrent("FSWorld.callContract", async () => { }); test.concurrent("FSWorld.terminate", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); expect(world.server?.killed).toEqual(false); world.terminate(); expect(world.server?.killed).toEqual(true); }); test.concurrent("FSWallet.query", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); const { returnData } = await wallet.query({ callee: contract, @@ -516,7 +516,7 @@ test.concurrent("FSWallet.query", async () => { }); test.concurrent("FSWallet.query - try to change the state", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); assertAccount(await wallet.getAccount(), { balance: 10n ** 18n, @@ -545,7 +545,7 @@ test.concurrent("FSWallet.query - try to change the state", async () => { }); test.todo("FSWallet.query - esdts", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); const { returnData } = await wallet.query({ callee: contract, @@ -562,7 +562,7 @@ test.todo("FSWallet.query - esdts", async () => { }); test.concurrent("FSWallet.callContract failure", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { contract } = await createAccounts(world); await expect( world.query({ @@ -578,19 +578,19 @@ test.concurrent("FSWallet.callContract failure", async () => { }); test.concurrent("FSWallet.getAccountNonce", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet } = await createAccounts(world); expect(await wallet.getAccountNonce()).toEqual(0); }); test.concurrent("FSWallet.getAccountBalance", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet } = await createAccounts(world); expect(await wallet.getAccountBalance()).toEqual(10n ** 18n); }); test.concurrent("FSWallet.getAccountKvs", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet } = await createAccounts(world); expect(await wallet.getAccountKvs()).toEqual( e.kvs({ esdts: [{ id: fftId, amount: 10n ** 18n }] }), @@ -598,7 +598,7 @@ test.concurrent("FSWallet.getAccountKvs", async () => { }); test.concurrent("FSWallet.getAccountWithoutKvs", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet } = await createAccounts(world); assertAccount(await wallet.getAccountWithoutKvs(), { nonce: 0, @@ -611,7 +611,7 @@ test.concurrent("FSWallet.getAccountWithoutKvs", async () => { }); test.concurrent("FSWallet.getAccount", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet } = await createAccounts(world); assertAccount(await wallet.getAccount(), { nonce: 0, @@ -625,7 +625,7 @@ test.concurrent("FSWallet.getAccount", async () => { }); test.concurrent("FSWallet.setAccount - FSWallet.getAccount", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet } = await createAccounts(world); const before = await wallet.getAccount(); await wallet.setAccount(before); @@ -634,7 +634,7 @@ test.concurrent("FSWallet.setAccount - FSWallet.getAccount", async () => { }); test.concurrent("FSWallet.executeTx", async () => { - using world = await startWorld(); + using world = await FSWorld.start({ explorerUrl: baseExplorerUrl }); const { wallet, wallet2 } = await createAccounts(world); const { hash, explorerUrl, gasUsed, fee } = await wallet.executeTx({ receiver: wallet2, @@ -653,7 +653,7 @@ test.concurrent("FSWallet.executeTx", async () => { }); test.concurrent("FSWallet.transfer - EGLD", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, wallet2 } = await createAccounts(world); const { fee } = await wallet.transfer({ receiver: wallet2, @@ -669,7 +669,7 @@ test.concurrent("FSWallet.transfer - EGLD", async () => { }); test.concurrent("FSWallet.transfer - ESDTs", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, wallet2 } = await createAccounts(world); await wallet.transfer({ receiver: wallet2, @@ -685,7 +685,7 @@ test.concurrent("FSWallet.transfer - ESDTs", async () => { }); test.concurrent("FSWallet.deployContract", async () => { - using world = await startWorld(); + using world = await FSWorld.start({ explorerUrl: baseExplorerUrl }); const { wallet } = await createAccounts(world); const { contract } = await wallet.deployContract({ code: worldCode, @@ -705,7 +705,7 @@ test.concurrent("FSWallet.deployContract", async () => { }); test.concurrent("FSWallet.upgradeContract", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); await contract.setAccount({ code: worldCode, @@ -727,7 +727,7 @@ test.concurrent("FSWallet.upgradeContract", async () => { }); test.concurrent("FSWallet.callContract with EGLD", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); const { fee } = await wallet.callContract({ callee: contract, @@ -744,7 +744,7 @@ test.concurrent("FSWallet.callContract with EGLD", async () => { }); test.concurrent("FSWallet.callContract with ESDT", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); await wallet.callContract({ callee: contract, @@ -761,7 +761,7 @@ test.concurrent("FSWallet.callContract with ESDT", async () => { }); test.concurrent("FSWallet.callContract with return", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); const { returnData } = await wallet.callContract({ callee: contract, @@ -773,7 +773,7 @@ test.concurrent("FSWallet.callContract with return", async () => { }); test.concurrent("FSWallet.callContract - change the state", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); await wallet.callContract({ callee: contract, @@ -790,7 +790,7 @@ test.concurrent("FSWallet.callContract - change the state", async () => { }); test.concurrent("FSWallet.callContract failure", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); await expect( wallet.callContract({ @@ -809,7 +809,7 @@ test.concurrent("FSWallet.callContract failure", async () => { test.concurrent( "FSWallet.callContract.assertFail - correct parameters", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); await wallet .callContract({ @@ -823,7 +823,7 @@ test.concurrent( ); test.concurrent("FSWallet.callContract.assertFail - Wrong code", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); await expect( wallet @@ -842,7 +842,7 @@ test.concurrent("FSWallet.callContract.assertFail - Wrong code", async () => { test.concurrent( "FSWallet.callContract.assertFail - Wrong message", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); await expect( wallet @@ -862,7 +862,7 @@ test.concurrent( test.concurrent( "FSWallet.callContract.assertFail - Transaction not failing", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); await expect( wallet @@ -878,19 +878,19 @@ test.concurrent( ); test.concurrent("FSContract.getAccountNonce", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { contract } = await createAccounts(world); expect(await contract.getAccountNonce()).toEqual(0); }); test.concurrent("FSContract.getAccountBalance", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { contract } = await createAccounts(world); expect(await contract.getAccountBalance()).toEqual(10n ** 18n); }); test.concurrent("FSContract.getAccountKvs", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { contract } = await createAccounts(world); expect(await contract.getAccountKvs()).toEqual( e.kvs({ @@ -901,7 +901,7 @@ test.concurrent("FSContract.getAccountKvs", async () => { }); test.concurrent("FSContract.getAccountWithoutKvs", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { contract } = await createAccounts(world); assertAccount(await contract.getAccountWithoutKvs(), { nonce: 0, @@ -910,7 +910,7 @@ test.concurrent("FSContract.getAccountWithoutKvs", async () => { }); test.concurrent("FSContract.getAccount", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { wallet, contract } = await createAccounts(world); assertAccount(await contract.getAccount(), { nonce: 0, @@ -925,7 +925,7 @@ test.concurrent("FSContract.getAccount", async () => { }); test.concurrent("FSContract.setAccount - FSContract.getAccount", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { contract } = await createAccounts(world); const before = await contract.getAccount(); await contract.setAccount(before); @@ -934,7 +934,7 @@ test.concurrent("FSContract.setAccount - FSContract.getAccount", async () => { }); test.concurrent("FSContract.query", async () => { - using world = await startWorld(); + using world = await FSWorld.start(); const { contract } = await createAccounts(world); const { returnData } = await contract.query({ funcName: "multiply_by_n", @@ -943,8 +943,6 @@ test.concurrent("FSContract.query", async () => { assertVs(returnData, [e.U64(20n)]); }); -const startWorld = () => FSWorld.start({ explorerUrl: baseExplorerUrl }); - const createAccounts = async (world: FSWorld) => { const [wallet, wallet2, wallet3] = await world.createWallets([ { diff --git a/xsuite/src/world/lsworld.test.ts b/xsuite/src/world/lsworld.test.ts index 90d79314..8f823d94 100644 --- a/xsuite/src/world/lsworld.test.ts +++ b/xsuite/src/world/lsworld.test.ts @@ -28,7 +28,7 @@ const baseExplorerUrl = "http://explorer.local"; test.concurrent( "LSWorld.proxy.getAccountNonce on empty bech address", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); expect(await world.proxy.getAccountNonce(zeroBechAddress)).toEqual(0); }, ); @@ -36,7 +36,7 @@ test.concurrent( test.concurrent( "LSWorld.proxy.getAccountNonce on empty hex address", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); expect(await world.proxy.getAccountNonce(zeroHexAddress)).toEqual(0); }, ); @@ -44,7 +44,7 @@ test.concurrent( test.concurrent( "LSWorld.proxy.getAccountNonce on empty U8A address", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); expect(await world.proxy.getAccountNonce(zeroU8AAddress)).toEqual(0); }, ); @@ -52,7 +52,7 @@ test.concurrent( test.concurrent( "LSWorld.proxy.getAccountBalance on empty bech address", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); expect(await world.proxy.getAccountBalance(zeroBechAddress)).toEqual(0n); }, ); @@ -60,7 +60,7 @@ test.concurrent( test.concurrent( "LSWorld.proxy.getAccountBalance on empty hex address", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); expect(await world.proxy.getAccountBalance(zeroHexAddress)).toEqual(0n); }, ); @@ -68,23 +68,23 @@ test.concurrent( test.concurrent( "LSWorld.proxy.getAccountBalance on empty U8A address", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); expect(await world.proxy.getAccountBalance(zeroU8AAddress)).toEqual(0n); }, ); test.concurrent("LSWorld.proxy.getAccount on empty bech address", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); assertAccount(await world.proxy.getAccount(zeroBechAddress), emptyAccount); }); test.concurrent("LSWorld.proxy.getAccount on empty hex address", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); assertAccount(await world.proxy.getAccount(zeroHexAddress), emptyAccount); }); test.concurrent("LSWorld.proxy.getAccount on empty U8A address", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); assertAccount(await world.proxy.getAccount(zeroU8AAddress), emptyAccount); }); @@ -107,19 +107,19 @@ test.concurrent("LSWorld.newMainnet", () => { }); test.concurrent("LSWorld.newWallet", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const wallet = world.newWallet(zeroU8AAddress); expect(wallet.toTopU8A()).toEqual(zeroU8AAddress); }); test.concurrent("LSWorld.newContract", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const wallet = world.newWallet(zeroU8AAddress); expect(wallet.toTopU8A()).toEqual(zeroU8AAddress); }); test.concurrent("LSWorld.createWallet - empty wallet", async () => { - using world = await startWorld(); + using world = await LSWorld.start({ explorerUrl: baseExplorerUrl }); const wallet = await world.createWallet(); expect(wallet.explorerUrl).toEqual(`${baseExplorerUrl}/accounts/${wallet}`); expect(getAddressType(wallet)).toEqual("wallet"); @@ -127,20 +127,20 @@ test.concurrent("LSWorld.createWallet - empty wallet", async () => { }); test.concurrent("LSWorld.createWallet - with balance", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const wallet = await world.createWallet({ balance: 10n }); assertAccount(await wallet.getAccount(), { balance: 10n }); }); test.concurrent("LSWorld.createWallet - with address & balance", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const address = createAddressLike("wallet"); const wallet = await world.createWallet({ address, balance: 10n }); assertAccount(await wallet.getAccount(), { address, balance: 10n }); }); test.concurrent("LSWorld.createWallet - with shard", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const wallet0 = await world.createWallet({ address: { shard: 0 } }); const wallet1 = await world.createWallet({ address: { shard: 1 } }); const wallet2 = await world.createWallet({ address: { shard: 2 } }); @@ -153,7 +153,7 @@ test.concurrent("LSWorld.createWallet - with shard", async () => { }); test.concurrent("LSWorld.createContract - empty contract", async () => { - using world = await startWorld(); + using world = await LSWorld.start({ explorerUrl: baseExplorerUrl }); const contract = await world.createContract(); expect(contract.explorerUrl).toEqual( `${baseExplorerUrl}/accounts/${contract}`, @@ -163,26 +163,26 @@ test.concurrent("LSWorld.createContract - empty contract", async () => { }); test.concurrent("LSWorld.createContract - with balance", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const contract = await world.createContract({ balance: 10n }); assertAccount(await contract.getAccount(), { balance: 10n }); }); test.concurrent("LSWorld.createContract - with file:", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const contract = await world.createContract({ code: worldCode }); assertAccount(await contract.getAccount(), { code: worldCode }); }); test.concurrent("LSWorld.createContract - with address & file:", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const address = createAddressLike("vmContract"); const contract = await world.createContract({ address, code: worldCode }); assertAccount(await contract.getAccount(), { address, code: worldCode }); }); test.concurrent("LSWorld.createContract - with shard", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const contract0 = await world.createContract({ address: { shard: 0 } }); const contract1 = await world.createContract({ address: { shard: 1 } }); const contract2 = await world.createContract({ address: { shard: 2 } }); @@ -195,19 +195,19 @@ test.concurrent("LSWorld.createContract - with shard", async () => { }); test.concurrent("LSWorld.getAccountNonce", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const wallet = await world.createWallet({ nonce: 10 }); expect(await world.getAccountNonce(wallet)).toEqual(10); }); test.concurrent("LSWorld.getAccountBalance", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const wallet = await world.createWallet({ balance: 1234 }); expect(await world.getAccountBalance(wallet)).toEqual(1234n); }); test.concurrent("LSWorld.getAccountKvs", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const wallet = await world.createWallet({ kvs: [[e.Str("n"), e.U(1)]] }); expect(await world.getAccountKvs(wallet)).toEqual( e.kvs([[e.Str("n"), e.U(1)]]), @@ -215,13 +215,13 @@ test.concurrent("LSWorld.getAccountKvs", async () => { }); test.concurrent("LSWorld.getAccountWithoutKvs", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const wallet = await world.createWallet({ kvs: [[e.Str("n"), e.U(1)]] }); assertAccount(await world.getAccountWithoutKvs(wallet), { kvs: {} }); }); test.concurrent("LSWorld.getAccount", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const wallet = await world.createWallet({ kvs: [[e.Str("n"), e.U(1)]] }); assertAccount(await world.getAccount(wallet), { kvs: [[e.Str("n"), e.U(1)]], @@ -229,7 +229,7 @@ test.concurrent("LSWorld.getAccount", async () => { }); test.concurrent("LSWorld.getAllSerializableAccounts", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, wallet2, wallet3, contract } = await createAccounts(world); expect(await world.getAllSerializableAccounts()).toEqual( [ @@ -284,7 +284,7 @@ test.concurrent("LSWorld.getAllSerializableAccounts", async () => { }); test.concurrent("LSWorld.setAccounts", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const walletAddress = createAddressLike("wallet"); const contractAddress = createAddressLike("vmContract"); await world.setAccounts([ @@ -322,7 +322,7 @@ test.concurrent("LSWorld.setAccounts", async () => { }); test.concurrent("LSWorld.setAccount", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const walletAddress = createAddressLike("wallet"); const contractAddress = createAddressLike("vmContract"); await world.setAccount({ @@ -346,7 +346,7 @@ test.concurrent("LSWorld.setAccount", async () => { }); test.concurrent("LSWorld.setCurrentBlockInfo", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { contract } = await createAccounts(world); await world.setCurrentBlockInfo({ epoch: 100, @@ -362,7 +362,7 @@ test.concurrent("LSWorld.setCurrentBlockInfo", async () => { }); test.concurrent("LSWorld.setPreviousBlockInfo", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { contract } = await createAccounts(world); await world.setPreviousBlockInfo({ epoch: 10, @@ -378,7 +378,7 @@ test.concurrent("LSWorld.setPreviousBlockInfo", async () => { }); test.concurrent("LSWorld.query - basic", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { contract } = await createAccounts(world); const { returnData } = await world.query({ callee: contract, @@ -389,7 +389,7 @@ test.concurrent("LSWorld.query - basic", async () => { }); test.concurrent("LSWorld.query - sender", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); const { returnData } = await world.query({ callee: contract, @@ -400,7 +400,7 @@ test.concurrent("LSWorld.query - sender", async () => { }); test.concurrent("LSWorld.query - value", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { contract } = await createAccounts(world); const { returnData } = await world.query({ callee: contract, @@ -411,7 +411,7 @@ test.concurrent("LSWorld.query - value", async () => { }); test.concurrent("LSWorld.query.assertFail - correct parameters", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { contract } = await createAccounts(world); await world .query({ @@ -423,7 +423,7 @@ test.concurrent("LSWorld.query.assertFail - correct parameters", async () => { }); test.concurrent("LSWorld.executeTxs", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, wallet2, wallet3 } = await createAccounts(world); const [{ fee: fee1 }, { fee: fee2 }] = await world.executeTxs([ { @@ -451,7 +451,7 @@ test.concurrent("LSWorld.executeTxs", async () => { }); test.concurrent("LSWorld.executeTx", async () => { - using world = await startWorld(); + using world = await LSWorld.start({ explorerUrl: baseExplorerUrl }); const { wallet, wallet2 } = await createAccounts(world); const { hash, explorerUrl, gasUsed, fee } = await world.executeTx({ sender: wallet, @@ -471,7 +471,7 @@ test.concurrent("LSWorld.executeTx", async () => { }); test.concurrent("LSWorld.transfer", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, wallet2 } = await createAccounts(world); const { fee } = await world.transfer({ sender: wallet, @@ -488,7 +488,7 @@ test.concurrent("LSWorld.transfer", async () => { }); test.concurrent("LSWorld.deployContract", async () => { - using world = await startWorld(); + using world = await LSWorld.start({ explorerUrl: baseExplorerUrl }); const { wallet } = await createAccounts(world); const { contract } = await world.deployContract({ sender: wallet, @@ -509,7 +509,7 @@ test.concurrent("LSWorld.deployContract", async () => { }); test.concurrent("LSWorld.upgradeContract", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); await contract.setAccount({ code: worldCode, @@ -532,7 +532,7 @@ test.concurrent("LSWorld.upgradeContract", async () => { }); test.concurrent("LSWorld.callContract", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); const { fee } = await world.callContract({ sender: wallet, @@ -550,14 +550,14 @@ test.concurrent("LSWorld.callContract", async () => { }); test.concurrent("LSWorld.terminate", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); expect(world.server?.killed).toEqual(false); world.terminate(); expect(world.server?.killed).toEqual(true); }); test.concurrent("LSWallet.query", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); const { returnData } = await wallet.query({ callee: contract, @@ -567,7 +567,7 @@ test.concurrent("LSWallet.query", async () => { }); test.concurrent("LSWallet.query - try to change the state", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); assertAccount(await wallet.getAccount(), { balance: 10n ** 18n, @@ -596,7 +596,7 @@ test.concurrent("LSWallet.query - try to change the state", async () => { }); test.todo("LSWallet.query - esdts", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); const { returnData } = await wallet.query({ callee: contract, @@ -613,7 +613,7 @@ test.todo("LSWallet.query - esdts", async () => { }); test.concurrent("LSWallet.callContract failure", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { contract } = await createAccounts(world); await expect( world.query({ @@ -629,19 +629,19 @@ test.concurrent("LSWallet.callContract failure", async () => { }); test.concurrent("LSWallet.getAccountNonce", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet } = await createAccounts(world); expect(await wallet.getAccountNonce()).toEqual(0); }); test.concurrent("LSWallet.getAccountBalance", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet } = await createAccounts(world); expect(await wallet.getAccountBalance()).toEqual(10n ** 18n); }); test.concurrent("LSWallet.getAccountKvs", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet } = await createAccounts(world); expect(await wallet.getAccountKvs()).toEqual( e.kvs({ esdts: [{ id: fftId, amount: 10n ** 18n }] }), @@ -649,7 +649,7 @@ test.concurrent("LSWallet.getAccountKvs", async () => { }); test.concurrent("LSWallet.getAccountWithoutKvs", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet } = await createAccounts(world); assertAccount(await wallet.getAccountWithoutKvs(), { nonce: 0, @@ -662,7 +662,7 @@ test.concurrent("LSWallet.getAccountWithoutKvs", async () => { }); test.concurrent("LSWallet.getAccount", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet } = await createAccounts(world); assertAccount(await wallet.getAccount(), { nonce: 0, @@ -676,7 +676,7 @@ test.concurrent("LSWallet.getAccount", async () => { }); test.concurrent("LSWallet.setAccount - LSWallet.getAccount", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet } = await createAccounts(world); const before = await wallet.getAccount(); await wallet.setAccount(before); @@ -685,7 +685,7 @@ test.concurrent("LSWallet.setAccount - LSWallet.getAccount", async () => { }); test.concurrent("LSWallet.executeTx", async () => { - using world = await startWorld(); + using world = await LSWorld.start({ explorerUrl: baseExplorerUrl }); const { wallet, wallet2 } = await createAccounts(world); const { hash, explorerUrl, gasUsed, fee } = await wallet.executeTx({ receiver: wallet2, @@ -704,7 +704,7 @@ test.concurrent("LSWallet.executeTx", async () => { }); test.concurrent("LSWallet.transfer - EGLD", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, wallet2 } = await createAccounts(world); const { fee } = await wallet.transfer({ receiver: wallet2, @@ -720,7 +720,7 @@ test.concurrent("LSWallet.transfer - EGLD", async () => { }); test.concurrent("LSWallet.transfer - ESDTs", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, wallet2 } = await createAccounts(world); await wallet.transfer({ receiver: wallet2, @@ -736,7 +736,7 @@ test.concurrent("LSWallet.transfer - ESDTs", async () => { }); test.concurrent("LSWallet.deployContract", async () => { - using world = await startWorld(); + using world = await LSWorld.start({ explorerUrl: baseExplorerUrl }); const { wallet } = await createAccounts(world); const { contract } = await wallet.deployContract({ code: worldCode, @@ -756,7 +756,7 @@ test.concurrent("LSWallet.deployContract", async () => { }); test.concurrent("LSWallet.upgradeContract", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); await contract.setAccount({ code: worldCode, @@ -778,7 +778,7 @@ test.concurrent("LSWallet.upgradeContract", async () => { }); test.concurrent("LSWallet.callContract with EGLD", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); const { fee } = await wallet.callContract({ callee: contract, @@ -795,7 +795,7 @@ test.concurrent("LSWallet.callContract with EGLD", async () => { }); test.concurrent("LSWallet.callContract with ESDT", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); await wallet.callContract({ callee: contract, @@ -812,7 +812,7 @@ test.concurrent("LSWallet.callContract with ESDT", async () => { }); test.concurrent("LSWallet.callContract with return", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); const { returnData } = await wallet.callContract({ callee: contract, @@ -824,7 +824,7 @@ test.concurrent("LSWallet.callContract with return", async () => { }); test.concurrent("LSWallet.callContract - change the state", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); await wallet.callContract({ callee: contract, @@ -841,7 +841,7 @@ test.concurrent("LSWallet.callContract - change the state", async () => { }); test.concurrent("LSWallet.callContract failure", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); await expect( wallet.callContract({ @@ -860,7 +860,7 @@ test.concurrent("LSWallet.callContract failure", async () => { test.concurrent( "LSWallet.callContract.assertFail - correct parameters", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); await wallet .callContract({ @@ -874,7 +874,7 @@ test.concurrent( ); test.concurrent("LSWallet.callContract.assertFail - Wrong code", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); await expect( wallet @@ -893,7 +893,7 @@ test.concurrent("LSWallet.callContract.assertFail - Wrong code", async () => { test.concurrent( "LSWallet.callContract.assertFail - Wrong message", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); await expect( wallet @@ -913,7 +913,7 @@ test.concurrent( test.concurrent( "LSWallet.callContract.assertFail - Transaction not failing", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); await expect( wallet @@ -929,19 +929,19 @@ test.concurrent( ); test.concurrent("LSContract.getAccountNonce", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { contract } = await createAccounts(world); expect(await contract.getAccountNonce()).toEqual(0); }); test.concurrent("LSContract.getAccountBalance", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { contract } = await createAccounts(world); expect(await contract.getAccountBalance()).toEqual(10n ** 18n); }); test.concurrent("LSContract.getAccountKvs", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { contract } = await createAccounts(world); expect(await contract.getAccountKvs()).toEqual( e.kvs({ @@ -952,7 +952,7 @@ test.concurrent("LSContract.getAccountKvs", async () => { }); test.concurrent("LSContract.getAccountWithoutKvs", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { contract } = await createAccounts(world); assertAccount(await contract.getAccountWithoutKvs(), { nonce: 0, @@ -961,7 +961,7 @@ test.concurrent("LSContract.getAccountWithoutKvs", async () => { }); test.concurrent("LSContract.getAccount", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { wallet, contract } = await createAccounts(world); assertAccount(await contract.getAccount(), { nonce: 0, @@ -976,7 +976,7 @@ test.concurrent("LSContract.getAccount", async () => { }); test.concurrent("LSContract.setAccount - LSContract.getAccount", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { contract } = await createAccounts(world); const before = await contract.getAccount(); await contract.setAccount(before); @@ -985,7 +985,7 @@ test.concurrent("LSContract.setAccount - LSContract.getAccount", async () => { }); test.concurrent("LSContract.query", async () => { - using world = await startWorld(); + using world = await LSWorld.start(); const { contract } = await createAccounts(world); const { returnData } = await contract.query({ funcName: "multiply_by_n", @@ -994,8 +994,6 @@ test.concurrent("LSContract.query", async () => { assertVs(returnData, [e.U64(20n)]); }); -const startWorld = () => LSWorld.start({ explorerUrl: baseExplorerUrl }); - const createAccounts = async (world: LSWorld) => { const [wallet, wallet2, wallet3] = await world.createWallets([ { From 8975be073f3ebd00c6ffb966ecfc1fe5cfecf932 Mon Sep 17 00:00:00 2001 From: lcswillems Date: Sun, 7 Jul 2024 10:27:51 +0200 Subject: [PATCH 4/4] Fix console logging of transaction URL --- contracts/blank/interact/index.ts | 6 +++--- contracts/vested-transfers/interact/index.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/blank/interact/index.ts b/contracts/blank/interact/index.ts index 4de24a6c..91c3ca54 100644 --- a/contracts/blank/interact/index.ts +++ b/contracts/blank/interact/index.ts @@ -17,7 +17,7 @@ program.command("deploy").action(async () => { codeMetadata: ["upgradeable"], gasLimit: 20_000_000, }); - console.log("Transaction:", result.tx.explorerUrl); + console.log("Transaction:", result.explorerUrl); console.log("Contract:", result.contract.explorerUrl); }); @@ -29,7 +29,7 @@ program.command("upgrade").action(async () => { codeMetadata: ["upgradeable"], gasLimit: 20_000_000, }); - console.log("Transaction:", result.tx.explorerUrl); + console.log("Transaction:", result.explorerUrl); }); program.command("ClaimDeveloperRewards").action(async () => { @@ -39,7 +39,7 @@ program.command("ClaimDeveloperRewards").action(async () => { funcName: "ClaimDeveloperRewards", gasLimit: 10_000_000, }); - console.log("Transaction:", result.tx.explorerUrl); + console.log("Transaction:", result.explorerUrl); }); program.parse(process.argv); diff --git a/contracts/vested-transfers/interact/index.ts b/contracts/vested-transfers/interact/index.ts index b8c3333a..eca5eb8d 100644 --- a/contracts/vested-transfers/interact/index.ts +++ b/contracts/vested-transfers/interact/index.ts @@ -17,7 +17,7 @@ program.command("deploy").action(async () => { codeMetadata: ["upgradeable"], gasLimit: 100_000_000, }); - console.log("Transaction:", result.tx.explorerUrl); + console.log("Transaction:", result.explorerUrl); console.log("Contract:", result.contract.explorerUrl); }); @@ -29,7 +29,7 @@ program.command("upgrade").action(async () => { codeMetadata: ["upgradeable"], gasLimit: 100_000_000, }); - console.log("Transaction:", result.tx.explorerUrl); + console.log("Transaction:", result.explorerUrl); }); program.command("ClaimDeveloperRewards").action(async () => { @@ -39,7 +39,7 @@ program.command("ClaimDeveloperRewards").action(async () => { funcName: "ClaimDeveloperRewards", gasLimit: 10_000_000, }); - console.log("Transaction:", result.tx.explorerUrl); + console.log("Transaction:", result.explorerUrl); }); program.parse(process.argv);