From 3b21f4bb943898cc3922d14a5d4e02395064e15f Mon Sep 17 00:00:00 2001 From: Le-Caignec Date: Thu, 20 Feb 2025 15:00:45 +0100 Subject: [PATCH 1/3] Update tests and utility functions to use bigint for category index and scheduler reward ratio --- .../IexecCategoryManager/IexecCategoryManager.test.ts | 4 ++-- test/utils/IexecWrapper.ts | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/test/byContract/IexecCategoryManager/IexecCategoryManager.test.ts b/test/byContract/IexecCategoryManager/IexecCategoryManager.test.ts index d742712a6..67cdb4282 100644 --- a/test/byContract/IexecCategoryManager/IexecCategoryManager.test.ts +++ b/test/byContract/IexecCategoryManager/IexecCategoryManager.test.ts @@ -45,9 +45,9 @@ describe('CategoryManager', async () => { }); it('Should not view category with bad index', async () => { - const lastCategoryIndex = Number(await iexecPocoAsAnyone.countCategory()) - 1; + const lastCategoryIndex = (await iexecPocoAsAnyone.countCategory()) - 1n; await expect( - iexecPocoAsAnyone.viewCategory(lastCategoryIndex + 1), + iexecPocoAsAnyone.viewCategory(lastCategoryIndex + 1n), ).to.be.revertedWithoutReason(); }); diff --git a/test/utils/IexecWrapper.ts b/test/utils/IexecWrapper.ts index 4d49bf6d1..119d03335 100644 --- a/test/utils/IexecWrapper.ts +++ b/test/utils/IexecWrapper.ts @@ -151,12 +151,10 @@ export class IexecWrapper { * @returns value of the reward */ async getSchedulerRewardRatio(workerpoolAddress: string) { - return Number( - await Workerpool__factory.connect( - workerpoolAddress, - this.accounts.anyone, - ).m_schedulerRewardRatioPolicy(), - ); + return await Workerpool__factory.connect( + workerpoolAddress, + this.accounts.anyone, + ).m_schedulerRewardRatioPolicy(); } /** From 4247bf50dbf382bfc182e1d1ce299cf782240c20 Mon Sep 17 00:00:00 2001 From: Le-Caignec Date: Thu, 20 Feb 2025 16:25:53 +0100 Subject: [PATCH 2/3] Update CHANGELOG to include IexecWrapper in the list of tests --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4e14019a..ee930122b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,12 +12,13 @@ - Tests - IexecEscrow (#199) - ENSIntegration, IexecOrderManagement, IexecRelay (#195, #199) - - IexecCategoryManager, IexecERC20 (#192, #199) + - IexecCategoryManager, IexecERC20 (#192, #199, #202) - test/*fullchain* (#190, #196) - IexecAccessors, IexecMaintenance (#189, #191, #199) - IexecPoco (#196) - `trust` specific field (#201) - IexecPocoBoost (#198) + - minor fixe in bigint for IexecWrapper (#202) - Migrate scripts to TypeScript: (#184) - `getFunctionSignatures.js`, `common-test-snapshot.js`, `test-storage.js`, `timelock.js` - Migrated utility files to TypeScript : (#183) From 286ae38f300317287bd32ee782ebf015e0ba029b Mon Sep 17 00:00:00 2001 From: Le-Caignec Date: Thu, 20 Feb 2025 16:27:56 +0100 Subject: [PATCH 3/3] Fix minor issue in BigInt for IexecWrapper in CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee930122b..01bfbcc17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ - IexecPoco (#196) - `trust` specific field (#201) - IexecPocoBoost (#198) - - minor fixe in bigint for IexecWrapper (#202) + - fixed a minor issue in BigInt for IexecWrapper (#202). - Migrate scripts to TypeScript: (#184) - `getFunctionSignatures.js`, `common-test-snapshot.js`, `test-storage.js`, `timelock.js` - Migrated utility files to TypeScript : (#183)