Skip to content

Commit

Permalink
build(deps-dev): Bump @hashgraph/hedera-local from 2.25.2 to 2.26.2 (#…
Browse files Browse the repository at this point in the history
…799)

* build(deps-dev): Bump @hashgraph/hedera-local from 2.25.2 to 2.26.0

Bumps [@hashgraph/hedera-local](https://github.com/hashgraph/hedera-local-node) from 2.25.2 to 2.26.0.
- [Release notes](https://github.com/hashgraph/hedera-local-node/releases)
- [Commits](hashgraph/hedera-local-node@v.2.25.2...v2.26.0)

---
updated-dependencies:
- dependency-name: "@hashgraph/hedera-local"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* build(deps-dev): Bump @hashgraph/hedera-local from 2.25.2 to 2.26.1

Signed-off-by: Logan Nguyen <[email protected]>

* fix: updated CONTRACT_REVERT error code to the value 3

Signed-off-by: Logan Nguyen <[email protected]>

* fix: increased maxDataSize for multicall test

Signed-off-by: Logan Nguyen <[email protected]>

* dep: upgraded local-node to 2.26.2

Signed-off-by: Logan Nguyen <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Logan Nguyen <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Logan Nguyen <[email protected]>
  • Loading branch information
dependabot[bot] and quiet-node authored Jun 17, 2024
1 parent c4691a4 commit 024064d
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 61 deletions.
120 changes: 103 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion test/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
70 changes: 32 additions & 38 deletions test/hts-precompile/token-managment/tokenManagmentContract.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
});

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
});
});
Expand Down
10 changes: 6 additions & 4 deletions test/multicall/Multicall.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected], 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);
Expand All @@ -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);
}
Expand Down

0 comments on commit 024064d

Please sign in to comment.