diff --git a/CHANGELOG.md b/CHANGELOG.md index 48a680d9d..d54a00803 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ - [x] `IexecPoco2Delegate.sol` ### Features -- Purge Truffle leftovers (#180) +- Purge Truffle leftovers (#180, #181) - Sunset Jenkins pipeline (#178) - Re-use variable in `IexecPoco2Delegate` in `contribute(...)` function. (#168) - Remove unnecessary back and forth transfers in `IexecPoco2Delegate` happening during `claim(..)`. (#167) diff --git a/hardhat.config.ts b/hardhat.config.ts index 3e928c641..6d07dfe4b 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,5 +1,4 @@ import '@nomicfoundation/hardhat-toolbox'; -import '@nomiclabs/hardhat-truffle5'; import * as fs from 'fs'; import 'hardhat-dependency-compiler'; import 'hardhat-deploy'; diff --git a/package-lock.json b/package-lock.json index a9a34c2e5..06e84835c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,6 @@ "@ensdomains/ens-contracts": "^0.0.3", "@nomicfoundation/hardhat-network-helpers": "^1.0.11", "@nomicfoundation/hardhat-toolbox": "^2.0.2", - "@nomiclabs/hardhat-truffle5": "^2.0.7", "@nomiclabs/hardhat-web3": "^2.0.0", "@openzeppelin/test-helpers": "^0.5.16", "@openzeppelin/upgrades-core": "^1.37.1", @@ -1586,47 +1585,6 @@ "semver": "bin/semver.js" } }, - "node_modules/@nomiclabs/hardhat-truffle5": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-truffle5/-/hardhat-truffle5-2.0.7.tgz", - "integrity": "sha512-Pw8451IUZp1bTp0QqCHCYfCHs66sCnyxPcaorapu9mfOV9xnZsVaFdtutnhNEiXdiZwbed7LFKpRsde4BjFwig==", - "dev": true, - "dependencies": { - "@nomiclabs/truffle-contract": "^4.2.23", - "@types/chai": "^4.2.0", - "chai": "^4.2.0", - "ethereumjs-util": "^7.1.4", - "fs-extra": "^7.0.1" - }, - "peerDependencies": { - "@nomiclabs/hardhat-web3": "^2.0.0", - "hardhat": "^2.6.4", - "web3": "^1.0.0-beta.36" - } - }, - "node_modules/@nomiclabs/hardhat-truffle5/node_modules/fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/@nomiclabs/hardhat-truffle5/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, "node_modules/@nomiclabs/hardhat-web3": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-web3/-/hardhat-web3-2.0.0.tgz", @@ -1640,70 +1598,6 @@ "web3": "^1.0.0-beta.36" } }, - "node_modules/@nomiclabs/truffle-contract": { - "version": "4.5.10", - "resolved": "https://registry.npmjs.org/@nomiclabs/truffle-contract/-/truffle-contract-4.5.10.tgz", - "integrity": "sha512-nF/6InFV+0hUvutyFgsdOMCoYlr//2fJbRER4itxYtQtc4/O1biTwZIKRu+5l2J5Sq6LU2WX7vZHtDgQdhWxIQ==", - "dev": true, - "dependencies": { - "@ensdomains/ensjs": "^2.0.1", - "@truffle/blockchain-utils": "^0.1.3", - "@truffle/contract-schema": "^3.4.7", - "@truffle/debug-utils": "^6.0.22", - "@truffle/error": "^0.1.0", - "@truffle/interface-adapter": "^0.5.16", - "bignumber.js": "^7.2.1", - "ethereum-ens": "^0.8.0", - "ethers": "^4.0.0-beta.1", - "source-map-support": "^0.5.19" - }, - "peerDependencies": { - "web3": "^1.2.1", - "web3-core-helpers": "^1.2.1", - "web3-core-promievent": "^1.2.1", - "web3-eth-abi": "^1.2.1", - "web3-utils": "^1.2.1" - } - }, - "node_modules/@nomiclabs/truffle-contract/node_modules/ethers": { - "version": "4.0.49", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.49.tgz", - "integrity": "sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg==", - "dev": true, - "dependencies": { - "aes-js": "3.0.0", - "bn.js": "^4.11.9", - "elliptic": "6.5.4", - "hash.js": "1.1.3", - "js-sha3": "0.5.7", - "scrypt-js": "2.0.4", - "setimmediate": "1.0.4", - "uuid": "2.0.1", - "xmlhttprequest": "1.8.0" - } - }, - "node_modules/@nomiclabs/truffle-contract/node_modules/hash.js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.0" - } - }, - "node_modules/@nomiclabs/truffle-contract/node_modules/scrypt-js": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", - "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==", - "dev": true - }, - "node_modules/@nomiclabs/truffle-contract/node_modules/setimmediate": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", - "integrity": "sha512-/TjEmXQVEzdod/FFskf3o7oOAsGhHf2j1dZqRFbDzq4F3mvvxflIIi4Hd3bLQE9y/CpwqfSQam5JakI/mi3Pog==", - "dev": true - }, "node_modules/@openzeppelin/contract-loader": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/@openzeppelin/contract-loader/-/contract-loader-0.6.3.tgz", @@ -3626,7 +3520,8 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/@types/chai-as-promised": { "version": "7.1.5", @@ -7564,20 +7459,6 @@ "setimmediate": "^1.0.5" } }, - "node_modules/ethereum-ens": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/ethereum-ens/-/ethereum-ens-0.8.0.tgz", - "integrity": "sha512-a8cBTF4AWw1Q1Y37V1LSCS9pRY4Mh3f8vCg5cbXCCEJ3eno1hbI/+Ccv9SZLISYpqQhaglP3Bxb/34lS4Qf7Bg==", - "dev": true, - "dependencies": { - "bluebird": "^3.4.7", - "eth-ens-namehash": "^2.0.0", - "js-sha3": "^0.5.7", - "pako": "^1.0.4", - "underscore": "^1.8.3", - "web3": "^1.0.0-beta.34" - } - }, "node_modules/ethereumjs-abi": { "version": "0.6.8", "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", @@ -12817,12 +12698,6 @@ "node": ">=6" } }, - "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, "node_modules/param-case": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", @@ -16556,12 +16431,6 @@ "ieee754": "^1.1.13" } }, - "node_modules/underscore": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", - "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==", - "dev": true - }, "node_modules/undici": { "version": "5.22.0", "resolved": "https://registry.npmjs.org/undici/-/undici-5.22.0.tgz", @@ -19901,41 +19770,6 @@ } } }, - "@nomiclabs/hardhat-truffle5": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-truffle5/-/hardhat-truffle5-2.0.7.tgz", - "integrity": "sha512-Pw8451IUZp1bTp0QqCHCYfCHs66sCnyxPcaorapu9mfOV9xnZsVaFdtutnhNEiXdiZwbed7LFKpRsde4BjFwig==", - "dev": true, - "requires": { - "@nomiclabs/truffle-contract": "^4.2.23", - "@types/chai": "^4.2.0", - "chai": "^4.2.0", - "ethereumjs-util": "^7.1.4", - "fs-extra": "^7.0.1" - }, - "dependencies": { - "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - } - } - }, "@nomiclabs/hardhat-web3": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-web3/-/hardhat-web3-2.0.0.tgz", @@ -19945,65 +19779,6 @@ "@types/bignumber.js": "^5.0.0" } }, - "@nomiclabs/truffle-contract": { - "version": "4.5.10", - "resolved": "https://registry.npmjs.org/@nomiclabs/truffle-contract/-/truffle-contract-4.5.10.tgz", - "integrity": "sha512-nF/6InFV+0hUvutyFgsdOMCoYlr//2fJbRER4itxYtQtc4/O1biTwZIKRu+5l2J5Sq6LU2WX7vZHtDgQdhWxIQ==", - "dev": true, - "requires": { - "@ensdomains/ensjs": "^2.0.1", - "@truffle/blockchain-utils": "^0.1.3", - "@truffle/contract-schema": "^3.4.7", - "@truffle/debug-utils": "^6.0.22", - "@truffle/error": "^0.1.0", - "@truffle/interface-adapter": "^0.5.16", - "bignumber.js": "^7.2.1", - "ethereum-ens": "^0.8.0", - "ethers": "^4.0.0-beta.1", - "source-map-support": "^0.5.19" - }, - "dependencies": { - "ethers": { - "version": "4.0.49", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.49.tgz", - "integrity": "sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg==", - "dev": true, - "requires": { - "aes-js": "3.0.0", - "bn.js": "^4.11.9", - "elliptic": "6.5.4", - "hash.js": "1.1.3", - "js-sha3": "0.5.7", - "scrypt-js": "2.0.4", - "setimmediate": "1.0.4", - "uuid": "2.0.1", - "xmlhttprequest": "1.8.0" - } - }, - "hash.js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.0" - } - }, - "scrypt-js": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", - "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==", - "dev": true - }, - "setimmediate": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", - "integrity": "sha512-/TjEmXQVEzdod/FFskf3o7oOAsGhHf2j1dZqRFbDzq4F3mvvxflIIi4Hd3bLQE9y/CpwqfSQam5JakI/mi3Pog==", - "dev": true - } - } - }, "@openzeppelin/contract-loader": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/@openzeppelin/contract-loader/-/contract-loader-0.6.3.tgz", @@ -21585,7 +21360,8 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==", - "dev": true + "dev": true, + "peer": true }, "@types/chai-as-promised": { "version": "7.1.5", @@ -24763,20 +24539,6 @@ "setimmediate": "^1.0.5" } }, - "ethereum-ens": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/ethereum-ens/-/ethereum-ens-0.8.0.tgz", - "integrity": "sha512-a8cBTF4AWw1Q1Y37V1LSCS9pRY4Mh3f8vCg5cbXCCEJ3eno1hbI/+Ccv9SZLISYpqQhaglP3Bxb/34lS4Qf7Bg==", - "dev": true, - "requires": { - "bluebird": "^3.4.7", - "eth-ens-namehash": "^2.0.0", - "js-sha3": "^0.5.7", - "pako": "^1.0.4", - "underscore": "^1.8.3", - "web3": "^1.0.0-beta.34" - } - }, "ethereumjs-abi": { "version": "0.6.8", "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", @@ -28857,12 +28619,6 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, - "pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, "param-case": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", @@ -31749,12 +31505,6 @@ } } }, - "underscore": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", - "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==", - "dev": true - }, "undici": { "version": "5.22.0", "resolved": "https://registry.npmjs.org/undici/-/undici-5.22.0.tgz", diff --git a/package.json b/package.json index 23619b65f..60b13afb8 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,6 @@ "@ensdomains/ens-contracts": "^0.0.3", "@nomicfoundation/hardhat-network-helpers": "^1.0.11", "@nomicfoundation/hardhat-toolbox": "^2.0.2", - "@nomiclabs/hardhat-truffle5": "^2.0.7", "@nomiclabs/hardhat-web3": "^2.0.0", "@openzeppelin/test-helpers": "^0.5.16", "@openzeppelin/upgrades-core": "^1.37.1", diff --git a/test/000_fullchain.test.ts b/test/000_fullchain.test.ts index 701c5b47a..7fdfc8e6e 100644 --- a/test/000_fullchain.test.ts +++ b/test/000_fullchain.test.ts @@ -3,7 +3,8 @@ import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import { ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, IexecInterfaceNative__factory } from '../typechain'; import { OrdersActors, OrdersAssets, OrdersPrices, buildOrders } from '../utils/createOrders'; diff --git a/test/200_fullchain-bot.test.ts b/test/200_fullchain-bot.test.ts index 4336f5f6b..5b1250c3f 100644 --- a/test/200_fullchain-bot.test.ts +++ b/test/200_fullchain-bot.test.ts @@ -3,7 +3,7 @@ import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { expect } from 'hardhat'; +import { expect } from 'chai'; import { loadHardhatFixtureDeployment } from '../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, IexecInterfaceNative__factory } from '../typechain'; import { OrdersActors, OrdersAssets, OrdersPrices, buildOrders } from '../utils/createOrders'; diff --git a/test/201_fullchain-multi-orders.test.ts b/test/201_fullchain-multi-orders.test.ts index 5ed56f806..0066cccfe 100644 --- a/test/201_fullchain-multi-orders.test.ts +++ b/test/201_fullchain-multi-orders.test.ts @@ -3,7 +3,8 @@ import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import { ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, diff --git a/test/300_fullchain-reopen.test.ts b/test/300_fullchain-reopen.test.ts index e08eaff9e..18f8858a4 100644 --- a/test/300_fullchain-reopen.test.ts +++ b/test/300_fullchain-reopen.test.ts @@ -5,7 +5,7 @@ import { AddressZero } from '@ethersproject/constants'; import { loadFixture, mine } from '@nomicfoundation/hardhat-network-helpers'; import { setNextBlockTimestamp } from '@nomicfoundation/hardhat-network-helpers/dist/src/helpers/time'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { expect } from 'hardhat'; +import { expect } from 'chai'; import { loadHardhatFixtureDeployment } from '../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, IexecInterfaceNative__factory } from '../typechain'; import { OrdersActors, OrdersAssets, OrdersPrices, buildOrders } from '../utils/createOrders'; diff --git a/test/byContract/ENSIntegration/ENSIntegration.test.ts b/test/byContract/ENSIntegration/ENSIntegration.test.ts index f233bf54e..9a4149676 100644 --- a/test/byContract/ENSIntegration/ENSIntegration.test.ts +++ b/test/byContract/ENSIntegration/ENSIntegration.test.ts @@ -3,7 +3,8 @@ import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { deployments, ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import { deployments, ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { ENSRegistry, diff --git a/test/byContract/IexecAccessors/IexecAccessors.test.ts b/test/byContract/IexecAccessors/IexecAccessors.test.ts index 66681e661..3936cde8c 100644 --- a/test/byContract/IexecAccessors/IexecAccessors.test.ts +++ b/test/byContract/IexecAccessors/IexecAccessors.test.ts @@ -4,7 +4,8 @@ import { AddressZero, HashZero } from '@ethersproject/constants'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { deployments, ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import { deployments, ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, IexecInterfaceNative__factory } from '../../../typechain'; import { diff --git a/test/byContract/IexecAccessors/IexecAccessorsABILegacy.test.ts b/test/byContract/IexecAccessors/IexecAccessorsABILegacy.test.ts index 72b68cdba..2f531e545 100644 --- a/test/byContract/IexecAccessors/IexecAccessorsABILegacy.test.ts +++ b/test/byContract/IexecAccessors/IexecAccessorsABILegacy.test.ts @@ -4,7 +4,8 @@ import { AddressZero } from '@ethersproject/constants'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import { ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, diff --git a/test/byContract/IexecCategoryManager/IexecCategoryManager.test.ts b/test/byContract/IexecCategoryManager/IexecCategoryManager.test.ts index 6cd031fef..9b1a0d970 100644 --- a/test/byContract/IexecCategoryManager/IexecCategoryManager.test.ts +++ b/test/byContract/IexecCategoryManager/IexecCategoryManager.test.ts @@ -3,7 +3,7 @@ import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { expect } from 'hardhat'; +import { expect } from 'chai'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, IexecInterfaceNative__factory } from '../../../typechain'; import { Category, getIexecAccounts } from '../../../utils/poco-tools'; diff --git a/test/byContract/IexecERC20/IexecERC20.test.ts b/test/byContract/IexecERC20/IexecERC20.test.ts index d9ffe3873..845eec6ef 100644 --- a/test/byContract/IexecERC20/IexecERC20.test.ts +++ b/test/byContract/IexecERC20/IexecERC20.test.ts @@ -3,8 +3,9 @@ import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; +import { expect } from 'chai'; import { BigNumber } from 'ethers'; -import { ethers, expect } from 'hardhat'; +import { ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, diff --git a/test/byContract/IexecEscrow/IexecEscrowNative.test.ts b/test/byContract/IexecEscrow/IexecEscrowNative.test.ts index 6bed9aff3..f7894ba4b 100644 --- a/test/byContract/IexecEscrow/IexecEscrowNative.test.ts +++ b/test/byContract/IexecEscrow/IexecEscrowNative.test.ts @@ -4,8 +4,9 @@ import { AddressZero } from '@ethersproject/constants'; import { loadFixture, setStorageAt } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; +import { expect } from 'chai'; import { BigNumber } from 'ethers'; -import { ethers, expect } from 'hardhat'; +import { ethers } from 'hardhat'; import CONFIG from '../../../config/config.json'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, IexecInterfaceNative__factory } from '../../../typechain'; diff --git a/test/byContract/IexecEscrow/IexecEscrowToken.test.ts b/test/byContract/IexecEscrow/IexecEscrowToken.test.ts index 5835ea76f..afa2bc6b9 100644 --- a/test/byContract/IexecEscrow/IexecEscrowToken.test.ts +++ b/test/byContract/IexecEscrow/IexecEscrowToken.test.ts @@ -4,8 +4,9 @@ import { AddressZero } from '@ethersproject/constants'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; +import { expect } from 'chai'; import { BigNumber } from 'ethers'; -import { ethers, expect } from 'hardhat'; +import { ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceToken, diff --git a/test/byContract/IexecMaintenance/IexecMaintenance.test.ts b/test/byContract/IexecMaintenance/IexecMaintenance.test.ts index dad167cab..cab9060e7 100644 --- a/test/byContract/IexecMaintenance/IexecMaintenance.test.ts +++ b/test/byContract/IexecMaintenance/IexecMaintenance.test.ts @@ -4,7 +4,8 @@ import { HashZero as hashZero } from '@ethersproject/constants'; import { loadFixture, setStorageAt } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import { ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, diff --git a/test/byContract/IexecOrderManagement/IexecOrderManagement.test.ts b/test/byContract/IexecOrderManagement/IexecOrderManagement.test.ts index 243f73868..fe5954171 100644 --- a/test/byContract/IexecOrderManagement/IexecOrderManagement.test.ts +++ b/test/byContract/IexecOrderManagement/IexecOrderManagement.test.ts @@ -3,7 +3,8 @@ import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import { ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, diff --git a/test/byContract/IexecPoco/IexecPoco1.test.ts b/test/byContract/IexecPoco/IexecPoco1.test.ts index 61d4abfd2..5d08f44a9 100644 --- a/test/byContract/IexecPoco/IexecPoco1.test.ts +++ b/test/byContract/IexecPoco/IexecPoco1.test.ts @@ -5,7 +5,8 @@ import { AddressZero, HashZero } from '@ethersproject/constants'; import { Contract, ContractTransaction } from '@ethersproject/contracts'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import { ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { ERC1271Mock, @@ -19,8 +20,8 @@ import { OwnableMock, OwnableMock__factory, } from '../../../typechain'; -import { IexecPoco1 } from '../../../typechain/contracts/modules/interfaces/IexecPoco1.v8.sol'; -import { IexecPoco1__factory } from '../../../typechain/factories/contracts/modules/interfaces/IexecPoco1.v8.sol'; +import { IexecPoco1 } from '../../../typechain/contracts/modules/interfaces/IexecPoco1.v8.sol/IexecPoco1'; +import { IexecPoco1__factory } from '../../../typechain/factories/contracts/modules/interfaces/IexecPoco1.v8.sol/IexecPoco1__factory'; import { IexecOrders, OrdersActors, diff --git a/test/byContract/IexecPoco/IexecPoco2-claim.test.ts b/test/byContract/IexecPoco/IexecPoco2-claim.test.ts index e93a166d8..0e95fd6d5 100644 --- a/test/byContract/IexecPoco/IexecPoco2-claim.test.ts +++ b/test/byContract/IexecPoco/IexecPoco2-claim.test.ts @@ -3,7 +3,8 @@ import { loadFixture, mine, time } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import { ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, IexecInterfaceNative__factory } from '../../../typechain'; import { OrdersAssets, OrdersPrices, buildOrders } from '../../../utils/createOrders'; diff --git a/test/byContract/IexecPoco/IexecPoco2-contribute-and-finalize.test.ts b/test/byContract/IexecPoco/IexecPoco2-contribute-and-finalize.test.ts index 7f23b03e1..498d3d765 100644 --- a/test/byContract/IexecPoco/IexecPoco2-contribute-and-finalize.test.ts +++ b/test/byContract/IexecPoco/IexecPoco2-contribute-and-finalize.test.ts @@ -4,7 +4,8 @@ import { AddressZero, HashZero } from '@ethersproject/constants'; import { loadFixture, time } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import { ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, diff --git a/test/byContract/IexecPoco/IexecPoco2-contribute.test.ts b/test/byContract/IexecPoco/IexecPoco2-contribute.test.ts index 2abbde4c8..0fbf074c8 100644 --- a/test/byContract/IexecPoco/IexecPoco2-contribute.test.ts +++ b/test/byContract/IexecPoco/IexecPoco2-contribute.test.ts @@ -4,7 +4,7 @@ import { AddressZero, HashZero } from '@ethersproject/constants'; import { loadFixture, time } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { assert, expect } from 'hardhat'; +import { assert, expect } from 'chai'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, IexecInterfaceNative__factory } from '../../../typechain'; import { NULL } from '../../../utils/constants'; diff --git a/test/byContract/IexecPoco/IexecPoco2-finalize.test.ts b/test/byContract/IexecPoco/IexecPoco2-finalize.test.ts index e4fcded5b..8f4e59efe 100644 --- a/test/byContract/IexecPoco/IexecPoco2-finalize.test.ts +++ b/test/byContract/IexecPoco/IexecPoco2-finalize.test.ts @@ -4,7 +4,8 @@ import { AddressZero } from '@ethersproject/constants'; import { loadFixture, setStorageAt, time } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import { ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, diff --git a/test/byContract/IexecPoco/IexecPoco2-initialize.test.ts b/test/byContract/IexecPoco/IexecPoco2-initialize.test.ts index 9e91063f3..a77bb7bc7 100644 --- a/test/byContract/IexecPoco/IexecPoco2-initialize.test.ts +++ b/test/byContract/IexecPoco/IexecPoco2-initialize.test.ts @@ -3,7 +3,8 @@ import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import { ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, IexecInterfaceNative__factory } from '../../../typechain'; import { diff --git a/test/byContract/IexecPoco/IexecPoco2-reopen.test.ts b/test/byContract/IexecPoco/IexecPoco2-reopen.test.ts index 46d6c8821..23c793636 100644 --- a/test/byContract/IexecPoco/IexecPoco2-reopen.test.ts +++ b/test/byContract/IexecPoco/IexecPoco2-reopen.test.ts @@ -5,7 +5,7 @@ import { AddressZero, HashZero } from '@ethersproject/constants'; import { loadFixture, mine, time } from '@nomicfoundation/hardhat-network-helpers'; import { setNextBlockTimestamp } from '@nomicfoundation/hardhat-network-helpers/dist/src/helpers/time'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { expect } from 'hardhat'; +import { expect } from 'chai'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, IexecInterfaceNative__factory } from '../../../typechain'; import { OrdersAssets, OrdersPrices, buildOrders } from '../../../utils/createOrders'; diff --git a/test/byContract/IexecPoco/IexecPoco2-reveal.test.ts b/test/byContract/IexecPoco/IexecPoco2-reveal.test.ts index f275cb7b4..882199499 100644 --- a/test/byContract/IexecPoco/IexecPoco2-reveal.test.ts +++ b/test/byContract/IexecPoco/IexecPoco2-reveal.test.ts @@ -4,7 +4,8 @@ import { AddressZero, HashZero } from '@ethersproject/constants'; import { loadFixture, time } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import { ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, IexecInterfaceNative__factory } from '../../../typechain'; import { NULL } from '../../../utils/constants'; diff --git a/test/byContract/IexecPocoBoost/IexecEscrow.v8.test.ts b/test/byContract/IexecPocoBoost/IexecEscrow.v8.test.ts index a4ab9460b..e4cf9e406 100644 --- a/test/byContract/IexecPocoBoost/IexecEscrow.v8.test.ts +++ b/test/byContract/IexecPocoBoost/IexecEscrow.v8.test.ts @@ -4,8 +4,8 @@ import { HashZero } from '@ethersproject/constants'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; +import { expect } from 'chai'; import { constants } from 'ethers'; -import { expect } from 'hardhat'; import { IexecEscrowTestContract, IexecEscrowTestContract__factory } from '../../../typechain'; import { getIexecAccounts } from '../../../utils/poco-tools'; diff --git a/test/byContract/IexecRelay/IexecRelay.test.ts b/test/byContract/IexecRelay/IexecRelay.test.ts index c9c1e34eb..178195cd9 100644 --- a/test/byContract/IexecRelay/IexecRelay.test.ts +++ b/test/byContract/IexecRelay/IexecRelay.test.ts @@ -2,7 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; -import { ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import { ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { IexecInterfaceNative, diff --git a/test/byContract/registries/assets.test.ts b/test/byContract/registries/assets.test.ts index 876734418..f4f4683a8 100644 --- a/test/byContract/registries/assets.test.ts +++ b/test/byContract/registries/assets.test.ts @@ -4,7 +4,8 @@ import { BytesLike } from '@ethersproject/bytes'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { deployments, ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import { deployments, ethers } from 'hardhat'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { App, diff --git a/test/byContract/registries/registries.test.ts b/test/byContract/registries/registries.test.ts index 5919e51b6..5d819f2a1 100644 --- a/test/byContract/registries/registries.test.ts +++ b/test/byContract/registries/registries.test.ts @@ -5,7 +5,8 @@ import { BytesLike } from '@ethersproject/bytes'; import { AddressZero } from '@ethersproject/constants'; import { loadFixture } from '@nomicfoundation/hardhat-network-helpers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import hre, { deployments, ethers, expect } from 'hardhat'; +import { expect } from 'chai'; +import hre, { deployments, ethers } from 'hardhat'; import CONFIG from '../../../config/config.json'; import { loadHardhatFixtureDeployment } from '../../../scripts/hardhat-fixture-deployer'; import { diff --git a/test/utils/IexecWrapper.ts b/test/utils/IexecWrapper.ts index 5eadff95b..1c99e1ca2 100644 --- a/test/utils/IexecWrapper.ts +++ b/test/utils/IexecWrapper.ts @@ -4,8 +4,9 @@ import { TypedDataDomain } from '@ethersproject/abstract-signer'; import { AddressZero } from '@ethersproject/constants'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; +import { expect } from 'chai'; import { BigNumber, ContractReceipt } from 'ethers'; -import hre, { ethers, expect } from 'hardhat'; +import hre, { ethers } from 'hardhat'; import config from '../../config/config.json'; import { AppRegistry, @@ -24,7 +25,7 @@ import { WorkerpoolRegistry__factory, Workerpool__factory, } from '../../typechain'; -import { IexecPoco1__factory } from '../../typechain/factories/contracts/modules/interfaces/IexecPoco1.v8.sol'; +import { IexecPoco1__factory } from '../../typechain/factories/contracts/modules/interfaces/IexecPoco1.v8.sol/IexecPoco1__factory'; import { IexecOrders, OrderOperation, diff --git a/utils/ens-tools.js b/utils/ens-tools.js index 8c3ff8173..b2e5c5dbc 100644 --- a/utils/ens-tools.js +++ b/utils/ens-tools.js @@ -6,6 +6,8 @@ var PublicResolver = artifacts.require( '@ensdomains/ens-contracts/contracts/resolvers/PublicResolver', ); +// TODO remove. + module.exports = { labelhash: function (label) { return web3.utils.keccak256(label.toLowerCase()); diff --git a/utils/odb-tools.js b/utils/odb-tools.js index 6702b4e14..dc638e3fb 100644 --- a/utils/odb-tools.js +++ b/utils/odb-tools.js @@ -4,6 +4,9 @@ const constants = require('./constants'); const ethers = require('ethers'); +// TODO remove except `signStruct` and `hashStruct` +// both used in createOrders.ts. + const TYPES = { EIP712Domain: [ { type: 'string', name: 'name' }, diff --git a/utils/tools.d.ts b/utils/tools.d.ts deleted file mode 100644 index 81a29e778..000000000 --- a/utils/tools.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-FileCopyrightText: 2023 IEXEC BLOCKCHAIN TECH -// SPDX-License-Identifier: Apache-2.0 - -import { BigNumber } from '@ethersproject/bignumber'; -import { ContractReceipt, Event } from '@ethersproject/contracts'; - -export function extractEventsFromReceipt( - txReceipt: ContractReceipt, - address: string, - name: string, -): Event[]; - -export function compactSignature(signature: string): string; -export function BN2Address(n: BigNumber): string; diff --git a/utils/tools.js b/utils/tools.js deleted file mode 100644 index f59d1ca76..000000000 --- a/utils/tools.js +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-FileCopyrightText: 2020 IEXEC BLOCKCHAIN TECH -// SPDX-License-Identifier: Apache-2.0 - -const { ethers } = require('ethers'); - -function _extractEvents(data, address, name) { - const events = data.filter((ev) => { - return ev.address == address && ev.event == name; - }); - assert.isNotEmpty(events, `Fail to extract '${name}' event`); - return events; -} - -module.exports = { - extractEvents: function (txMined, address, name) { - return _extractEvents(txMined.logs, address, name); - }, - - extractEventsFromReceipt: function (txReceipt, address, name) { - return _extractEvents(txReceipt.events, address, name); - }, - - BN2Address: function (n) { - const x = web3.utils.toHex(n); - return web3.utils.toChecksumAddress('0x' + '0'.repeat(42 - x.length) + x.slice(2)); - }, - - create2: function (creator, code, salt) { - return web3.utils.toChecksumAddress( - web3.utils - .soliditySha3( - { t: 'bytes1', v: '0xff' }, - { t: 'address', v: creator }, - { t: 'bytes32', v: salt }, - { t: 'bytes32', v: web3.utils.keccak256(code) }, - ) - .slice(26), - ); - }, - - compactSignature: function (signature) { - let split = ethers.utils.splitSignature(signature); - let vs = ethers.utils.arrayify(split.s); - if (split.v == 1 || split.v == 28) { - vs[0] |= 0x80; - } - return ethers.utils.hexlify(ethers.utils.concat([split.r, vs])); - }, -}; diff --git a/utils/tools.ts b/utils/tools.ts new file mode 100644 index 000000000..ddeb266a4 --- /dev/null +++ b/utils/tools.ts @@ -0,0 +1,34 @@ +// SPDX-FileCopyrightText: 2020-2025 IEXEC BLOCKCHAIN TECH +// SPDX-License-Identifier: Apache-2.0 + +import { assert } from 'chai'; +import type { BigNumber } from 'ethers'; +import { ethers } from 'hardhat'; +import { ContractReceipt, Event } from '@ethersproject/contracts'; + +export function extractEventsFromReceipt( + txReceipt: ContractReceipt, + address: string, + name: string, +): Event[] { + const receiptEvents = txReceipt?.events || []; + const events = receiptEvents.filter((event) => { + return event.address == address && event.event == name; + }); + assert.isNotEmpty(events, `Fail to extract '${name}' event`); + return events; +} + +export function compactSignature(signature: string): string { + const split = ethers.utils.splitSignature(signature); + let vs = ethers.utils.arrayify(split.s); + if (split.v == 1 || split.v == 28) { + vs[0] |= 0x80; + } + return ethers.utils.hexlify(ethers.utils.concat([split.r, vs])); +} + +export function BN2Address(bignumber: BigNumber) { + const lowercaseAddress = ethers.utils.hexZeroPad(bignumber.toHexString(), 20); + return ethers.utils.getAddress(lowercaseAddress); +}