From efb75ce595b6a5b6b2ecff4846ec2f08d99584d3 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 19 Aug 2024 19:50:28 +0530 Subject: [PATCH 01/11] update solc npm version --- libs/remix-debug/package.json | 2 +- libs/remix-lib/package.json | 2 +- libs/remix-solidity/package.json | 2 +- libs/remix-tests/package.json | 2 +- package.json | 2 +- yarn.lock | 17 ++++++++++------- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/libs/remix-debug/package.json b/libs/remix-debug/package.json index cea1b29fc1..3ac26c3cf7 100644 --- a/libs/remix-debug/package.json +++ b/libs/remix-debug/package.json @@ -52,7 +52,7 @@ "@babel/preset-stage-0": "^7.0.0", "babel-eslint": "^7.1.1", "babelify": "^10.0.0", - "solc": "^0.7.4", + "solc": "0.8.26", "tape": "^4.6.0" }, "publishConfig": { diff --git a/libs/remix-lib/package.json b/libs/remix-lib/package.json index 9d7702df50..3dc590e3e8 100644 --- a/libs/remix-lib/package.json +++ b/libs/remix-lib/package.json @@ -25,7 +25,7 @@ "events": "^3.0.0", "from-exponential": "1.1.1", "rlp": "^3.0.0", - "solc": "^0.7.4", + "solc": "0.8.26", "string-similarity": "^4.0.4", "web3": "^4.1.1", "web3-validator": "^2.0.0" diff --git a/libs/remix-solidity/package.json b/libs/remix-solidity/package.json index d711240857..b95adccd1a 100644 --- a/libs/remix-solidity/package.json +++ b/libs/remix-solidity/package.json @@ -26,7 +26,7 @@ "ethjs-util": "^0.1.6", "minixhr": "^3.2.2", "semver": "^6.3.0", - "solc": "^0.7.4", + "solc": "0.8.26", "string-similarity": "^4.0.4", "web3": "^4.1.1", "webworkify-webpack": "^2.1.5" diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index ab9f672b98..5b5dc898d6 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -58,7 +58,7 @@ "express-ws": "^4.0.0", "merge": "^1.2.0", "signale": "^1.4.0", - "solc": "^0.7.4", + "solc": "0.8.26", "string-similarity": "^4.0.4", "time-stamp": "^2.2.0", "tslib": "^2.3.0", diff --git a/package.json b/package.json index 94e9a84a1b..7db9ea7eb2 100644 --- a/package.json +++ b/package.json @@ -358,7 +358,7 @@ "request": "^2.83.0", "rimraf": "^2.6.1", "semver": "^7.4.0", - "solc": "^0.7.4", + "solc": "0.8.26", "stream-browserify": "^3.0.0", "stream-http": "^3.2.0", "style-loader": "^3.3.1", diff --git a/yarn.lock b/yarn.lock index 410375cc73..e07bc5f64b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12400,6 +12400,11 @@ commander@^7.0.0, commander@^7.2.0: resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== +commander@^8.1.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" + integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== + commander@^9.2.0, commander@^9.4.1: version "9.4.1" resolved "https://registry.yarnpkg.com/commander/-/commander-9.4.1.tgz#d1dd8f2ce6faf93147295c0df13c7c21141cfbdd" @@ -28239,18 +28244,16 @@ solc@0.7.3: semver "^5.5.0" tmp "0.0.33" -solc@^0.7.4: - version "0.7.6" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.6.tgz#21fc5dc11b85fcc518c181578b454f3271c27252" - integrity sha512-WsR/W7CXwh2VnmZapB4JrsDeLlshoKBz5Pz/zYNulB6LBsOEHI2Zj/GeKLMFcvv57OHiXHvxq5ZOQB+EdqxlxQ== +solc@0.8.26: + version "0.8.26" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.26.tgz#afc78078953f6ab3e727c338a2fefcd80dd5b01a" + integrity sha512-yiPQNVf5rBFHwN6SIf3TUUvVAFKcQqmSUFeq+fb6pNRCo0ZCgpYOZDi3BVoezCPIAcKrVYd/qXlBLUP9wVrZ9g== dependencies: command-exists "^1.2.8" - commander "3.0.2" + commander "^8.1.0" follow-redirects "^1.12.1" - fs-extra "^0.30.0" js-sha3 "0.8.0" memorystream "^0.3.1" - require-from-string "^2.0.0" semver "^5.5.0" tmp "0.0.33" From 94aa3e09c9025962c6e31974bb43f635f798556e Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 19 Aug 2024 19:58:01 +0530 Subject: [PATCH 02/11] fix pragma --- libs/remix-tests/tests/examples_1/simple_storage.sol | 2 +- libs/remix-tests/tests/examples_1/simple_storage_test.sol | 2 +- libs/remix-tests/tests/examples_2/simple_storage.sol | 2 +- libs/remix-tests/tests/examples_2/simple_storage_test.sol | 2 +- libs/remix-tests/tests/examples_3/simple_string.sol | 2 +- libs/remix-tests/tests/examples_3/simple_string_test.sol | 2 +- libs/remix-tests/tests/examples_5/contract/simple_storage.sol | 2 +- libs/remix-tests/tests/examples_5/lib/EvenOdd.sol | 2 +- libs/remix-tests/tests/examples_5/test/simple_storage_test.sol | 2 +- libs/remix-tests/tests/number/number_test.sol | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libs/remix-tests/tests/examples_1/simple_storage.sol b/libs/remix-tests/tests/examples_1/simple_storage.sol index c218711d60..0dd379b959 100644 --- a/libs/remix-tests/tests/examples_1/simple_storage.sol +++ b/libs/remix-tests/tests/examples_1/simple_storage.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.8.0; +pragma solidity >= 0.5.0 < 0.9.0; contract SimpleStorage { uint public storedData; diff --git a/libs/remix-tests/tests/examples_1/simple_storage_test.sol b/libs/remix-tests/tests/examples_1/simple_storage_test.sol index 958788563a..ef5b920a70 100644 --- a/libs/remix-tests/tests/examples_1/simple_storage_test.sol +++ b/libs/remix-tests/tests/examples_1/simple_storage_test.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.8.0; +pragma solidity >= 0.5.0 < 0.9.0; import "./simple_storage.sol"; contract MyTest { diff --git a/libs/remix-tests/tests/examples_2/simple_storage.sol b/libs/remix-tests/tests/examples_2/simple_storage.sol index 7ee2ffdc6d..d95b83d46d 100644 --- a/libs/remix-tests/tests/examples_2/simple_storage.sol +++ b/libs/remix-tests/tests/examples_2/simple_storage.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.8.0; +pragma solidity >= 0.5.0 < 0.9.0; contract SimpleStorage { uint public storedData; diff --git a/libs/remix-tests/tests/examples_2/simple_storage_test.sol b/libs/remix-tests/tests/examples_2/simple_storage_test.sol index a0c3a0d6ca..7a40984296 100644 --- a/libs/remix-tests/tests/examples_2/simple_storage_test.sol +++ b/libs/remix-tests/tests/examples_2/simple_storage_test.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.8.0; +pragma solidity >= 0.5.0 < 0.9.0; import "./simple_storage.sol"; contract MyTest { diff --git a/libs/remix-tests/tests/examples_3/simple_string.sol b/libs/remix-tests/tests/examples_3/simple_string.sol index 1bc847f984..c245495387 100644 --- a/libs/remix-tests/tests/examples_3/simple_string.sol +++ b/libs/remix-tests/tests/examples_3/simple_string.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.8.0; +pragma solidity >= 0.5.0 < 0.9.0; contract SimpleString { string public storedData; diff --git a/libs/remix-tests/tests/examples_3/simple_string_test.sol b/libs/remix-tests/tests/examples_3/simple_string_test.sol index 3157f53c35..d6e85fee01 100644 --- a/libs/remix-tests/tests/examples_3/simple_string_test.sol +++ b/libs/remix-tests/tests/examples_3/simple_string_test.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.8.0; +pragma solidity >= 0.5.0 < 0.9.0; import "./simple_string.sol"; contract StringTest { diff --git a/libs/remix-tests/tests/examples_5/contract/simple_storage.sol b/libs/remix-tests/tests/examples_5/contract/simple_storage.sol index 1cfbeb8f13..3438067d77 100644 --- a/libs/remix-tests/tests/examples_5/contract/simple_storage.sol +++ b/libs/remix-tests/tests/examples_5/contract/simple_storage.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.8.0; +pragma solidity >= 0.5.0 < 0.9.0; import "../../examples_4/SafeMath.sol"; import "../lib/EvenOdd.sol"; diff --git a/libs/remix-tests/tests/examples_5/lib/EvenOdd.sol b/libs/remix-tests/tests/examples_5/lib/EvenOdd.sol index a1536375a6..350c34b6e5 100644 --- a/libs/remix-tests/tests/examples_5/lib/EvenOdd.sol +++ b/libs/remix-tests/tests/examples_5/lib/EvenOdd.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.8.0; +pragma solidity >= 0.5.0 < 0.9.0; contract EvenOdd { diff --git a/libs/remix-tests/tests/examples_5/test/simple_storage_test.sol b/libs/remix-tests/tests/examples_5/test/simple_storage_test.sol index c5ef812a61..e6607734a9 100644 --- a/libs/remix-tests/tests/examples_5/test/simple_storage_test.sol +++ b/libs/remix-tests/tests/examples_5/test/simple_storage_test.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.8.0; +pragma solidity >= 0.5.0 < 0.9.0; import "./../contract/simple_storage.sol"; contract StorageResolveTest { diff --git a/libs/remix-tests/tests/number/number_test.sol b/libs/remix-tests/tests/number/number_test.sol index 3bbfbc14f0..936691dc40 100644 --- a/libs/remix-tests/tests/number/number_test.sol +++ b/libs/remix-tests/tests/number/number_test.sol @@ -1,4 +1,4 @@ -pragma solidity >= 0.5.0 < 0.8.0; +pragma solidity >= 0.5.0 < 0.9.0; contract IntegerTest { From f6563d8494ce612b28fade3aa078adf7ef32d214 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 19 Aug 2024 20:04:56 +0530 Subject: [PATCH 03/11] more pragma fix --- libs/remix-tests/tests/examples_4/SafeMath.sol | 2 +- libs/remix-tests/tests/examples_4/SafeMathProxy.sol | 2 +- libs/remix-tests/tests/examples_4/SafeMath_test.sol | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/remix-tests/tests/examples_4/SafeMath.sol b/libs/remix-tests/tests/examples_4/SafeMath.sol index a93aedaf44..fcbe6010f7 100644 --- a/libs/remix-tests/tests/examples_4/SafeMath.sol +++ b/libs/remix-tests/tests/examples_4/SafeMath.sol @@ -1,6 +1,6 @@ // Copyright (c) 2016 Smart Contract Solutions, Inc. -pragma solidity >=0.4.22 <0.8.0; +pragma solidity >=0.4.22 <0.9.0; /** diff --git a/libs/remix-tests/tests/examples_4/SafeMathProxy.sol b/libs/remix-tests/tests/examples_4/SafeMathProxy.sol index 805c6d9112..5b155390c7 100644 --- a/libs/remix-tests/tests/examples_4/SafeMathProxy.sol +++ b/libs/remix-tests/tests/examples_4/SafeMathProxy.sol @@ -1,4 +1,4 @@ -pragma solidity >=0.4.22 <0.8.0; +pragma solidity >=0.4.22 <0.9.0; import "./SafeMath.sol"; /* diff --git a/libs/remix-tests/tests/examples_4/SafeMath_test.sol b/libs/remix-tests/tests/examples_4/SafeMath_test.sol index be24d43312..87d19292a9 100644 --- a/libs/remix-tests/tests/examples_4/SafeMath_test.sol +++ b/libs/remix-tests/tests/examples_4/SafeMath_test.sol @@ -1,4 +1,4 @@ -pragma solidity >=0.4.22 <0.8.0; +pragma solidity >=0.4.22 <0.9.0; import "remix_tests.sol"; import "./SafeMath.sol"; import "./SafeMathProxy.sol"; From de7c9f1ab640ddec8378297820925579a00cf298 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 20 Aug 2024 19:12:45 +0530 Subject: [PATCH 04/11] fix remix-tests unit tests --- .../examples_0/assert_greaterThan_test.sol | 4 -- .../examples_0/assert_lesserThan_test.sol | 8 ---- .../tests/examples_4/SafeMath_test.sol | 46 +++++++++---------- libs/remix-tests/tests/testRunner.spec.ts | 21 ++++----- 4 files changed, 32 insertions(+), 47 deletions(-) diff --git a/libs/remix-tests/tests/examples_0/assert_greaterThan_test.sol b/libs/remix-tests/tests/examples_0/assert_greaterThan_test.sol index 0dab742ea0..529c78106c 100644 --- a/libs/remix-tests/tests/examples_0/assert_greaterThan_test.sol +++ b/libs/remix-tests/tests/examples_0/assert_greaterThan_test.sol @@ -29,8 +29,4 @@ contract AssertGreaterThanTest { function greaterThanIntUintPassTest() public { Assert.greaterThan(int(10), uint(2), "greaterThanIntUintPassTest passes"); } - - function greaterThanIntUintFailTest() public { - Assert.greaterThan(int(100), uint(-100), "greaterThanIntUintFailTest fails"); - } } \ No newline at end of file diff --git a/libs/remix-tests/tests/examples_0/assert_lesserThan_test.sol b/libs/remix-tests/tests/examples_0/assert_lesserThan_test.sol index f6468ec952..9c36a6fe04 100644 --- a/libs/remix-tests/tests/examples_0/assert_lesserThan_test.sol +++ b/libs/remix-tests/tests/examples_0/assert_lesserThan_test.sol @@ -22,14 +22,6 @@ contract AssertLesserThanTest { Assert.lesserThan(uint(1), int(2), "lesserThanUintIntPassTest passes"); } - function lesserThanUintIntFailTest() public { - Assert.lesserThan(uint(-1), int(-1), "lesserThanUintIntFailTest fails"); - } - - function lesserThanIntUintPassTest() public { - Assert.lesserThan(int(100), uint(-50), "lesserThanIntUintPassTest passes"); - } - function lesserThanIntUintFailTest() public { Assert.lesserThan(int(1), uint(1), "lesserThanIntUintFailTest fails"); } diff --git a/libs/remix-tests/tests/examples_4/SafeMath_test.sol b/libs/remix-tests/tests/examples_4/SafeMath_test.sol index 87d19292a9..6582baa10c 100644 --- a/libs/remix-tests/tests/examples_4/SafeMath_test.sol +++ b/libs/remix-tests/tests/examples_4/SafeMath_test.sol @@ -10,15 +10,15 @@ contract SafeMathTest { safemathproxy = new SafeMathProxy(); } - function unsafeMultiplicationShouldOverflow() public returns (bool) { - uint256 a = 4; - uint256 b = 2 ** 256 - 1; - return Assert.equal( - a * b, - 2 ** 256 - 4, - "unsafe multiplication did not overflow" - ); - } + // function unsafeMultiplicationShouldOverflow() public returns (bool) { + // uint256 a = 4; + // uint256 b = 2 ** 256 - 1; + // return Assert.equal( + // a * b, + // 2 ** 256 - 4, + // "unsafe multiplication did not overflow" + // ); + // } function safeMultiplicationShouldRevert() public returns (bool) { uint256 a = 4; @@ -42,15 +42,15 @@ contract SafeMathTest { ); } - function unsafeSubtractShouldUnderflow() public returns (bool) { - uint256 a = 0; - uint256 b = a - 1; - return Assert.equal( - b, - 2 ** 256 - 1, - "unsafe subtraction did not underflow" - ); - } + // function unsafeSubtractShouldUnderflow() public returns (bool) { + // uint256 a = 0; + // uint256 b = a - 1; + // return Assert.equal( + // b, + // 2 ** 256 - 1, + // "unsafe subtraction did not underflow" + // ); + // } function safeSubtractShouldRevert() public returns (bool) { (bool success, bytes memory data) = address(safemathproxy).call{gas:40000, value:0}(abi.encode("subProxy, [0, 1]")); @@ -77,11 +77,11 @@ contract SafeMathTest { } } - function unsafeAdditionShouldOverflow() public returns (bool) { - uint256 a = 1; - uint256 b = 2 ** 256 - 1; - return Assert.equal(a + b, 0, "unsafe addition did not overflow"); - } + // function unsafeAdditionShouldOverflow() public returns (bool) { + // uint256 a = 1; + // uint256 b = 2 ** 256 - 1; + // return Assert.equal(a + b, 0, "unsafe addition did not overflow"); + // } function safeAdditionShouldRevert() public returns (bool) { uint256 a = 1; diff --git a/libs/remix-tests/tests/testRunner.spec.ts b/libs/remix-tests/tests/testRunner.spec.ts index 0d2dcf260d..3da24b5acd 100644 --- a/libs/remix-tests/tests/testRunner.spec.ts +++ b/libs/remix-tests/tests/testRunner.spec.ts @@ -230,8 +230,8 @@ describe('testRunner', function () { assert.equal(results.passingNum, 4) }) - it('should have 4 failing test', () => { - assert.equal(results.failureNum, 4) + it('should have 3 failing test', () => { + assert.equal(results.failureNum, 3) }) it('should return', () => { deepEqualExcluding(tests, [ @@ -244,7 +244,6 @@ describe('testRunner', function () { { type: 'testPass', debugTxHash: '0xf52652ef6020ae091022455df8713d20cb00a35de8bf485e177128a457a50d6c', value: 'Greater than uint int pass test', filename: __dirname + '/examples_0/assert_greaterThan_test.sol', context: 'AssertGreaterThanTest' }, { type: 'testFailure', debugTxHash: '0x9f826060a0e5a8c0187d5e9ffe83a153080379a1e1fea0b267745eb8bd52fd6f', value: 'Greater than uint int fail test', filename: __dirname + '/examples_0/assert_greaterThan_test.sol', errMsg: 'greaterThanUintIntFailTest fails', context: 'AssertGreaterThanTest', assertMethod: 'greaterThan', location: '845:71:0', expected: '2', returned: '1' }, { type: 'testPass', debugTxHash: '0x04e1703c75cc4beb4b8c9ddfb79489192423fe745089382cadb1811cbf2d915c', value: 'Greater than int uint pass test', filename: __dirname + '/examples_0/assert_greaterThan_test.sol', context: 'AssertGreaterThanTest' }, - { type: 'testFailure', debugTxHash: '0xbb5c94a5fc46417a4d3c763994da78d4f27c83dbc5545cb0522a39c3c6017432', value: 'Greater than int uint fail test', filename: __dirname + '/examples_0/assert_greaterThan_test.sol', errMsg: 'greaterThanIntUintFailTest fails', context: 'AssertGreaterThanTest', assertMethod: 'greaterThan', location: '1125:76:0', expected: '115792089237316195423570985008687907853269984665640564039457584007913129639836', returned: '100' } ], ['time', 'web3']) }) }) @@ -260,12 +259,12 @@ describe('testRunner', function () { after(() => { tests = [] }) - it('should have 4 passing test', () => { - assert.equal(results.passingNum, 4) + it('should have 3 passing test', () => { + assert.equal(results.passingNum, 3) }) - it('should have 4 failing test', () => { - assert.equal(results.failureNum, 4) + it('should have 3 failing test', () => { + assert.equal(results.failureNum, 3) }) it('should return', () => { @@ -277,9 +276,7 @@ describe('testRunner', function () { { type: 'testPass', debugTxHash: '0x353c9bcf4b61abaf4b6ffaae02f18ea0a7fb38a8c3c7a915939561cdf97f2d72', value: 'Lesser than int pass test', filename: __dirname + '/examples_0/assert_lesserThan_test.sol', context: 'AssertLesserThanTest' }, { type: 'testFailure', debugTxHash: '0xccab30c5a154c4c2e8ca9a8966b86a55f08188d606c3519a5c29534b4b64fb47', value: 'Lesser than int fail test', filename: __dirname + '/examples_0/assert_lesserThan_test.sol', errMsg: 'lesserThanIntFailTest fails', context: 'AssertLesserThanTest', assertMethod: 'lesserThan', location: '557:65:0', expected: '-1', returned: '1' }, { type: 'testPass', debugTxHash: '0x8e90fb7f3b8343d037444275cd69d431f75a7fc6b46322c69397373463cee22a', value: 'Lesser than uint int pass test', filename: __dirname + '/examples_0/assert_lesserThan_test.sol', context: 'AssertLesserThanTest' }, - { type: 'testFailure', debugTxHash: '0x5db60fe115958b767f0defe81eeb6322ee18ec8df690abad0d1581175882136b', value: 'Lesser than uint int fail test', filename: __dirname + '/examples_0/assert_lesserThan_test.sol', errMsg: 'lesserThanUintIntFailTest fails', context: 'AssertLesserThanTest', assertMethod: 'lesserThan', location: '826:71:0', expected: '-1', returned: '115792089237316195423570985008687907853269984665640564039457584007913129639935' }, - { type: 'testPass', debugTxHash: '0x19f79e8c8ec360cd27beee6399e6853a4fe335af78364ed35c93f8fe39e3100c', value: 'Lesser than int uint pass test', filename: __dirname + '/examples_0/assert_lesserThan_test.sol', context: 'AssertLesserThanTest' }, - { type: 'testFailure', debugTxHash: '0x520ecba457bf71f42d24f61432d872121da699af0374090e2e9098a6719cb0ce', value: 'Lesser than int uint fail test', filename: __dirname + '/examples_0/assert_lesserThan_test.sol', errMsg: 'lesserThanIntUintFailTest fails', context: 'AssertLesserThanTest', assertMethod: 'lesserThan', location: '1105:69:0', expected: '1', returned: '1' }, + { type: 'testFailure', debugTxHash: '0x7912b2535fe0f5a56b274a7ec5ef6dbb0f52a7199f11831867a98961568f2883', value: 'Lesser than int uint fail test', filename: __dirname + '/examples_0/assert_lesserThan_test.sol', errMsg: 'lesserThanIntUintFailTest fails', context: 'AssertLesserThanTest', assertMethod: 'lesserThan', location: '826:69:0', expected: '1', returned: '1' }, ], ['time', 'web3']) }) }) @@ -409,8 +406,8 @@ describe('testRunner', function () { after(() => { tests = [] }) - it('should have 10 passing tests', () => { - assert.equal(results.passingNum, 10) + it('should have 7 passing tests', () => { + assert.equal(results.passingNum, 7) }) it('should have 0 failing tests', () => { assert.equal(results.failureNum, 0) From 80bb0be90ec1a0e898d823ba07463a1e60352968 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 20 Aug 2024 19:52:26 +0530 Subject: [PATCH 05/11] fix remix debug tests --- libs/remix-debug/test/decoder/contracts/miscContracts.ts | 2 +- libs/remix-debug/test/sourceLocationTracker.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/remix-debug/test/decoder/contracts/miscContracts.ts b/libs/remix-debug/test/decoder/contracts/miscContracts.ts index 7e8f9214be..ea3df817c6 100644 --- a/libs/remix-debug/test/decoder/contracts/miscContracts.ts +++ b/libs/remix-debug/test/decoder/contracts/miscContracts.ts @@ -27,7 +27,7 @@ module.exports = ` } contract contractEnum { - enum enumDef {item0,item1,item2,item3,item4,item5,item6,item7,item8,item9,item10,item11,item12,item13,item14,item15,item16,item17,item18,item19,item20,item21,item22,item23,item24,item25,item26,item27,item28,item29,item30,item31,item32,item33,item34,item35,item36,item37,item38,item39,item40,item41,item42,item43,item44,item45,item46,item47,item48,item49,item50,item51,item52,item53,item54,item55,item56,item57,item58,item59,item60,item61,item62,item63,item64,item65,item66,item67,item68,item69,item70,item71,item72,item73,item74,item75,item76,item77,item78,item79,item80,item81,item82,item83,item84,item85,item86,item87,item88,item89,item90,item91,item92,item93,item94,item95,item96,item97,item98,item99,item100,item101,item102,item103,item104,item105,item106,item107,item108,item109,item110,item111,item112,item113,item114,item115,item116,item117,item118,item119,item120,item121,item122,item123,item124,item125,item126,item127,item128,item129,item130,item131,item132,item133,item134,item135,item136,item137,item138,item139,item140,item141,item142,item143,item144,item145,item146,item147,item148,item149,item150,item151,item152,item153,item154,item155,item156,item157,item158,item159,item160,item161,item162,item163,item164,item165,item166,item167,item168,item169,item170,item171,item172,item173,item174,item175,item176,item177,item178,item179,item180,item181,item182,item183,item184,item185,item186,item187,item188,item189,item190,item191,item192,item193,item194,item195,item196,item197,item198,item199,item200,item201,item202,item203,item204,item205,item206,item207,item208,item209,item210,item211,item212,item213,item214,item215,item216,item217,item218,item219,item220,item221,item222,item223,item224,item225,item226,item227,item228,item229,item230,item231,item232,item233,item234,item235,item236,item237,item238,item239,item240,item241,item242,item243,item244,item245,item246,item247,item248,item249,item250,item251,item252,item253,item254,item255,item256,item257,item258,item259,item260,item261,item262,item263,item264,item265,item266,item267,item268,item269,item270,item271,item272,item273,item274,item275,item276,item277,item278,item279,item280,item281,item282,item283,item284,item285,item286,item287,item288,item289,item290,item291,item292,item293,item294,item295,item296,item297,item298,item299,item100000000} + enum enumDef {item0,item1,item2,item3,item4,item5,item6,item7,item8,item9,item10,item11,item12,item13,item14,item15,item16,item17,item18,item19,item20,item21,item22,item23,item24,item25,item26,item27,item28,item29,item30,item31,item32,item33,item34,item35,item36,item37,item38,item39,item40,item41,item42,item43,item44,item45,item46,item47,item48,item49,item50,item51,item52,item53,item54,item55,item56,item57,item58,item59,item60,item61,item62,item63,item64,item65,item66,item67,item68,item69,item70,item71,item72,item73,item74,item75,item76,item77,item78,item79,item80,item81,item82,item83,item84,item85,item86,item87,item88,item89,item90,item91,item92,item93,item94,item95,item96,item97,item98,item99,item100,item101,item102,item103,item104,item105,item106,item107,item108,item109,item110,item111,item112,item113,item114,item115,item116,item117,item118,item119,item120,item121,item122,item123,item124,item125,item126,item127,item128,item129,item130,item131,item132,item133,item134,item135,item136,item137,item138,item139,item140,item141,item142,item143,item144,item145,item146,item147,item148,item149,item150,item151,item152,item153,item154,item155,item156,item157,item158,item159,item160,item161,item162,item163,item164,item165,item166,item167,item168,item169,item170,item171,item172,item173,item174,item175,item176,item177,item178,item179,item180,item181,item182,item183,item184,item185,item186,item187,item188,item189,item190,item191,item192,item193,item194,item195,item196,item197,item198,item199,item200,item201,item202,item203,item204,item205,item206,item207,item208,item209,item210,item211,item212,item213,item214,item215,item216,item217,item218,item219,item220,item221,item222,item223,item224,item225,item226,item227,item228,item229,item230,item231,item232,item233,item234,item235,item236,item237,item238,item239,item240,item241,item242,item243,item244,item245,item246,item247,item248,item249,item250,item251,item252,item253,item254,item255} enumDef enum1; } diff --git a/libs/remix-debug/test/sourceLocationTracker.ts b/libs/remix-debug/test/sourceLocationTracker.ts index 88a5b7977b..991fd00193 100644 --- a/libs/remix-debug/test/sourceLocationTracker.ts +++ b/libs/remix-debug/test/sourceLocationTracker.ts @@ -66,12 +66,12 @@ tape('SourceLocationTracker', function (t) { map = await sourceLocationTracker.getSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 45, output.contracts) st.equal(map['file'], 1) // 1 refers to the generated source (pragma experimental ABIEncoderV2) - map = await sourceLocationTracker.getValidSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 45, output.contracts) + map = await sourceLocationTracker.getValidSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 30, output.contracts) st.equal(map['file'], 0) // 1 refers to the generated source (pragma experimental ABIEncoderV2) st.equal(map['start'], 303) st.equal(map['length'], 448) - map = await sourceLocationTracker.getValidSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 36, output.contracts) + map = await sourceLocationTracker.getValidSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 26, output.contracts) st.equal(map['file'], 0) // 0 refers to the initial solidity code. see source below (ABIEncoderV2) st.equal(map['start'], 303) st.equal(map['length'], 448) @@ -93,8 +93,8 @@ tape('SourceLocationTracker', function (t) { map = await sourceLocationTracker.getValidSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 45, output.contracts) st.equal(map['file'], 1) // 1 refers to the generated source (pragma experimental ABIEncoderV2) - st.equal(map['start'], 1297) - st.equal(map['length'], 32) + st.equal(map['start'], 2085) + st.equal(map['length'], 139) map = await sourceLocationTracker.getValidSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 36, output.contracts) st.equal(map['file'], 0) // 0 refers to the initial solidity code. see source below (ABIEncoderV2) From c0cbd25a94deae6ad99ba6c1ace80ef1eb70ea6f Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 20 Aug 2024 21:00:27 +0530 Subject: [PATCH 06/11] fix byte and enum --- libs/remix-debug/test/decoder/contracts/byteStorage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-debug/test/decoder/contracts/byteStorage.ts b/libs/remix-debug/test/decoder/contracts/byteStorage.ts index 89720f2a21..84cb836b0e 100644 --- a/libs/remix-debug/test/decoder/contracts/byteStorage.ts +++ b/libs/remix-debug/test/decoder/contracts/byteStorage.ts @@ -3,13 +3,13 @@ module.exports = { contract: ` contract byteStorage { - enum enum1 { e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32, e33, e34, e35, e36, e37, e38, e39, e40, e41, e42, e43, e44, e45, e46, e47, e48, e49, e50, e51, e52, e53, e54, e55, e56, e57, e58, e59, e60, e61, e62, e63, e64, e65, e66, e67, e68, e69, e70, e71, e72, e73, e74, e75, e76, e77, e78, e79, e80, e81, e82, e83, e84, e85, e86, e87, e88, e89, e90, e91, e92, e93, e94, e95, e96, e97, e98, e99, e100, e101, e102, e103, e104, e105, e106, e107, e108, e109, e110, e111, e112, e113, e114, e115, e116, e117, e118, e119, e120, e121, e122, e123, e124, e125, e126, e127, e128, e129, e130, e131, e132, e133, e134, e135, e136, e137, e138, e139, e140, e141, e142, e143, e144, e145, e146, e147, e148, e149, e150, e151, e152, e153, e154, e155, e156, e157, e158, e159, e160, e161, e162, e163, e164, e165, e166, e167, e168, e169, e170, e171, e172, e173, e174, e175, e176, e177, e178, e179, e180, e181, e182, e183, e184, e185, e186, e187, e188, e189, e190, e191, e192, e193, e194, e195, e196, e197, e198, e199, e200, e201, e202, e203, e204, e205, e206, e207, e208, e209, e210, e211, e212, e213, e214, e215, e216, e217, e218, e219, e220, e221, e222, e223, e224, e225, e226, e227, e228, e229, e230, e231, e232, e233, e234, e235, e236, e237, e238, e239, e240, e241, e242, e243, e244, e245, e246, e247, e248, e249, e250, e251, e252, e253, e254, e255, e256, e257, e258, e259, e260 } + enum enum1 { e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32, e33, e34, e35, e36, e37, e38, e39, e40, e41, e42, e43, e44, e45, e46, e47, e48, e49, e50, e51, e52, e53, e54, e55, e56, e57, e58, e59, e60, e61, e62, e63, e64, e65, e66, e67, e68, e69, e70, e71, e72, e73, e74, e75, e76, e77, e78, e79, e80, e81, e82, e83, e84, e85, e86, e87, e88, e89, e90, e91, e92, e93, e94, e95, e96, e97, e98, e99, e100, e101, e102, e103, e104, e105, e106, e107, e108, e109, e110, e111, e112, e113, e114, e115, e116, e117, e118, e119, e120, e121, e122, e123, e124, e125, e126, e127, e128, e129, e130, e131, e132, e133, e134, e135, e136, e137, e138, e139, e140, e141, e142, e143, e144, e145, e146, e147, e148, e149, e150, e151, e152, e153, e154, e155, e156, e157, e158, e159, e160, e161, e162, e163, e164, e165, e166, e167, e168, e169, e170, e171, e172, e173, e174, e175, e176, e177, e178, e179, e180, e181, e182, e183, e184, e185, e186, e187, e188, e189, e190, e191, e192, e193, e194, e195, e196, e197, e198, e199, e200, e201, e202, e203, e204, e205, e206, e207, e208, e209, e210, e211, e212, e213, e214, e215, e216, e217, e218, e219, e220, e221, e222, e223, e224, e225, e226, e227, e228, e229, e230, e231, e232, e233, e234, e235, e236, e237, e238, e239, e240, e241, e242, e243, e244, e245, e246, e247, e248, e249, e250, e251, e252, e253, e254, e255 } bool b1 = false; address a1 = 0xfE350f199F244ac9A79038d254400b632a633225; bool b2 = true; bytes dynb1 = "dynamicbytes"; - byte stab = 0x01; + bytes1 stab = 0x01; bytes1 stab1 = hex"12"; bytes2 stab2 = hex"1579"; bytes3 stab3 = hex"359356"; From e01d3023e55a9c9a1b13c5f96a42cd5971050b8e Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 20 Aug 2024 21:22:49 +0530 Subject: [PATCH 07/11] mapping fix --- libs/remix-debug/test/decoder/stateTests/mapping.ts | 7 ++++--- libs/remix-debug/test/vmCall.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/remix-debug/test/decoder/stateTests/mapping.ts b/libs/remix-debug/test/decoder/stateTests/mapping.ts index 3ca31823a5..5a2af96690 100644 --- a/libs/remix-debug/test/decoder/stateTests/mapping.ts +++ b/libs/remix-debug/test/decoder/stateTests/mapping.ts @@ -29,11 +29,12 @@ module.exports = async function testMappingStorage (st, cb) { st.end(error) } else { web3.eth.getTransactionReceipt(hash) - .then(tx => + .then(tx => { // const storage = await this.vm.stateManager.dumpStorage(data.to) - // (vmCall as any).web3().eth.getCode(tx.contractAddress).then((code) => console.log('code:', code)) + // web3.eth.getCode(tx.contractAddress).then((code) => console.log('code:---', code)) // (vmCall as any).web3().debug.traceTransaction(hash).then((code) => console.log('trace:', code)) testMapping(st, privateKey, tx.contractAddress, output, compilationResults, web3, cb) + } // st.end() ) .catch(error => { @@ -71,7 +72,7 @@ function testMapping (st, privateKey, contractAddress, output, compilationResult }) callTree.event.register('callTreeReady', (scopes, scopeStarts) => { const storageViewer = new StorageViewer({ - stepIndex: 268, + stepIndex: 472, tx: tx, address: contractAddress }, new StorageResolver({ web3 }), traceManager) diff --git a/libs/remix-debug/test/vmCall.ts b/libs/remix-debug/test/vmCall.ts index 0866b065e6..12187e20b0 100644 --- a/libs/remix-debug/test/vmCall.ts +++ b/libs/remix-debug/test/vmCall.ts @@ -5,7 +5,7 @@ import { Web3 } from 'web3'; const { Provider } = require('@remix-project/remix-simulator') async function getWeb3 () { - const remixSimulatorProvider = new Provider({ fork: 'berlin' }) + const remixSimulatorProvider = new Provider({ fork: 'cancun' }) await remixSimulatorProvider.init() await remixSimulatorProvider.Accounts.resetAccounts() const web3 = new Web3(remixSimulatorProvider) From a7c1e5bcf5f62c97a8762588954cbcd1cd0eaaf5 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 20 Aug 2024 21:47:22 +0530 Subject: [PATCH 08/11] more test fixes --- libs/remix-debug/test/debugger.ts | 7 ++++--- libs/remix-debug/test/decoder/contracts/miscLocal.ts | 2 +- libs/remix-debug/test/decoder/localsTests/structArray.ts | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/libs/remix-debug/test/debugger.ts b/libs/remix-debug/test/debugger.ts index 7c51ce7fc4..6123d6332d 100644 --- a/libs/remix-debug/test/debugger.ts +++ b/libs/remix-debug/test/debugger.ts @@ -214,11 +214,12 @@ function testDebugging (debugManager) { try { const callstack = debugManager.traceManager.getStackAt(41) t.equal(JSON.stringify(callstack), JSON.stringify([ - '0x0000000000000000000000000000000000000000000000000000000000000080', - '0x0000000000000000000000000000000000000000000000000000000000000020', + '0x0000000000000000000000000000000000000000000000000000000000000318', + '0x0000000000000000000000000000000000000000000000000000000000000001', + '0x0000000000000000000000000000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000000000000000000000000080', '0x00000000000000000000000000000000000000000000000000000000000000e0', - '0x00000000000000000000000000000000000000000000000000000000000000e0'])) + '0x0000000000000000000000000000000000000000000000000000000000000031'])) } catch (error) { return t.end(error) } diff --git a/libs/remix-debug/test/decoder/contracts/miscLocal.ts b/libs/remix-debug/test/decoder/contracts/miscLocal.ts index 56d3a63649..421ddd86b4 100644 --- a/libs/remix-debug/test/decoder/contracts/miscLocal.ts +++ b/libs/remix-debug/test/decoder/contracts/miscLocal.ts @@ -15,7 +15,7 @@ contract miscLocal { enumDef testEnum; testEnum = enumDef.three; address sender = msg.sender; - byte _bytes1 = hex"99"; + bytes1 _bytes1 = hex"99"; bytes1 __bytes1 = hex"99"; bytes2 __bytes2 = hex"99AB"; bytes4 __bytes4 = hex"99FA"; diff --git a/libs/remix-debug/test/decoder/localsTests/structArray.ts b/libs/remix-debug/test/decoder/localsTests/structArray.ts index 4410711624..9a13cd5ffd 100644 --- a/libs/remix-debug/test/decoder/localsTests/structArray.ts +++ b/libs/remix-debug/test/decoder/localsTests/structArray.ts @@ -42,9 +42,9 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult,c st.fail(error) }) callTree.event.register('callTreeReady', (scopes, scopeStarts) => { - helper.decodeLocals(st, 1622, traceManager, callTree, function (locals) { + helper.decodeLocals(st, 1600, traceManager, callTree, function (locals) { try { - console.log('at 1622', locals) + console.log('at 1600', locals) st.equals(locals['bytesSimple'].length, '0x14') st.equals(locals['bytesSimple'].value, '0x746573745f7375706572') st.equals(locals['e'].value['a'].value, 'test') @@ -103,7 +103,7 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult,c st.equals(locals['arrayStruct'].value.b.value[0].value, '34') st.equals(locals['arrayStruct'].value.b.value[1].value, '-23') st.equals(locals['arrayStruct'].value.b.value[2].value, '-3') - st.equals(locals['arrayStruct'].value.c.value, 'three') + st.equals(locals['arrayStruct'].value.c.value, 'one') st.equals(Object.keys(locals).length, 8) } catch (e) { From 1c937323339c76ac99cd8bdbd379ebceb813af16 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 21 Aug 2024 12:46:14 +0530 Subject: [PATCH 09/11] more ut fix --- libs/remix-debug/test/debugger.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/remix-debug/test/debugger.ts b/libs/remix-debug/test/debugger.ts index 6123d6332d..e1389cdc49 100644 --- a/libs/remix-debug/test/debugger.ts +++ b/libs/remix-debug/test/debugger.ts @@ -232,7 +232,7 @@ function testDebugging (debugManager) { try { const address = debugManager.traceManager.getCurrentCalledAddressAt(38) console.log(address) - const storageView = debugManager.storageViewAt(196, address) + const storageView = debugManager.storageViewAt(356, address) storageView.storageRange().then((storage) => { t.equal(JSON.stringify(storage), JSON.stringify({ '0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563': { key: '0x0000000000000000000000000000000000000000000000000000000000000000', value: '0x0000000000000000000000005b38da6a701c568545dcfcb03fcb875f56beddc4' } })) @@ -247,8 +247,8 @@ function testDebugging (debugManager) { tape('traceManager.decodeStateAt', async (t) => { t.plan(7) try { - const state = await debugManager.extractStateAt(312) - const decodedState = await debugManager.decodeStateAt(312, state) + const state = await debugManager.extractStateAt(442) + const decodedState = await debugManager.decodeStateAt(442, state) console.log(decodedState) t.equal(decodedState['chairperson'].value, '0x5B38DA6A701C568545DCFCB03FCB875F56BEDDC4') t.equal(decodedState['chairperson'].type, 'address') @@ -266,9 +266,9 @@ function testDebugging (debugManager) { t.plan(1) const tested = JSON.parse('{"proposalNames":{"value":[{"value":"0x48656C6C6F20576F726C64210000000000000000000000000000000000000000","type":"bytes32"}],"length":"0x1","type":"bytes32[]","cursor":1,"hasNext":false},"p":{"value":"45","type":"uint256"},"addressLocal":{"value":"0x5B38DA6A701C568545DCFCB03FCB875F56BEDDC4","type":"address"},"i":{"value":"2","type":"uint256"},"proposalsLocals":{"value":[{"value":{"name":{"value":"0x48656C6C6F20576F726C64210000000000000000000000000000000000000000","type":"bytes32"},"voteCount":{"value":"0","type":"uint256"}},"type":"struct Ballot.Proposal"}],"length":"0x1","type":"struct Ballot.Proposal[]"}}') try { - const address = debugManager.traceManager.getCurrentCalledAddressAt(327) - const location = await debugManager.sourceLocationFromVMTraceIndex(address, 327) - debugManager.decodeLocalsAt(327, location, (error, decodedlocals) => { + const address = debugManager.traceManager.getCurrentCalledAddressAt(487) + const location = await debugManager.sourceLocationFromVMTraceIndex(address, 487) + debugManager.decodeLocalsAt(487, location, (error, decodedlocals) => { if (error) return t.end(error) const res = deepequal(decodedlocals, tested) t.ok(res, `test if locals does match. expected: ${JSON.stringify(tested)} - current: ${JSON.stringify(decodedlocals)}`) @@ -286,8 +286,8 @@ function testDebugging (debugManager) { breakPointManager.add({ fileName: 'test.sol', row: 39 }) breakPointManager.event.register('breakpointHit', function (sourceLocation, step) { - t.equal(JSON.stringify(sourceLocation), JSON.stringify({ start: 1146, length: 6, file: 0, jump: '-' })) - t.equal(step, 212) + t.equal(JSON.stringify(sourceLocation), JSON.stringify({ start: 1146, length: 6, jump: '-', file: 0 })) + t.equal(step, 372) }) breakPointManager.event.register('noBreakpointHit', function () { From be39266bbd007dfe081c7c2e261d4d34b82bd025 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 21 Aug 2024 12:56:34 +0530 Subject: [PATCH 10/11] fix remix-debug unit tests --- libs/remix-debug/test/decoder/decodeInfo.ts | 2 +- libs/remix-debug/test/decoder/localsTests/int.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/remix-debug/test/decoder/decodeInfo.ts b/libs/remix-debug/test/decoder/decodeInfo.ts index cd2b8cf94d..344fb64202 100644 --- a/libs/remix-debug/test/decoder/decodeInfo.ts +++ b/libs/remix-debug/test/decoder/decodeInfo.ts @@ -47,7 +47,7 @@ tape('solidity', function (t) { state = astHelper.extractStateDefinitions('test.sol:contractEnum', output.sources, null) stateDef = state.stateDefinitions parsedType = decodeInfo.parseType(stateDef[1].typeDescriptions.typeString, states, 'contractEnum', null) - checkDecodeInfo(st, parsedType, 1, 2, 'enum') + checkDecodeInfo(st, parsedType, 1, 1, 'enum') state = astHelper.extractStateDefinitions('test.sol:contractSmallVariable', output.sources, null) stateDef = state.stateDefinitions diff --git a/libs/remix-debug/test/decoder/localsTests/int.ts b/libs/remix-debug/test/decoder/localsTests/int.ts index 06b7a78e5d..ca1a3e1d88 100644 --- a/libs/remix-debug/test/decoder/localsTests/int.ts +++ b/libs/remix-debug/test/decoder/localsTests/int.ts @@ -49,7 +49,7 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult, try { // test gas cost per line - st.equals((await callTree.getGasCostPerLine(0, 16)).gasCost, 11) + st.equals((await callTree.getGasCostPerLine(0, 16)).gasCost, 10) st.equals((await callTree.getGasCostPerLine(0, 32)).gasCost, 84) const functions1 = callTree.retrieveFunctionsStack(103) @@ -60,12 +60,12 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult, st.equals(functions2.length, 3) st.equals(functions3.length, 1) - st.equal(functions1[0].gasCost, 54) - st.equal(functions1[1].gasCost, 436) + st.equal(functions1[0].gasCost, 53) + st.equal(functions1[1].gasCost, 423) - st.equal(functions2[0].gasCost, 23) - st.equal(functions2[1].gasCost, 54) - st.equal(functions2[2].gasCost, 436) + st.equal(functions2[0].gasCost, 22) + st.equal(functions2[1].gasCost, 53) + st.equal(functions2[2].gasCost, 423) st.equals(Object.keys(functions1[0])[0], 'functionDefinition') st.equals(Object.keys(functions1[0])[1], 'inputs') From 88ce2824a4b68adb48fd4f3d2845a4bce1030c50 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 21 Aug 2024 14:55:35 +0530 Subject: [PATCH 11/11] fix test --- libs/remix-debug/test/decoder/localsTests/structArray.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-debug/test/decoder/localsTests/structArray.ts b/libs/remix-debug/test/decoder/localsTests/structArray.ts index 9a13cd5ffd..e10061fc70 100644 --- a/libs/remix-debug/test/decoder/localsTests/structArray.ts +++ b/libs/remix-debug/test/decoder/localsTests/structArray.ts @@ -42,7 +42,7 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult,c st.fail(error) }) callTree.event.register('callTreeReady', (scopes, scopeStarts) => { - helper.decodeLocals(st, 1600, traceManager, callTree, function (locals) { + helper.decodeLocals(st, 1615, traceManager, callTree, function (locals) { try { console.log('at 1600', locals) st.equals(locals['bytesSimple'].length, '0x14') @@ -103,7 +103,7 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult,c st.equals(locals['arrayStruct'].value.b.value[0].value, '34') st.equals(locals['arrayStruct'].value.b.value[1].value, '-23') st.equals(locals['arrayStruct'].value.b.value[2].value, '-3') - st.equals(locals['arrayStruct'].value.c.value, 'one') + st.equals(locals['arrayStruct'].value.c.value, 'three') st.equals(Object.keys(locals).length, 8) } catch (e) {