Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
51d4e23
Update changelog, package scripts, and migrate test files for IexecPo…
Le-Caignec Feb 17, 2025
21dab8e
Update copyright years in IexecPoco test files and adjust variable types
Le-Caignec Feb 17, 2025
e29ecfc
reduce PR diff
Le-Caignec Feb 17, 2025
5e9b268
reduce diff again
Le-Caignec Feb 17, 2025
a3631ea
fix conversion issue
Le-Caignec Feb 17, 2025
9dc6715
fix salt generation in IexecPoco2 reveal test
Le-Caignec Feb 17, 2025
278dd83
update compactSignature to use yParity for high bit check
Le-Caignec Feb 17, 2025
1694e91
Merge remote-tracking branch 'origin/feature/migration-to-ether-v6' i…
Le-Caignec Feb 17, 2025
8b7ae82
refactor: replace Address type with string in IexecPoco tests
Le-Caignec Feb 18, 2025
604d985
refactor: replace iexecPocoAddress with proxyAddress in IexecPoco2 tests
Le-Caignec Feb 18, 2025
3740772
refactor: update callback address retrieval in IexecPoco2 finalize test
Le-Caignec Feb 18, 2025
c5aa92b
remove useless comment
Le-Caignec Feb 18, 2025
fae693b
remove comment again
Le-Caignec Feb 18, 2025
ff86e7c
Update utils/tools.ts
Le-Caignec Feb 18, 2025
863ca18
Update utils/tools.ts
Le-Caignec Feb 18, 2025
264b87a
fix compactSignature
Le-Caignec Feb 18, 2025
bf68e03
refactor: rename BN2Address to bigintToAddress and update parameter type
Le-Caignec Feb 18, 2025
937b143
Update test/byContract/IexecPoco/IexecPoco2-finalize.test.ts
Le-Caignec Feb 18, 2025
5359f01
fix: replace iexecPocoAddress with proxyAddress in event assertions
Le-Caignec Feb 18, 2025
0d895e8
Merge branch 'feature/migrate-IexecPoco-to-ethers6' of https://github…
Le-Caignec Feb 18, 2025
0e7c668
fix: remove unused proxyAddress retrieval in IexecPoco2 finalize test
Le-Caignec Feb 18, 2025
671cd4e
refactor: remove unused erc1271Mock variable and streamline contract …
Le-Caignec Feb 18, 2025
f9bc1f0
fix: update comment to reflect correct ethers function for volume con…
Le-Caignec Feb 18, 2025
93b5b23
migrate Number to BigInt
Le-Caignec Feb 18, 2025
537337c
feature/migrate-IexecPoco-to-ethers6-use-BigInt (#200)
james-toussaint Feb 19, 2025
4158636
fix: remove unnecessary BigInt conversion in IexecPoco1 tests
Le-Caignec Feb 19, 2025
46df5db
Update test/byContract/IexecPoco/IexecPoco2-contribute-and-finalize.t…
Le-Caignec Feb 19, 2025
2b293d9
Update test/byContract/IexecPoco/IexecPoco2-contribute-and-finalize.t…
Le-Caignec Feb 19, 2025
ecbcbe5
Update test/byContract/IexecPoco/IexecPoco2-contribute.test.ts
Le-Caignec Feb 19, 2025
af23828
Merge remote-tracking branch 'origin/feature/migration-to-ether-v6' i…
Le-Caignec Feb 19, 2025
124164d
Update CHANGELOG.md
Le-Caignec Feb 19, 2025
0ba93d7
Update CHANGELOG.md
Le-Caignec Feb 19, 2025
1397ec3
minor fix in changelog
Le-Caignec Feb 19, 2025
cd14b8d
refactor: update timestamp handling in IexecWrapper and poco-tools
Le-Caignec Feb 19, 2025
ab51546
Revert "refactor: update timestamp handling in IexecWrapper and poco-…
Le-Caignec Feb 19, 2025
eb06287
refactor: rename oracleConsumerInstanceAddress to oracleConsumerAddre…
Le-Caignec Feb 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
test/byContract/IexecERC20/** \
test/byContract/IexecOrderManagement/** \
test/byContract/IexecRelay/** \
test/byContract/IexecPoco/** \
test/*fullchain*
- name: Run deployment
# Basic deployment to make sure everything is ok.
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
- Tests
- ENSIntegration, IexecOrderManagement, IexecRelay (#195)
- IexecCategoryManager, IexecERC20 (#192)
- test/*fullchain* (#190)
- IexecAccessors (#189, #191)
- test/*fullchain* (#190, #196)
- IexecAccessors (#189, #191, #196)
- IexecPoco (#196)
- Migrate scripts to TypeScript: (#184)
- `getFunctionSignatures.js`, `common-test-snapshot.js`, `test-storage.js`, `timelock.js`
- Migrated utility files to TypeScript : (#183)
Expand Down
52 changes: 24 additions & 28 deletions test/000_fullchain-boost.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ import { IexecWrapper } from './utils/IexecWrapper';
import { loadHardhatFixtureDeployment } from './utils/hardhat-fixture-deployer';

const teeDealTag = '0x0000000000000000000000000000000000000000000000000000000000000001';
const taskIndex = 0;
const volume = taskIndex + 1;
const taskIndex = 0n;
const volume = taskIndex + 1n;
const { results, resultDigest } = buildUtf8ResultAndDigest('result');
const appPrice = 1000;
const datasetPrice = 1_000_000;
const workerpoolPrice = 1_000_000_000;
const appPrice = 1000n;
const datasetPrice = 1_000_000n;
const workerpoolPrice = 1_000_000_000n;

describe('IexecPocoBoostDelegate (IT)', function () {
let domain: TypedDataDomain;
Expand Down Expand Up @@ -146,7 +146,7 @@ describe('IexecPocoBoostDelegate (IT)', function () {
} = orders.toObject();
const dealPrice =
(appPrice + datasetPrice + workerpoolPrice) * // task price
1; // volume
1n; // volume
expect(await iexecInstance.balanceOf(proxyAddress)).to.be.equal(0);
await iexecWrapper.depositInIexecAccount(requester, dealPrice);
expect(await iexecInstance.balanceOf(requester.address)).to.be.equal(dealPrice);
Expand Down Expand Up @@ -203,14 +203,12 @@ describe('IexecPocoBoostDelegate (IT)', function () {
expect(deal.workerpoolOwner).to.be.equal(scheduler.address);
expect(deal.workerpoolPrice).to.be.equal(workerpoolPrice);
expect(deal.requester).to.be.equal(requester.address);
const schedulerRewardRatio = Number(
await WorkerpoolInterface__factory.connect(
workerpoolAddress,
anyone,
).m_schedulerRewardRatioPolicy(),
);
const schedulerRewardRatio = await WorkerpoolInterface__factory.connect(
workerpoolAddress,
anyone,
).m_schedulerRewardRatioPolicy();
expect(deal.workerReward)
.to.be.equal((workerpoolPrice * (100 - schedulerRewardRatio)) / 100)
.to.be.equal((workerpoolPrice * (100n - schedulerRewardRatio)) / 100n)
.to.be.greaterThan(0);
expect(deal.deadline).to.be.equal(startTime + 7 * 300); // Category 0
expect(deal.botFirst).to.be.equal(0);
Expand Down Expand Up @@ -302,7 +300,7 @@ describe('IexecPocoBoostDelegate (IT)', function () {
const { appOrder, datasetOrder, workerpoolOrder, requestOrder } = orders.toObject();
const dealPrice =
(appPrice + datasetPrice + workerpoolPrice) * // task price
1; // volume
1n; // volume
expect(await iexecInstance.balanceOf(proxyAddress)).to.be.equal(0);
expect(await iexecInstance.balanceOf(requester.address)).to.be.equal(0);
expect(await iexecInstance.frozenOf(requester.address)).to.be.equal(0);
Expand Down Expand Up @@ -370,14 +368,12 @@ describe('IexecPocoBoostDelegate (IT)', function () {
expect(deal.workerpoolPrice).to.be.equal(workerpoolPrice);
expect(deal.requester).to.be.equal(requester.address);
expect(deal.sponsor).to.be.equal(sponsor.address);
const schedulerRewardRatio = Number(
await WorkerpoolInterface__factory.connect(
workerpoolAddress,
anyone,
).m_schedulerRewardRatioPolicy(),
);
const schedulerRewardRatio = await WorkerpoolInterface__factory.connect(
workerpoolAddress,
anyone,
).m_schedulerRewardRatioPolicy();
expect(deal.workerReward)
.to.be.equal((workerpoolPrice * (100 - schedulerRewardRatio)) / 100)
.to.be.equal((workerpoolPrice * (100n - schedulerRewardRatio)) / 100n)
.to.be.greaterThan(0);
expect(deal.deadline).to.be.equal(startTime + 7 * 300); // Category 0
expect(deal.botFirst).to.be.equal(0);
Expand Down Expand Up @@ -454,7 +450,7 @@ describe('IexecPocoBoostDelegate (IT)', function () {
});

it('Should push result (TEE with contribution authorization signed by scheduler)', async function () {
const volume = 3;
const volume = 3n;
const orders = buildOrders({
assets: ordersAssets,
requester: requester.address,
Expand Down Expand Up @@ -503,7 +499,7 @@ describe('IexecPocoBoostDelegate (IT)', function () {
expect(await iexecInstance.balanceOf(datasetProvider.address)).to.be.equal(0);
expect(await iexecInstance.balanceOf(scheduler.address)).to.be.equal(0);
expect(await iexecInstance.frozenOf(scheduler.address)).to.be.equal(schedulerDealStake);
const expectedWorkerReward = Number((await viewDealBoost(dealId)).workerReward);
const expectedWorkerReward = (await viewDealBoost(dealId)).workerReward;
const schedulerBaseReward = workerpoolPrice - expectedWorkerReward;

await expect(
Expand Down Expand Up @@ -543,7 +539,7 @@ describe('IexecPocoBoostDelegate (IT)', function () {
.withArgs(scheduler.address, schedulerBaseReward, taskId)
.to.emit(iexecPocoBoostInstance, 'ResultPushedBoost')
.withArgs(dealId, taskIndex, results);
const remainingTasksToPush = volume - 1;
const remainingTasksToPush = volume - 1n;
expect(await iexecInstance.balanceOf(proxyAddress)).to.be.equal(
(taskPrice + schedulerTaskStake) * remainingTasksToPush,
);
Expand Down Expand Up @@ -611,8 +607,8 @@ describe('IexecPocoBoostDelegate (IT)', function () {

describe('Claim', function () {
it('Should refund requester on claim of non sponsored deal (TEE)', async function () {
const expectedVolume = 3; // > 1 to explicit taskPrice vs dealPrice
const claimedTasks = 1;
const expectedVolume = 3n; // > 1 to explicit taskPrice vs dealPrice
const claimedTasks = 1n;
const taskPrice = appPrice + datasetPrice + workerpoolPrice;
const dealPrice = taskPrice * expectedVolume;
const orders = buildOrders({
Expand Down Expand Up @@ -693,8 +689,8 @@ describe('IexecPocoBoostDelegate (IT)', function () {
});

it('Should refund sponsor on claim of a sponsored deal (TEE)', async function () {
const expectedVolume = 3; // > 1 to explicit taskPrice vs dealPrice
const claimedTasks = 1;
const expectedVolume = 3n; // > 1 to explicit taskPrice vs dealPrice
const claimedTasks = 1n;
const taskPrice = appPrice + datasetPrice + workerpoolPrice;
const dealPrice = taskPrice * expectedVolume;
const orders = buildOrders({
Expand Down
Loading