@cardano-sdk/e2e 0.17.0 → 0.17.2-patch.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cardano-sdk/e2e",
|
|
3
|
-
"version": "0.17.0",
|
|
3
|
+
"version": "0.17.2-patch.0",
|
|
4
4
|
"description": "End to end tests for the cardano-js-sdk packages.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16.0"
|
|
@@ -81,19 +81,19 @@
|
|
|
81
81
|
"dependencies": {
|
|
82
82
|
"@cardano-foundation/ledgerjs-hw-app-cardano": "^6.0.0",
|
|
83
83
|
"@cardano-ogmios/client": "5.6.0",
|
|
84
|
-
"@cardano-sdk/cardano-services": "~0.14.
|
|
85
|
-
"@cardano-sdk/cardano-services-client": "~0.10.
|
|
86
|
-
"@cardano-sdk/core": "~0.15.
|
|
84
|
+
"@cardano-sdk/cardano-services": "~0.14.8",
|
|
85
|
+
"@cardano-sdk/cardano-services-client": "~0.10.6",
|
|
86
|
+
"@cardano-sdk/core": "~0.15.4",
|
|
87
87
|
"@cardano-sdk/crypto": "~0.1.9",
|
|
88
|
-
"@cardano-sdk/hardware-ledger": "~0.2.
|
|
89
|
-
"@cardano-sdk/input-selection": "~0.11.
|
|
90
|
-
"@cardano-sdk/key-management": "~0.8.
|
|
91
|
-
"@cardano-sdk/ogmios": "~0.12.
|
|
92
|
-
"@cardano-sdk/tx-construction": "~0.9.
|
|
88
|
+
"@cardano-sdk/hardware-ledger": "~0.2.17",
|
|
89
|
+
"@cardano-sdk/input-selection": "~0.11.4",
|
|
90
|
+
"@cardano-sdk/key-management": "~0.8.2",
|
|
91
|
+
"@cardano-sdk/ogmios": "~0.12.13",
|
|
92
|
+
"@cardano-sdk/tx-construction": "~0.9.4",
|
|
93
93
|
"@cardano-sdk/util": "~0.13.0",
|
|
94
|
-
"@cardano-sdk/util-dev": "~0.13.
|
|
95
|
-
"@cardano-sdk/util-rxjs": "~0.5.
|
|
96
|
-
"@cardano-sdk/wallet": "~0.18.
|
|
94
|
+
"@cardano-sdk/util-dev": "~0.13.9",
|
|
95
|
+
"@cardano-sdk/util-rxjs": "~0.5.5",
|
|
96
|
+
"@cardano-sdk/wallet": "~0.18.6-patch.0",
|
|
97
97
|
"@vespaiach/axios-fetch-adapter": "^0.3.0",
|
|
98
98
|
"axios": "^0.27.2",
|
|
99
99
|
"bunyan": "^1.8.15",
|
|
@@ -122,10 +122,10 @@
|
|
|
122
122
|
"@babel/core": "^7.18.2",
|
|
123
123
|
"@babel/preset-env": "^7.18.2",
|
|
124
124
|
"@babel/preset-typescript": "^7.17.12",
|
|
125
|
-
"@cardano-sdk/dapp-connector": "~0.9.
|
|
126
|
-
"@cardano-sdk/projection": "~0.6.
|
|
127
|
-
"@cardano-sdk/projection-typeorm": "~0.3.
|
|
128
|
-
"@cardano-sdk/web-extension": "~0.14.0",
|
|
125
|
+
"@cardano-sdk/dapp-connector": "~0.9.11",
|
|
126
|
+
"@cardano-sdk/projection": "~0.6.17",
|
|
127
|
+
"@cardano-sdk/projection-typeorm": "~0.3.13",
|
|
128
|
+
"@cardano-sdk/web-extension": "~0.14.2-patch.0",
|
|
129
129
|
"@dcspark/cardano-multiplatform-lib-browser": "^3.1.1",
|
|
130
130
|
"@emurgo/cardano-message-signing-asmjs": "^1.0.1",
|
|
131
131
|
"@types/bunyan": "^1.8.8",
|
|
@@ -177,5 +177,5 @@
|
|
|
177
177
|
"webpack-cli": "^4.9.2",
|
|
178
178
|
"webpack-merge": "^5.8.0"
|
|
179
179
|
},
|
|
180
|
-
"gitHead": "
|
|
180
|
+
"gitHead": "4a3952383c68e4c3aaeeab25ae209c53b1cc50eb"
|
|
181
181
|
}
|
|
@@ -378,6 +378,87 @@ describe('StakePoolProvider', () => {
|
|
|
378
378
|
);
|
|
379
379
|
});
|
|
380
380
|
});
|
|
381
|
+
|
|
382
|
+
describe('sort by live saturation', () => {
|
|
383
|
+
let filters: QueryStakePoolsArgs['filters'] = {};
|
|
384
|
+
const poolsId: Cardano.PoolId[] = [];
|
|
385
|
+
|
|
386
|
+
beforeAll(() => {
|
|
387
|
+
for (const pool of pools) if (poolsId.length < 20) poolsId.push(pool.id);
|
|
388
|
+
|
|
389
|
+
filters = { identifier: { values: poolsId.map((id) => ({ id })) } };
|
|
390
|
+
});
|
|
391
|
+
it('ascending sort by live saturation', async () => {
|
|
392
|
+
if (poolsId.length < 2)
|
|
393
|
+
return console.log(
|
|
394
|
+
"test 'ascending sort by live saturation' can't run because no suitable pools were found"
|
|
395
|
+
);
|
|
396
|
+
const { pageResults, totalResultCount } = await query(filters, { field: 'saturation', order: 'asc' });
|
|
397
|
+
|
|
398
|
+
expect(totalResultCount).toBe(poolsId.length);
|
|
399
|
+
expect(pageResults.map((p) => p.metrics!.saturation)).toStrictEqual(
|
|
400
|
+
pools
|
|
401
|
+
.filter(({ id }) => poolsId.includes(id))
|
|
402
|
+
.sort((a, b) => (a.metrics!.saturation < b.metrics!.saturation ? -1 : 1))
|
|
403
|
+
.map((p) => p.metrics?.saturation)
|
|
404
|
+
);
|
|
405
|
+
});
|
|
406
|
+
it('descending sort by live saturation', async () => {
|
|
407
|
+
if (poolsId.length < 2)
|
|
408
|
+
return console.log(
|
|
409
|
+
"test 'descending sort by live saturation' can't run because no suitable pools were found"
|
|
410
|
+
);
|
|
411
|
+
const { pageResults, totalResultCount } = await query(filters, { field: 'saturation', order: 'desc' });
|
|
412
|
+
|
|
413
|
+
expect(totalResultCount).toBe(poolsId.length);
|
|
414
|
+
expect(pageResults.map((p) => p.metrics?.saturation)).toStrictEqual(
|
|
415
|
+
pools
|
|
416
|
+
.filter(({ id }) => poolsId.includes(id))
|
|
417
|
+
.sort((a, b) => (a.metrics!.saturation > b.metrics!.saturation ? -1 : 1))
|
|
418
|
+
.map((p) => p.metrics?.saturation)
|
|
419
|
+
);
|
|
420
|
+
});
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
describe('sort by apy', () => {
|
|
424
|
+
let filters: QueryStakePoolsArgs['filters'] = {};
|
|
425
|
+
const poolsId: Cardano.PoolId[] = [];
|
|
426
|
+
|
|
427
|
+
beforeAll(() => {
|
|
428
|
+
for (const pool of pools) {
|
|
429
|
+
if (poolsId.length < 20 && pool.metrics?.apy !== undefined && pool.metrics?.apy > 0) {
|
|
430
|
+
poolsId.push(pool.id);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
filters = { identifier: { values: poolsId.map((id) => ({ id })) } };
|
|
434
|
+
});
|
|
435
|
+
it('ascending sort by apy', async () => {
|
|
436
|
+
if (poolsId.length < 2)
|
|
437
|
+
return console.log("test 'ascending sort by apy' can't run because no suitable pools were found");
|
|
438
|
+
const { pageResults, totalResultCount } = await query(filters, { field: 'apy', order: 'asc' });
|
|
439
|
+
|
|
440
|
+
expect(totalResultCount).toBe(poolsId.length);
|
|
441
|
+
expect(pageResults.map((p) => p.metrics?.apy)).toStrictEqual(
|
|
442
|
+
pools
|
|
443
|
+
.filter(({ id }) => poolsId.includes(id))
|
|
444
|
+
.sort((a, b) => (a.metrics!.apy! < b.metrics!.apy! ? -1 : 1))
|
|
445
|
+
.map((p) => p.metrics?.apy)
|
|
446
|
+
);
|
|
447
|
+
});
|
|
448
|
+
it('descending sort by apy', async () => {
|
|
449
|
+
if (poolsId.length < 2)
|
|
450
|
+
return console.log("test 'descending sort by apy' can't run because no suitable pools were found");
|
|
451
|
+
const { pageResults, totalResultCount } = await query(filters, { field: 'apy', order: 'desc' });
|
|
452
|
+
|
|
453
|
+
expect(totalResultCount).toBe(poolsId.length);
|
|
454
|
+
expect(pageResults.map((p) => p.metrics?.apy)).toStrictEqual(
|
|
455
|
+
pools
|
|
456
|
+
.filter(({ id }) => poolsId.includes(id))
|
|
457
|
+
.sort((a, b) => (a.metrics!.apy! > b.metrics!.apy! ? -1 : 1))
|
|
458
|
+
.map((p) => p.metrics?.apy)
|
|
459
|
+
);
|
|
460
|
+
});
|
|
461
|
+
});
|
|
381
462
|
});
|
|
382
463
|
});
|
|
383
464
|
});
|