diff --git a/package-lock.json b/package-lock.json index da390a2eb..02f8ad220 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "elliptic": "^6.5.5" }, "devDependencies": { - "@hashgraph/hedera-local": "^2.25.2", + "@hashgraph/hedera-local": "^2.26.2", "@hashgraph/sdk": "^2.45.0", "@nomicfoundation/hardhat-chai-matchers": "^2.0.7", "@nomicfoundation/hardhat-foundry": "^1.1.2", @@ -921,19 +921,19 @@ } }, "node_modules/@hashgraph/hedera-local": { - "version": "2.25.2", - "resolved": "https://registry.npmjs.org/@hashgraph/hedera-local/-/hedera-local-2.25.2.tgz", - "integrity": "sha512-44ib0ROursK9EzPCAsYESuwTaJdji1m2kYydA4ht6b+C4zJDEo6SlY2huIzET73bQvAktF43JF+xUI2KIOn0ig==", + "version": "2.26.2", + "resolved": "https://registry.npmjs.org/@hashgraph/hedera-local/-/hedera-local-2.26.2.tgz", + "integrity": "sha512-bLp8bQ/VnR3hjzqMZvg850NzGmyTQRAmilZMqB34lww+GkVB9QkcoddvmcrnD8Ctyzxu/u/RIIaWB0G2vjtATA==", "dev": true, "dependencies": { - "@hashgraph/sdk": "^2.43.0", + "@hashgraph/sdk": "2.43.0", "blessed": "^0.1.81", "blessed-terminal": "^0.1.22", "csv-parser": "^3.0.0", "detect-port": "^1.5.1", "dockerode": "^4.0.2", "dotenv": "^16.4.5", - "ethers": "^6.11.1", + "ethers": "^6.13.0", "js-yaml": "^4.1.0", "rimraf": "^5.0.5", "semver": "^7.6.0", @@ -945,6 +945,56 @@ "hedera": "build/index.js" } }, + "node_modules/@hashgraph/hedera-local/node_modules/@hashgraph/proto": { + "version": "2.14.0-beta.5", + "resolved": "https://registry.npmjs.org/@hashgraph/proto/-/proto-2.14.0-beta.5.tgz", + "integrity": "sha512-UrIbLdctpD//Ua99Z4PnknbR8220nc1Pzv0nkDJ1emZE9EAi7YOOry2Dw660azQHWfVw/HhqECPdiKrTIZ2b+Q==", + "dev": true, + "dependencies": { + "long": "^4.0.0", + "protobufjs": "^7.2.5" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@hashgraph/hedera-local/node_modules/@hashgraph/sdk": { + "version": "2.43.0", + "resolved": "https://registry.npmjs.org/@hashgraph/sdk/-/sdk-2.43.0.tgz", + "integrity": "sha512-3MOZDL8Tm+Ciu+e402R9mSPfAUaiv8GCY+G6prUDOJzkNubRGm7gNxpeMlmHDZepc+EOkuq+kOq3QvB+2IvgWQ==", + "dev": true, + "dependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@grpc/grpc-js": "1.8.2", + "@hashgraph/cryptography": "1.4.8-beta.5", + "@hashgraph/proto": "2.14.0-beta.5", + "axios": "^1.6.4", + "bignumber.js": "^9.1.1", + "bn.js": "^5.1.1", + "crypto-js": "^4.2.0", + "js-base64": "^3.7.4", + "long": "^4.0.0", + "pino": "^8.14.1", + "pino-pretty": "^10.0.0", + "protobufjs": "^7.2.5", + "rfc4648": "^1.5.3", + "utf8": "^3.0.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "expo": "^49.0.16" + }, + "peerDependenciesMeta": { + "expo": { + "optional": true + } + } + }, "node_modules/@hashgraph/hedera-local/node_modules/ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -3947,9 +3997,9 @@ } }, "node_modules/ethers": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.11.1.tgz", - "integrity": "sha512-mxTAE6wqJQAbp5QAe/+o+rXOID7Nw91OZXvgpjDa1r4fAbq2Nu314oEZSbjoRLacuCzs7kUC3clEvkCQowffGg==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.0.tgz", + "integrity": "sha512-+yyQQQWEntY5UVbCv++guA14RRVFm1rSnO1GoLFdrK7/XRWMoktNgyG9UjwxrQqGBfGyFKknNZ81YpUS2emCgg==", "dev": true, "funding": [ { @@ -8492,19 +8542,19 @@ } }, "@hashgraph/hedera-local": { - "version": "2.25.2", - "resolved": "https://registry.npmjs.org/@hashgraph/hedera-local/-/hedera-local-2.25.2.tgz", - "integrity": "sha512-44ib0ROursK9EzPCAsYESuwTaJdji1m2kYydA4ht6b+C4zJDEo6SlY2huIzET73bQvAktF43JF+xUI2KIOn0ig==", + "version": "2.26.2", + "resolved": "https://registry.npmjs.org/@hashgraph/hedera-local/-/hedera-local-2.26.2.tgz", + "integrity": "sha512-bLp8bQ/VnR3hjzqMZvg850NzGmyTQRAmilZMqB34lww+GkVB9QkcoddvmcrnD8Ctyzxu/u/RIIaWB0G2vjtATA==", "dev": true, "requires": { - "@hashgraph/sdk": "^2.43.0", + "@hashgraph/sdk": "2.43.0", "blessed": "^0.1.81", "blessed-terminal": "^0.1.22", "csv-parser": "^3.0.0", "detect-port": "^1.5.1", "dockerode": "^4.0.2", "dotenv": "^16.4.5", - "ethers": "^6.11.1", + "ethers": "^6.13.0", "js-yaml": "^4.1.0", "rimraf": "^5.0.5", "semver": "^7.6.0", @@ -8513,6 +8563,42 @@ "yargs": "^17.7.2" }, "dependencies": { + "@hashgraph/proto": { + "version": "2.14.0-beta.5", + "resolved": "https://registry.npmjs.org/@hashgraph/proto/-/proto-2.14.0-beta.5.tgz", + "integrity": "sha512-UrIbLdctpD//Ua99Z4PnknbR8220nc1Pzv0nkDJ1emZE9EAi7YOOry2Dw660azQHWfVw/HhqECPdiKrTIZ2b+Q==", + "dev": true, + "requires": { + "long": "^4.0.0", + "protobufjs": "^7.2.5" + } + }, + "@hashgraph/sdk": { + "version": "2.43.0", + "resolved": "https://registry.npmjs.org/@hashgraph/sdk/-/sdk-2.43.0.tgz", + "integrity": "sha512-3MOZDL8Tm+Ciu+e402R9mSPfAUaiv8GCY+G6prUDOJzkNubRGm7gNxpeMlmHDZepc+EOkuq+kOq3QvB+2IvgWQ==", + "dev": true, + "requires": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@grpc/grpc-js": "1.8.2", + "@hashgraph/cryptography": "1.4.8-beta.5", + "@hashgraph/proto": "2.14.0-beta.5", + "axios": "^1.6.4", + "bignumber.js": "^9.1.1", + "bn.js": "^5.1.1", + "crypto-js": "^4.2.0", + "js-base64": "^3.7.4", + "long": "^4.0.0", + "pino": "^8.14.1", + "pino-pretty": "^10.0.0", + "protobufjs": "^7.2.5", + "rfc4648": "^1.5.3", + "utf8": "^3.0.0" + } + }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -10841,9 +10927,9 @@ } }, "ethers": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.11.1.tgz", - "integrity": "sha512-mxTAE6wqJQAbp5QAe/+o+rXOID7Nw91OZXvgpjDa1r4fAbq2Nu314oEZSbjoRLacuCzs7kUC3clEvkCQowffGg==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.0.tgz", + "integrity": "sha512-+yyQQQWEntY5UVbCv++guA14RRVFm1rSnO1GoLFdrK7/XRWMoktNgyG9UjwxrQqGBfGyFKknNZ81YpUS2emCgg==", "dev": true, "requires": { "@adraffy/ens-normalize": "1.10.1", diff --git a/package.json b/package.json index 08a284487..bff265764 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "prepare": "husky install" }, "devDependencies": { - "@hashgraph/hedera-local": "^2.25.2", + "@hashgraph/hedera-local": "^2.26.2", "@hashgraph/sdk": "^2.45.0", "@nomicfoundation/hardhat-chai-matchers": "^2.0.7", "@nomicfoundation/hardhat-foundry": "^1.1.2", diff --git a/test/constants.js b/test/constants.js index e9a796eff..7fe540bd7 100644 --- a/test/constants.js +++ b/test/constants.js @@ -198,7 +198,7 @@ const Contract = { }; const CALL_EXCEPTION = 'CALL_EXCEPTION'; -const CONTRACT_REVERT_EXECUTED_CODE = -32008; +const CONTRACT_REVERT_EXECUTED_CODE = 3; const GAS_LIMIT_1_000_000 = { gasLimit: 1_000_000 }; const GAS_LIMIT_10_000_000 = { gasLimit: 10_000_000 }; const GAS_LIMIT_800000 = { gasLimit: 800000 }; diff --git a/test/hts-precompile/token-managment/tokenManagmentContract.js b/test/hts-precompile/token-managment/tokenManagmentContract.js index d33ecf141..5c056fcf1 100644 --- a/test/hts-precompile/token-managment/tokenManagmentContract.js +++ b/test/hts-precompile/token-managment/tokenManagmentContract.js @@ -704,11 +704,11 @@ describe('TokenManagmentContract Test Suite', function () { it('should not be able to pause the token with different PAUSE key', async function () { const pauseTokenTx = await tokenManagmentContract - .connect(signers[1]) - .pauseTokenPublic(tokenAddress); + .connect(signers[1]) + .pauseTokenPublic(tokenAddress); const unpauseTokenTx = await tokenManagmentContract - .connect(signers[1]) - .unpauseTokenPublic(tokenAddress); + .connect(signers[1]) + .unpauseTokenPublic(tokenAddress); await utils.expectToFail(pauseTokenTx, Constants.CALL_EXCEPTION); await utils.expectToFail(unpauseTokenTx, Constants.CALL_EXCEPTION); @@ -816,26 +816,22 @@ describe('TokenManagmentContract Test Suite', function () { it('should not be able to wipe the token with different WIPE key', async function () { const wipeAmount = 3; await tokenTransferContract.transferTokensPublic( - tokenAddress, - [signers[0].address, signers[1].address], - [-wipeAmount, wipeAmount] + tokenAddress, + [signers[0].address, signers[1].address], + [-wipeAmount, wipeAmount] ); // await until the new balance is settled for signers[1] await pollForNewERC20Balance( - erc20Contract, - tokenAddress, - signers[1].address, - 0n + erc20Contract, + tokenAddress, + signers[1].address, + 0n ); const wipeTokenTx = await tokenManagmentContract - .connect(signers[1]) - .wipeTokenAccountPublic( - tokenAddress, - signers[1].address, - wipeAmount - ); + .connect(signers[1]) + .wipeTokenAccountPublic(tokenAddress, signers[1].address, wipeAmount); await utils.expectToFail(wipeTokenTx, Constants.CALL_EXCEPTION); }); @@ -950,17 +946,17 @@ describe('TokenManagmentContract Test Suite', function () { it('should not be able to freeze the token with different FREEZE key', async function () { const freezeTokenTx = await tokenManagmentContract - .connect(signers[1]) - .freezeTokenPublic( - tokenAddress, - await tokenCreateContract.getAddress() - ); + .connect(signers[1]) + .freezeTokenPublic( + tokenAddress, + await tokenCreateContract.getAddress() + ); const unfreezeTokenTx = await tokenManagmentContract - .connect(signers[1]) - .unfreezeTokenPublic( - tokenAddress, - await tokenCreateContract.getAddress() - ); + .connect(signers[1]) + .unfreezeTokenPublic( + tokenAddress, + await tokenCreateContract.getAddress() + ); await utils.expectToFail(freezeTokenTx, Constants.CALL_EXCEPTION); await utils.expectToFail(unfreezeTokenTx, Constants.CALL_EXCEPTION); @@ -1035,22 +1031,20 @@ describe('TokenManagmentContract Test Suite', function () { }); it('should be able to perform admin action with TokenManagementContract as ADMIN key', async function () { - console.log(tokenAddress); - const updatedKey = updateTokenInfoValues( - utils.KeyValueType.CONTRACT_ID, - await tokenTransferContract.getAddress() + utils.KeyValueType.CONTRACT_ID, + await tokenTransferContract.getAddress() ); const updateTokenKeyTx = await tokenManagmentContract - .connect(signers[1]) - .updateTokenKeysPublic(tokenAddress, [ - [utils.KeyType.SUPPLY, updatedKey], - ]); + .connect(signers[1]) + .updateTokenKeysPublic(tokenAddress, [ + [utils.KeyType.SUPPLY, updatedKey], + ]); expect( - (await updateTokenKeyTx.wait()).logs.filter( - (e) => e.fragment.name === Constants.Events.ResponseCode - )[0].args.responseCode + (await updateTokenKeyTx.wait()).logs.filter( + (e) => e.fragment.name === Constants.Events.ResponseCode + )[0].args.responseCode ).to.eq(TX_SUCCESS_CODE); }); }); diff --git a/test/multicall/Multicall.js b/test/multicall/Multicall.js index 5700cd4e6..1e2cf77e9 100644 --- a/test/multicall/Multicall.js +++ b/test/multicall/Multicall.js @@ -263,9 +263,11 @@ describe('Multicall Test Suite', function () { expect(bytes).to.gte(42624); }); - it('should NOT be able to aggregate 115 calls to processLongOutput', async function () { - const n = 115; - const maxDataSize = 25 * 1024 * 2; // 25 kb + it('should NOT be able to aggregate 585 calls to processLongOutput', async function () { + // @note: since mirror-node@v0.105.0, the maximum data size was increased to 128 KiB. + const maxDataSize = 128 * 1024 * 2; // 262144 characters - 128 KiB + const n = 585; // 262218 characters ~ 128.03 KiB + let hasError = false; try { await multicallProcessLongOutput(n); @@ -275,7 +277,7 @@ describe('Multicall Test Suite', function () { expect(e.message).to.exist; // Output is too large and the call is reverted. - // The call exceeded the call size limit of 25KB + // The call exceeded the call size limit of 128 KiB const EXPECTED_ERROR_MESSAGE = `exceeds ${maxDataSize} characters`; expect(e.message).to.contain(EXPECTED_ERROR_MESSAGE); }