Skip to content

Commit 5b7c9c2

Browse files
committed
Use plain prices for workerpool orders and check request order consumed
1 parent 09970c2 commit 5b7c9c2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/201_fullchain-multi-orders.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ import { IexecWrapper } from './utils/IexecWrapper';
2929
const standardDealTag = '0x0000000000000000000000000000000000000000000000000000000000000000';
3030
const appPrice = 1000;
3131
const datasetPrice = 1_000_000;
32-
const workerpoolPrice = 1_000_000_000;
32+
const workerpoolPrice1 = 1_000_000_015;
33+
const workerpoolPrice2 = 1_000_000_025;
3334
const { results, resultDigest } = buildUtf8ResultAndDigest('result');
3435

3536
let proxyAddress: string;
@@ -71,7 +72,7 @@ describe('Integration tests', function () {
7172
ordersPrices = {
7273
app: appPrice,
7374
dataset: datasetPrice,
74-
workerpool: workerpoolPrice,
75+
workerpool: 0, // Overridden below.
7576
};
7677
}
7778

@@ -85,8 +86,6 @@ describe('Integration tests', function () {
8586
const workerpoolOrderVolume2 = 10;
8687
const dealVolume1 = Math.min(workerpoolOrderVolume1, volume); // min(2, 3);
8788
const dealVolume2 = Math.min(workerpoolOrderVolume2, volume - dealVolume1); // min(10, 1)
88-
const workerpoolPrice1 = workerpoolPrice + 15;
89-
const workerpoolPrice2 = workerpoolPrice + 25;
9089
const taskPrice1 = appPrice + datasetPrice + workerpoolPrice1;
9190
const taskPrice2 = appPrice + datasetPrice + workerpoolPrice2;
9291
// Create default orders.
@@ -103,8 +102,8 @@ describe('Integration tests', function () {
103102
volume,
104103
}).toObject();
105104
// Create 2 different orders for the same workerpool.
106-
const workerpoolOrder1 = workerpoolOrder;
107-
const workerpoolOrder2 = { ...workerpoolOrder }; // Shallow cloning is fine here.
105+
const workerpoolOrder1 = { ...workerpoolOrder }; // Shallow cloning is fine here.
106+
const workerpoolOrder2 = { ...workerpoolOrder };
108107
workerpoolOrder1.volume = workerpoolOrderVolume1;
109108
workerpoolOrder1.workerpoolprice = workerpoolPrice1;
110109
workerpoolOrder2.volume = workerpoolOrderVolume2;
@@ -190,6 +189,7 @@ describe('Integration tests', function () {
190189
workersRewardPerTaskOfDeal2,
191190
);
192191
// Check remaining volumes.
192+
expect(await iexecPoco.viewConsumed(iexecWrapper.hashOrder(requestOrder))).to.equal(volume);
193193
expect(await iexecPoco.viewConsumed(iexecWrapper.hashOrder(workerpoolOrder1))).to.equal(
194194
dealVolume1,
195195
);
@@ -206,7 +206,7 @@ describe('Integration tests', function () {
206206
schedulerReward: number,
207207
workerReward: number,
208208
) {
209-
// Save frozens.
209+
// Save frozens before task execution.
210210
const accounts = [requester, scheduler, appProvider, datasetProvider, worker1];
211211
const accountsInitialFrozens = await iexecWrapper.getInitialFrozens(accounts);
212212
// Run task.

0 commit comments

Comments
 (0)