From 987afbc5a11f9620dfd2b93d5ea8abea7f48a8e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Fri, 20 Sep 2024 12:20:37 +0300 Subject: [PATCH 1/3] Adjust register cost for dynamic NFTs. --- package-lock.json | 4 ++-- package.json | 2 +- .../tokenManagementTransactionIntentsFactory.spec.ts | 6 +++--- .../tokenManagementTransactionsFactory.ts | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5c83ae96..fa0de3de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@multiversx/sdk-core", - "version": "13.6.1", + "version": "13.6.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@multiversx/sdk-core", - "version": "13.6.1", + "version": "13.6.2", "license": "MIT", "dependencies": { "@multiversx/sdk-transaction-decoder": "1.0.2", diff --git a/package.json b/package.json index 11211ca8..0e1ae4ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-core", - "version": "13.6.1", + "version": "13.6.2", "description": "MultiversX SDK for JavaScript and TypeScript", "author": "MultiversX", "homepage": "https://multiversx.com", diff --git a/src/transactionsFactories/tokenManagementTransactionIntentsFactory.spec.ts b/src/transactionsFactories/tokenManagementTransactionIntentsFactory.spec.ts index 9d7ada3e..f5c48990 100644 --- a/src/transactionsFactories/tokenManagementTransactionIntentsFactory.spec.ts +++ b/src/transactionsFactories/tokenManagementTransactionIntentsFactory.spec.ts @@ -1,9 +1,9 @@ import { assert } from "chai"; +import { Address } from "../address"; import { ESDT_CONTRACT_ADDRESS_HEX } from "../constants"; import { loadTestWallets, TestWallet } from "../testutils"; import { TokenManagementTransactionsFactory } from "./tokenManagementTransactionsFactory"; import { TransactionsFactoryConfig } from "./transactionsFactoryConfig"; -import { Address } from "../address"; describe("test token management transactions factory", () => { let frank: TestWallet, grace: TestWallet; @@ -354,7 +354,7 @@ describe("test token management transactions factory", () => { assert.deepEqual(transaction.data, Buffer.from("registerDynamic@54657374@544553542d313233343536@464e47")); assert.equal(transaction.sender, grace.address.toString()); assert.equal(transaction.receiver, Address.newFromHex(ESDT_CONTRACT_ADDRESS_HEX, config.addressHrp).toBech32()); - assert.equal(transaction.value, 0n); + assert.equal(transaction.value, 50000000000000000n); assert.equal(transaction.gasLimit, 60131000n); }); @@ -372,7 +372,7 @@ describe("test token management transactions factory", () => { ); assert.equal(transaction.sender, grace.address.toString()); assert.equal(transaction.receiver, Address.newFromHex(ESDT_CONTRACT_ADDRESS_HEX, config.addressHrp).toBech32()); - assert.equal(transaction.value, 0n); + assert.equal(transaction.value, 50000000000000000n); assert.equal(transaction.gasLimit, 60152000n); }); }); diff --git a/src/transactionsFactories/tokenManagementTransactionsFactory.ts b/src/transactionsFactories/tokenManagementTransactionsFactory.ts index eef02df8..b674313a 100644 --- a/src/transactionsFactories/tokenManagementTransactionsFactory.ts +++ b/src/transactionsFactories/tokenManagementTransactionsFactory.ts @@ -856,6 +856,7 @@ export class TokenManagementTransactionsFactory { dataParts: dataParts, gasLimit: this.config.gasLimitRegisterDynamic, addDataMovementGas: true, + amount: this.config.issueCost, }).build(); } @@ -881,6 +882,7 @@ export class TokenManagementTransactionsFactory { dataParts: dataParts, gasLimit: this.config.gasLimitRegisterDynamic, addDataMovementGas: true, + amount: this.config.issueCost, }).build(); } From 846101ff3f8a60e42d40fa0ddd51bcfdab28bd16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Fri, 20 Sep 2024 13:55:47 +0300 Subject: [PATCH 2/3] Longer delays for localnet tests. --- .github/workflows/test-localnet.yml | 2 +- src/transaction.local.net.spec.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-localnet.yml b/.github/workflows/test-localnet.yml index 0bb7c4d7..cdeb1f1a 100644 --- a/.github/workflows/test-localnet.yml +++ b/.github/workflows/test-localnet.yml @@ -42,7 +42,7 @@ jobs: mkdir -p ~/localnet && cd ~/localnet mxpy localnet setup nohup mxpy localnet start > localnet.log 2>&1 & echo $! > localnet.pid - sleep 60 # Allow time for the testnet to fully start + sleep 90 # Allow time for the testnet to fully start # Step 6: Install Node.js and dependencies - name: Set up Node.js environment diff --git a/src/transaction.local.net.spec.ts b/src/transaction.local.net.spec.ts index 84409123..15082da7 100644 --- a/src/transaction.local.net.spec.ts +++ b/src/transaction.local.net.spec.ts @@ -5,11 +5,11 @@ import { loadTestWallets, TestWallet } from "./testutils"; import { createLocalnetProvider, INetworkProvider } from "./testutils/networkProviders"; import { TokenTransfer } from "./tokens"; import { Transaction } from "./transaction"; +import { TransactionComputer } from "./transactionComputer"; import { TransactionPayload } from "./transactionPayload"; import { TransactionWatcher } from "./transactionWatcher"; import { TransactionsFactoryConfig } from "./transactionsFactories/transactionsFactoryConfig"; import { TransferTransactionsFactory } from "./transactionsFactories/transferTransactionsFactory"; -import { TransactionComputer } from "./transactionComputer"; describe("test transaction", function () { let alice: TestWallet, bob: TestWallet; @@ -30,7 +30,7 @@ describe("test transaction", function () { } it("should send transactions and wait for completion", async function () { - this.timeout(70000); + this.timeout(80000); let provider = createLocalnetProvider(); let watcher = createTransactionWatcher(provider); @@ -76,7 +76,7 @@ describe("test transaction", function () { }); it("should send transaction and wait for completion using the new proxy provider", async function () { - this.timeout(70000); + this.timeout(80000); let provider = createLocalnetProvider(); let watcher = createTransactionWatcher(provider); @@ -142,7 +142,7 @@ describe("test transaction", function () { }); it("should create transaction using the TokenTransferFactory", async function () { - this.timeout(70000); + this.timeout(80000); const provider = createLocalnetProvider(); const watcher = createTransactionWatcher(provider); From 5a21feff12df6e40332b3049a3bbd5d6219743b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Fri, 20 Sep 2024 14:09:47 +0300 Subject: [PATCH 3/3] More time for localnet to start. --- .github/workflows/test-localnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-localnet.yml b/.github/workflows/test-localnet.yml index cdeb1f1a..1faa2689 100644 --- a/.github/workflows/test-localnet.yml +++ b/.github/workflows/test-localnet.yml @@ -42,7 +42,7 @@ jobs: mkdir -p ~/localnet && cd ~/localnet mxpy localnet setup nohup mxpy localnet start > localnet.log 2>&1 & echo $! > localnet.pid - sleep 90 # Allow time for the testnet to fully start + sleep 120 # Allow time for the testnet to fully start # Step 6: Install Node.js and dependencies - name: Set up Node.js environment