@indigo-labs/indigo-sdk 0.4.4 → 0.5.1

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.
Files changed (51) hide show
  1. package/dist/index.d.mts +121 -40
  2. package/dist/index.d.ts +121 -40
  3. package/dist/index.js +962 -818
  4. package/dist/index.mjs +418 -282
  5. package/package.json +2 -2
  6. package/scripts/run-repeat.sh +22 -0
  7. package/src/contracts/cdp/helpers.ts +7 -6
  8. package/src/contracts/cdp/transactions.ts +8 -29
  9. package/src/contracts/gov/transactions.ts +12 -16
  10. package/src/contracts/iasset/helpers.ts +2 -7
  11. package/src/contracts/initialize/actions.ts +0 -2
  12. package/src/contracts/initialize/helpers.ts +0 -4
  13. package/src/contracts/interest-collection/transactions.ts +2 -5
  14. package/src/contracts/interest-oracle/helpers.ts +4 -0
  15. package/src/contracts/interest-oracle/transactions.ts +1 -4
  16. package/src/contracts/price-oracle/helpers.ts +5 -11
  17. package/src/contracts/price-oracle/transactions.ts +2 -7
  18. package/src/contracts/rob/transactions.ts +0 -2
  19. package/src/contracts/rob-leverage/transactions.ts +1 -4
  20. package/src/contracts/stability-pool/transactions.ts +2 -8
  21. package/src/contracts/stableswap/helpers.ts +487 -2
  22. package/src/contracts/stableswap/transactions.ts +53 -222
  23. package/src/contracts/staking/transactions.ts +2 -7
  24. package/tests/cdp/actions.ts +0 -11
  25. package/tests/cdp/cdp-helpers.ts +2 -2
  26. package/tests/cdp/cdp-queries.ts +1 -3
  27. package/tests/cdp/cdp.test.ts +407 -619
  28. package/tests/cdp/transactions-mutated.ts +30 -25
  29. package/tests/endpoints/initialize.ts +0 -2
  30. package/tests/gov/actions.ts +7 -32
  31. package/tests/gov/gov.test.ts +169 -401
  32. package/tests/indigo-test-helpers.ts +2 -3
  33. package/tests/initialize.test.ts +15 -20
  34. package/tests/interest-collection/interest-collection.test.ts +0 -4
  35. package/tests/interest-oracle.test.ts +1 -8
  36. package/tests/price-oracle/actions.ts +6 -8
  37. package/tests/price-oracle/price-oracle.test.ts +1 -13
  38. package/tests/price-oracle/transactions-mutated.ts +1 -4
  39. package/tests/pyth/pyth-indigo.test.ts +8 -12
  40. package/tests/pyth/pyth.test.ts +1 -2
  41. package/tests/rob/actions.ts +0 -2
  42. package/tests/rob/rob-leverage.test.ts +164 -220
  43. package/tests/rob/rob.test.ts +158 -263
  44. package/tests/rob/transactions-mutated.ts +7 -18
  45. package/tests/stability-pool/actions.ts +4 -8
  46. package/tests/stability-pool.test.ts +164 -255
  47. package/tests/stableswap/stableswap-actions.ts +0 -1
  48. package/tests/stableswap/stableswap-queries.ts +26 -17
  49. package/tests/stableswap/stableswap.test.ts +338 -4
  50. package/tests/staking.test.ts +2 -13
  51. package/tests/treasury/treasury.test.ts +6 -30
@@ -151,11 +151,9 @@ describe('CDP', () => {
151
151
  test<MyContext>('Open CDP; ADA collateral', async (context: MyContext) => {
152
152
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
153
153
 
154
- const [sysParams, [iusdAssetInfo]] = await init(
155
- context.lucid,
156
- [iusdInitialAssetCfg()],
157
- context.emulator.slot,
158
- );
154
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
155
+ iusdInitialAssetCfg(),
156
+ ]);
159
157
 
160
158
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
161
159
 
@@ -200,19 +198,17 @@ describe('CDP', () => {
200
198
  'Unexpected value received by the treasury',
201
199
  );
202
200
 
203
- assertValueInRange(
204
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
205
- { min: 199, max: 200 },
206
- );
201
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
202
+ min: 199,
203
+ max: 200,
204
+ });
207
205
  });
208
206
  test<MyContext>('Open CDP; ADA collateral - direct treasury payment', async (context: MyContext) => {
209
207
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
210
208
 
211
- const [sysParams, [iusdAssetInfo]] = await init(
212
- context.lucid,
213
- [iusdInitialAssetCfg()],
214
- context.emulator.slot,
215
- );
209
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
210
+ iusdInitialAssetCfg(),
211
+ ]);
216
212
 
217
213
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
218
214
 
@@ -259,24 +255,20 @@ describe('CDP', () => {
259
255
  'Unexpected value received by the treasury',
260
256
  );
261
257
 
262
- assertValueInRange(
263
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
264
- { min: 199, max: 200 },
265
- );
258
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
259
+ min: 199,
260
+ max: 200,
261
+ });
266
262
  });
267
263
  test<MyContext>('Open CDP; non-ADA collateral asset', async (context: MyContext) => {
268
264
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
269
265
 
270
- const [sysParams, [iusdAssetInfo]] = await init(
271
- context.lucid,
272
- [
273
- {
274
- ...iusdInitialAssetCfg(),
275
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
276
- },
277
- ],
278
- context.emulator.slot,
279
- );
266
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
267
+ {
268
+ ...iusdInitialAssetCfg(),
269
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
270
+ },
271
+ ]);
280
272
 
281
273
  const [_, addedValueInTreasury] = await getValueChangeAtAddressAfterAction(
282
274
  context.lucid,
@@ -319,25 +311,21 @@ describe('CDP', () => {
319
311
  'Unexpected value received by the treasury',
320
312
  );
321
313
 
322
- assertValueInRange(
323
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
324
- { min: 199, max: 200 },
325
- );
314
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
315
+ min: 199,
316
+ max: 200,
317
+ });
326
318
  });
327
319
 
328
320
  test<MyContext>('Open CDP; non-ADA collateral asset - direct treasury payment', async (context: MyContext) => {
329
321
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
330
322
 
331
- const [sysParams, [iusdAssetInfo]] = await init(
332
- context.lucid,
333
- [
334
- {
335
- ...iusdInitialAssetCfg(),
336
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
337
- },
338
- ],
339
- context.emulator.slot,
340
- );
323
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
324
+ {
325
+ ...iusdInitialAssetCfg(),
326
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
327
+ },
328
+ ]);
341
329
 
342
330
  const [_, addedValueInTreasury] = await getValueChangeAtAddressAfterAction(
343
331
  context.lucid,
@@ -382,33 +370,24 @@ describe('CDP', () => {
382
370
  'Unexpected value received by the treasury',
383
371
  );
384
372
 
385
- assertValueInRange(
386
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
387
- { min: 199, max: 200 },
388
- );
373
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
374
+ min: 199,
375
+ max: 200,
376
+ });
389
377
  });
390
378
 
391
379
  // This tests opening a CDP with a collateral asset with 8 decimals, such as xBTC.
392
380
  test<MyContext>('Open CDP; non-ADA collateral asset with more decimals', async (context: MyContext) => {
393
381
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
394
382
 
395
- const [sysParams, _] = await init(
396
- context.lucid,
397
- [
398
- {
399
- ...iusdInitialAssetCfg(),
400
- collateralAssets: [
401
- mkBaseCollateralAsset(
402
- collateralAssetA,
403
- 0n,
404
- rationalFromInt(1n),
405
- 2n,
406
- ),
407
- ],
408
- },
409
- ],
410
- context.emulator.slot,
411
- );
383
+ const [sysParams, _] = await init(context.lucid, [
384
+ {
385
+ ...iusdInitialAssetCfg(),
386
+ collateralAssets: [
387
+ mkBaseCollateralAsset(collateralAssetA, 0n, rationalFromInt(1n), 2n),
388
+ ],
389
+ },
390
+ ]);
412
391
 
413
392
  await runAndAwaitTx(
414
393
  context.lucid,
@@ -429,10 +408,10 @@ describe('CDP', () => {
429
408
  fromSystemParamsAsset(sysParams.cdpParams.cdpAuthToken),
430
409
  );
431
410
 
432
- assertValueInRange(
433
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
434
- { min: 149, max: 151 },
435
- );
411
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
412
+ min: 149,
413
+ max: 151,
414
+ });
436
415
 
437
416
  await expectScriptFailure(
438
417
  'Undercollaterized',
@@ -452,23 +431,14 @@ describe('CDP', () => {
452
431
  test<MyContext>('Open CDP; non-ADA collateral asset with less decimals', async (context: MyContext) => {
453
432
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
454
433
 
455
- const [sysParams, _] = await init(
456
- context.lucid,
457
- [
458
- {
459
- ...iusdInitialAssetCfg(),
460
- collateralAssets: [
461
- mkBaseCollateralAsset(
462
- collateralAssetA,
463
- 0n,
464
- rationalFromInt(1n),
465
- -2n,
466
- ),
467
- ],
468
- },
469
- ],
470
- context.emulator.slot,
471
- );
434
+ const [sysParams, _] = await init(context.lucid, [
435
+ {
436
+ ...iusdInitialAssetCfg(),
437
+ collateralAssets: [
438
+ mkBaseCollateralAsset(collateralAssetA, 0n, rationalFromInt(1n), -2n),
439
+ ],
440
+ },
441
+ ]);
472
442
 
473
443
  await runAndAwaitTx(
474
444
  context.lucid,
@@ -489,10 +459,10 @@ describe('CDP', () => {
489
459
  fromSystemParamsAsset(sysParams.cdpParams.cdpAuthToken),
490
460
  );
491
461
 
492
- assertValueInRange(
493
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
494
- { min: 149, max: 151 },
495
- );
462
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
463
+ min: 149,
464
+ max: 151,
465
+ });
496
466
 
497
467
  await expectScriptFailure(
498
468
  'Undercollaterized',
@@ -511,11 +481,9 @@ describe('CDP', () => {
511
481
  test<IndigoTestContext>('Open CDP with large rational price oracle', async (context: IndigoTestContext) => {
512
482
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
513
483
 
514
- const [sysParams, [iusdAssetInfo]] = await init(
515
- context.lucid,
516
- [iusdInitialAssetCfg()],
517
- context.emulator.slot,
518
- );
484
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
485
+ iusdInitialAssetCfg(),
486
+ ]);
519
487
 
520
488
  const orefs = await findAllNecessaryOrefs(
521
489
  context.lucid,
@@ -539,7 +507,6 @@ describe('CDP', () => {
539
507
  priceOracleUtxo!,
540
508
  { numerator: largeBigInt, denominator: largeBigInt },
541
509
  iusdAssetInfo.collateralAssets[0].oracleParams!,
542
- context.emulator.slot,
543
510
  ),
544
511
  );
545
512
 
@@ -563,11 +530,9 @@ describe('CDP', () => {
563
530
  test<IndigoTestContext>('Open CDP with large auxilary data oracle', async (context: IndigoTestContext) => {
564
531
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
565
532
 
566
- const [sysParams, [iusdAssetInfo]] = await init(
567
- context.lucid,
568
- [iusdInitialAssetCfg()],
569
- context.emulator.slot,
570
- );
533
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
534
+ iusdInitialAssetCfg(),
535
+ ]);
571
536
 
572
537
  const orefs = await findAllNecessaryOrefs(
573
538
  context.lucid,
@@ -592,7 +557,7 @@ describe('CDP', () => {
592
557
  priceOracleUtxo!,
593
558
  { numerator: 1n, denominator: 1n },
594
559
  iusdAssetInfo.collateralAssets[0].oracleParams!,
595
- context.emulator.slot,
560
+
596
561
  Core.Data.fromCBORHex(
597
562
  Data.to(Data.fromJson(oneKbBuf.toString('ascii'))),
598
563
  ),
@@ -619,11 +584,9 @@ describe('CDP', () => {
619
584
  test<IndigoTestContext>('Open CDP with expired oracle fails', async (context: IndigoTestContext) => {
620
585
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
621
586
 
622
- const [sysParams, [iusdAssetInfo]] = await init(
623
- context.lucid,
624
- [iusdInitialAssetCfg()],
625
- context.emulator.slot,
626
- );
587
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
588
+ iusdInitialAssetCfg(),
589
+ ]);
627
590
 
628
591
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
629
592
 
@@ -649,16 +612,12 @@ describe('CDP', () => {
649
612
  test<IndigoTestContext>('Open CDP with delisted iAsset fails', async (context: IndigoTestContext) => {
650
613
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
651
614
 
652
- const [sysParams, [iUsdInfo]] = await init(
653
- context.lucid,
654
- [
655
- {
656
- ...iusdInitialAssetCfg(),
657
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
658
- },
659
- ],
660
- context.emulator.slot,
661
- );
615
+ const [sysParams, [iUsdInfo]] = await init(context.lucid, [
616
+ {
617
+ ...iusdInitialAssetCfg(),
618
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
619
+ },
620
+ ]);
662
621
 
663
622
  const govUtxo = await findGov(
664
623
  context.lucid,
@@ -695,7 +654,6 @@ describe('CDP', () => {
695
654
  null,
696
655
  sysParams,
697
656
  context.lucid,
698
- context.emulator.slot,
699
657
  govUtxo.utxo,
700
658
  [],
701
659
  );
@@ -732,11 +690,9 @@ describe('CDP', () => {
732
690
  test<MyContext>('Open CDP with hybrid oracle', async (context: MyContext) => {
733
691
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
734
692
 
735
- const [sysParams, [iusdAssetInfo]] = await init(
736
- context.lucid,
737
- [iusdInitialAssetCfg()],
738
- context.emulator.slot,
739
- );
693
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
694
+ iusdInitialAssetCfg(),
695
+ ]);
740
696
 
741
697
  const [_, addedValueInTreasury] = await getValueChangeAtAddressAfterAction(
742
698
  context.lucid,
@@ -781,20 +737,16 @@ describe('CDP', () => {
781
737
  'Unexpected value received by the treasury',
782
738
  );
783
739
 
784
- assertValueInRange(
785
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
786
- { min: 199, max: 200 },
787
- );
740
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
741
+ min: 199,
742
+ max: 200,
743
+ });
788
744
  });
789
745
 
790
746
  test<MyContext>('Deposit CDP; ADA collateral', async (context: MyContext) => {
791
747
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
792
748
 
793
- const [sysParams, _] = await init(
794
- context.lucid,
795
- [iusdInitialAssetCfg()],
796
- context.emulator.slot,
797
- );
749
+ const [sysParams, _] = await init(context.lucid, [iusdInitialAssetCfg()]);
798
750
 
799
751
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
800
752
  await runAndAwaitTx(
@@ -820,16 +772,12 @@ describe('CDP', () => {
820
772
  test<MyContext>('Deposit CDP; non-ADA collateral', async (context: MyContext) => {
821
773
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
822
774
 
823
- const [sysParams, _] = await init(
824
- context.lucid,
825
- [
826
- {
827
- ...iusdInitialAssetCfg(),
828
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
829
- },
830
- ],
831
- context.emulator.slot,
832
- );
775
+ const [sysParams, _] = await init(context.lucid, [
776
+ {
777
+ ...iusdInitialAssetCfg(),
778
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
779
+ },
780
+ ]);
833
781
 
834
782
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
835
783
  await runAndAwaitTx(
@@ -855,11 +803,9 @@ describe('CDP', () => {
855
803
  test<IndigoTestContext>('Deposit CDP w/ interest; ADA collateral', async (context: IndigoTestContext) => {
856
804
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
857
805
 
858
- const [sysParams, [iusdAssetInfo]] = await init(
859
- context.lucid,
860
- [iusdInitialAssetCfg()],
861
- context.emulator.slot,
862
- );
806
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
807
+ iusdInitialAssetCfg(),
808
+ ]);
863
809
 
864
810
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
865
811
  const [pkh, skh] = await addrDetails(context.lucid);
@@ -951,16 +897,12 @@ describe('CDP', () => {
951
897
  test<MyContext>('Deposit CDP w/ interest; non-ADA collateral', async (context: MyContext) => {
952
898
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
953
899
 
954
- const [sysParams, [iusdAssetInfo]] = await init(
955
- context.lucid,
956
- [
957
- {
958
- ...iusdInitialAssetCfg(),
959
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
960
- },
961
- ],
962
- context.emulator.slot,
963
- );
900
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
901
+ {
902
+ ...iusdInitialAssetCfg(),
903
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
904
+ },
905
+ ]);
964
906
 
965
907
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
966
908
  const [pkh, skh] = await addrDetails(context.lucid);
@@ -1053,11 +995,9 @@ describe('CDP', () => {
1053
995
  test<IndigoTestContext>('Deposit CDP with expired oracle succeeds', async (context: IndigoTestContext) => {
1054
996
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
1055
997
 
1056
- const [sysParams, [iusdAssetInfo]] = await init(
1057
- context.lucid,
1058
- [iusdInitialAssetCfg()],
1059
- context.emulator.slot,
1060
- );
998
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
999
+ iusdInitialAssetCfg(),
1000
+ ]);
1061
1001
 
1062
1002
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
1063
1003
  await runAndAwaitTx(
@@ -1087,16 +1027,12 @@ describe('CDP', () => {
1087
1027
  test<IndigoTestContext>('Deposit CDP with delisted iAsset fails', async (context: IndigoTestContext) => {
1088
1028
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
1089
1029
 
1090
- const [sysParams, [iUsdInfo]] = await init(
1091
- context.lucid,
1092
- [
1093
- {
1094
- ...iusdInitialAssetCfg(),
1095
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
1096
- },
1097
- ],
1098
- context.emulator.slot,
1099
- );
1030
+ const [sysParams, [iUsdInfo]] = await init(context.lucid, [
1031
+ {
1032
+ ...iusdInitialAssetCfg(),
1033
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
1034
+ },
1035
+ ]);
1100
1036
 
1101
1037
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
1102
1038
  await runAndAwaitTx(
@@ -1146,7 +1082,7 @@ describe('CDP', () => {
1146
1082
  null,
1147
1083
  sysParams,
1148
1084
  context.lucid,
1149
- context.emulator.slot,
1085
+
1150
1086
  govUtxo.utxo,
1151
1087
  [],
1152
1088
  );
@@ -1182,11 +1118,7 @@ describe('CDP', () => {
1182
1118
 
1183
1119
  test<MyContext>('Withdraw CDP; ADA collateral', async (context: MyContext) => {
1184
1120
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
1185
- const [sysParams, _] = await init(
1186
- context.lucid,
1187
- [iusdInitialAssetCfg()],
1188
- context.emulator.slot,
1189
- );
1121
+ const [sysParams, _] = await init(context.lucid, [iusdInitialAssetCfg()]);
1190
1122
 
1191
1123
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
1192
1124
  await runAndAwaitTx(
@@ -1211,16 +1143,12 @@ describe('CDP', () => {
1211
1143
 
1212
1144
  test<MyContext>('Withdraw CDP; non-ADA collateral', async (context: MyContext) => {
1213
1145
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
1214
- const [sysParams, _] = await init(
1215
- context.lucid,
1216
- [
1217
- {
1218
- ...iusdInitialAssetCfg(),
1219
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
1220
- },
1221
- ],
1222
- context.emulator.slot,
1223
- );
1146
+ const [sysParams, _] = await init(context.lucid, [
1147
+ {
1148
+ ...iusdInitialAssetCfg(),
1149
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
1150
+ },
1151
+ ]);
1224
1152
 
1225
1153
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
1226
1154
  await runAndAwaitTx(
@@ -1246,11 +1174,9 @@ describe('CDP', () => {
1246
1174
  test<IndigoTestContext>('Withdraw CDP w/ interest; ADA collateral', async (context: IndigoTestContext) => {
1247
1175
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
1248
1176
 
1249
- const [sysParams, [iusdAssetInfo]] = await init(
1250
- context.lucid,
1251
- [iusdInitialAssetCfg()],
1252
- context.emulator.slot,
1253
- );
1177
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
1178
+ iusdInitialAssetCfg(),
1179
+ ]);
1254
1180
 
1255
1181
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
1256
1182
  const iasset = 'iUSD';
@@ -1339,16 +1265,12 @@ describe('CDP', () => {
1339
1265
 
1340
1266
  test<MyContext>('Withdraw CDP w/ interest; non-ADA collateral', async (context: MyContext) => {
1341
1267
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
1342
- const [sysParams, [iusdAssetInfo]] = await init(
1343
- context.lucid,
1344
- [
1345
- {
1346
- ...iusdInitialAssetCfg(),
1347
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
1348
- },
1349
- ],
1350
- context.emulator.slot,
1351
- );
1268
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
1269
+ {
1270
+ ...iusdInitialAssetCfg(),
1271
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
1272
+ },
1273
+ ]);
1352
1274
 
1353
1275
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
1354
1276
  const iasset = 'iUSD';
@@ -1437,11 +1359,9 @@ describe('CDP', () => {
1437
1359
 
1438
1360
  test<IndigoTestContext>('Withdraw CDP with expired oracle fails', async (context: IndigoTestContext) => {
1439
1361
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
1440
- const [sysParams, [iusdAssetInfo]] = await init(
1441
- context.lucid,
1442
- [iusdInitialAssetCfg()],
1443
- context.emulator.slot,
1444
- );
1362
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
1363
+ iusdInitialAssetCfg(),
1364
+ ]);
1445
1365
 
1446
1366
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
1447
1367
  await runAndAwaitTx(
@@ -1471,16 +1391,12 @@ describe('CDP', () => {
1471
1391
  test<IndigoTestContext>('Withdraw from CDP with delisted iAsset succeeds', async (context: IndigoTestContext) => {
1472
1392
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
1473
1393
 
1474
- const [sysParams, [iUsdInfo]] = await init(
1475
- context.lucid,
1476
- [
1477
- {
1478
- ...iusdInitialAssetCfg(),
1479
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
1480
- },
1481
- ],
1482
- context.emulator.slot,
1483
- );
1394
+ const [sysParams, [iUsdInfo]] = await init(context.lucid, [
1395
+ {
1396
+ ...iusdInitialAssetCfg(),
1397
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
1398
+ },
1399
+ ]);
1484
1400
 
1485
1401
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
1486
1402
  await runAndAwaitTx(
@@ -1530,7 +1446,7 @@ describe('CDP', () => {
1530
1446
  null,
1531
1447
  sysParams,
1532
1448
  context.lucid,
1533
- context.emulator.slot,
1449
+
1534
1450
  govUtxo.utxo,
1535
1451
  [],
1536
1452
  );
@@ -1559,11 +1475,7 @@ describe('CDP', () => {
1559
1475
 
1560
1476
  test<MyContext>('Mint CDP; ADA collateral', async (context: MyContext) => {
1561
1477
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
1562
- const [sysParams, _] = await init(
1563
- context.lucid,
1564
- [iusdInitialAssetCfg()],
1565
- context.emulator.slot,
1566
- );
1478
+ const [sysParams, _] = await init(context.lucid, [iusdInitialAssetCfg()]);
1567
1479
 
1568
1480
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
1569
1481
  await runAndAwaitTx(
@@ -1588,16 +1500,12 @@ describe('CDP', () => {
1588
1500
 
1589
1501
  test<MyContext>('Mint CDP; non-ADA collateral', async (context: MyContext) => {
1590
1502
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
1591
- const [sysParams, _] = await init(
1592
- context.lucid,
1593
- [
1594
- {
1595
- ...iusdInitialAssetCfg(),
1596
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
1597
- },
1598
- ],
1599
- context.emulator.slot,
1600
- );
1503
+ const [sysParams, _] = await init(context.lucid, [
1504
+ {
1505
+ ...iusdInitialAssetCfg(),
1506
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
1507
+ },
1508
+ ]);
1601
1509
 
1602
1510
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
1603
1511
  await runAndAwaitTx(
@@ -1623,11 +1531,9 @@ describe('CDP', () => {
1623
1531
  test<IndigoTestContext>('Mint CDP w/ interest; ADA collateral', async (context: IndigoTestContext) => {
1624
1532
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
1625
1533
 
1626
- const [sysParams, [iusdAssetInfo]] = await init(
1627
- context.lucid,
1628
- [iusdInitialAssetCfg()],
1629
- context.emulator.slot,
1630
- );
1534
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
1535
+ iusdInitialAssetCfg(),
1536
+ ]);
1631
1537
 
1632
1538
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
1633
1539
  const iasset = 'iUSD';
@@ -1744,11 +1650,9 @@ describe('CDP', () => {
1744
1650
  test<IndigoTestContext>('Mint CDP w/ interest; ADA collateral - direct treasury payment', async (context: IndigoTestContext) => {
1745
1651
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
1746
1652
 
1747
- const [sysParams, [iusdAssetInfo]] = await init(
1748
- context.lucid,
1749
- [iusdInitialAssetCfg()],
1750
- context.emulator.slot,
1751
- );
1653
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
1654
+ iusdInitialAssetCfg(),
1655
+ ]);
1752
1656
 
1753
1657
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
1754
1658
  const iasset = 'iUSD';
@@ -1866,16 +1770,12 @@ describe('CDP', () => {
1866
1770
 
1867
1771
  test<MyContext>('Mint CDP w/ interest; non-ADA collateral', async (context: MyContext) => {
1868
1772
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
1869
- const [sysParams, [iusdAssetInfo]] = await init(
1870
- context.lucid,
1871
- [
1872
- {
1873
- ...iusdInitialAssetCfg(),
1874
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
1875
- },
1876
- ],
1877
- context.emulator.slot,
1878
- );
1773
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
1774
+ {
1775
+ ...iusdInitialAssetCfg(),
1776
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
1777
+ },
1778
+ ]);
1879
1779
 
1880
1780
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
1881
1781
  const iasset = 'iUSD';
@@ -1993,16 +1893,12 @@ describe('CDP', () => {
1993
1893
 
1994
1894
  test<MyContext>('Mint CDP w/ interest; non-ADA collateral - direct treasury payment', async (context: MyContext) => {
1995
1895
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
1996
- const [sysParams, [iusdAssetInfo]] = await init(
1997
- context.lucid,
1998
- [
1999
- {
2000
- ...iusdInitialAssetCfg(),
2001
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
2002
- },
2003
- ],
2004
- context.emulator.slot,
2005
- );
1896
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
1897
+ {
1898
+ ...iusdInitialAssetCfg(),
1899
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
1900
+ },
1901
+ ]);
2006
1902
 
2007
1903
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
2008
1904
  const iasset = 'iUSD';
@@ -2122,11 +2018,9 @@ describe('CDP', () => {
2122
2018
 
2123
2019
  test<IndigoTestContext>('Mint CDP with expired oracle fails', async (context: IndigoTestContext) => {
2124
2020
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
2125
- const [sysParams, [iusdAssetInfo]] = await init(
2126
- context.lucid,
2127
- [iusdInitialAssetCfg()],
2128
- context.emulator.slot,
2129
- );
2021
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
2022
+ iusdInitialAssetCfg(),
2023
+ ]);
2130
2024
 
2131
2025
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
2132
2026
  await runAndAwaitTx(
@@ -2155,16 +2049,12 @@ describe('CDP', () => {
2155
2049
 
2156
2050
  test<IndigoTestContext>('Mint CDP with delisted iAsset fails', async (context: IndigoTestContext) => {
2157
2051
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
2158
- const [sysParams, [iUsdInfo]] = await init(
2159
- context.lucid,
2160
- [
2161
- {
2162
- ...iusdInitialAssetCfg(),
2163
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
2164
- },
2165
- ],
2166
- context.emulator.slot,
2167
- );
2052
+ const [sysParams, [iUsdInfo]] = await init(context.lucid, [
2053
+ {
2054
+ ...iusdInitialAssetCfg(),
2055
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
2056
+ },
2057
+ ]);
2168
2058
 
2169
2059
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
2170
2060
  await runAndAwaitTx(
@@ -2214,7 +2104,7 @@ describe('CDP', () => {
2214
2104
  null,
2215
2105
  sysParams,
2216
2106
  context.lucid,
2217
- context.emulator.slot,
2107
+
2218
2108
  govUtxo.utxo,
2219
2109
  [],
2220
2110
  );
@@ -2251,11 +2141,7 @@ describe('CDP', () => {
2251
2141
  test<MyContext>('Burn CDP; ADA collateral', async (context: MyContext) => {
2252
2142
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
2253
2143
 
2254
- const [sysParams, _] = await init(
2255
- context.lucid,
2256
- [iusdInitialAssetCfg()],
2257
- context.emulator.slot,
2258
- );
2144
+ const [sysParams, _] = await init(context.lucid, [iusdInitialAssetCfg()]);
2259
2145
 
2260
2146
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
2261
2147
  await runAndAwaitTx(
@@ -2281,16 +2167,12 @@ describe('CDP', () => {
2281
2167
  test<MyContext>('Burn CDP; non ADA collateral', async (context: MyContext) => {
2282
2168
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
2283
2169
 
2284
- const [sysParams, _] = await init(
2285
- context.lucid,
2286
- [
2287
- {
2288
- ...iusdInitialAssetCfg(),
2289
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
2290
- },
2291
- ],
2292
- context.emulator.slot,
2293
- );
2170
+ const [sysParams, _] = await init(context.lucid, [
2171
+ {
2172
+ ...iusdInitialAssetCfg(),
2173
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
2174
+ },
2175
+ ]);
2294
2176
 
2295
2177
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
2296
2178
  await runAndAwaitTx(
@@ -2316,11 +2198,9 @@ describe('CDP', () => {
2316
2198
  test<IndigoTestContext>('Burn CDP w/ interest; ADA collateral', async (context: IndigoTestContext) => {
2317
2199
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
2318
2200
 
2319
- const [sysParams, [iusdAssetInfo]] = await init(
2320
- context.lucid,
2321
- [iusdInitialAssetCfg()],
2322
- context.emulator.slot,
2323
- );
2201
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
2202
+ iusdInitialAssetCfg(),
2203
+ ]);
2324
2204
 
2325
2205
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
2326
2206
  const iasset = 'iUSD';
@@ -2410,16 +2290,12 @@ describe('CDP', () => {
2410
2290
  test<MyContext>('Burn CDP w/ interest; non-ADA collateral', async (context: MyContext) => {
2411
2291
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
2412
2292
 
2413
- const [sysParams, [iusdAssetInfo]] = await init(
2414
- context.lucid,
2415
- [
2416
- {
2417
- ...iusdInitialAssetCfg(),
2418
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
2419
- },
2420
- ],
2421
- context.emulator.slot,
2422
- );
2293
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
2294
+ {
2295
+ ...iusdInitialAssetCfg(),
2296
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
2297
+ },
2298
+ ]);
2423
2299
 
2424
2300
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
2425
2301
  const iasset = 'iUSD';
@@ -2511,11 +2387,9 @@ describe('CDP', () => {
2511
2387
  test<IndigoTestContext>('Burn CDP with expired oracle succeeds', async (context: IndigoTestContext) => {
2512
2388
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
2513
2389
 
2514
- const [sysParams, [iusdAssetInfo]] = await init(
2515
- context.lucid,
2516
- [iusdInitialAssetCfg()],
2517
- context.emulator.slot,
2518
- );
2390
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
2391
+ iusdInitialAssetCfg(),
2392
+ ]);
2519
2393
 
2520
2394
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
2521
2395
  await runAndAwaitTx(
@@ -2545,16 +2419,12 @@ describe('CDP', () => {
2545
2419
  test<IndigoTestContext>('Burn delisted iAsset succeeds', async (context: IndigoTestContext) => {
2546
2420
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
2547
2421
 
2548
- const [sysParams, [iUsdInfo]] = await init(
2549
- context.lucid,
2550
- [
2551
- {
2552
- ...iusdInitialAssetCfg(),
2553
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
2554
- },
2555
- ],
2556
- context.emulator.slot,
2557
- );
2422
+ const [sysParams, [iUsdInfo]] = await init(context.lucid, [
2423
+ {
2424
+ ...iusdInitialAssetCfg(),
2425
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
2426
+ },
2427
+ ]);
2558
2428
 
2559
2429
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
2560
2430
  await runAndAwaitTx(
@@ -2604,7 +2474,7 @@ describe('CDP', () => {
2604
2474
  null,
2605
2475
  sysParams,
2606
2476
  context.lucid,
2607
- context.emulator.slot,
2477
+
2608
2478
  govUtxo.utxo,
2609
2479
  [],
2610
2480
  );
@@ -2634,11 +2504,9 @@ describe('CDP', () => {
2634
2504
  test<MyContext>('Close CDP; ADA collateral', async (context: MyContext) => {
2635
2505
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
2636
2506
 
2637
- const [sysParams, [iusdAssetInfo]] = await init(
2638
- context.lucid,
2639
- [iusdInitialAssetCfg()],
2640
- context.emulator.slot,
2641
- );
2507
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
2508
+ iusdInitialAssetCfg(),
2509
+ ]);
2642
2510
 
2643
2511
  // Admin mints some iAsset to send to the user so the user can successfully
2644
2512
  // close the CDP (the user has less iAsset than minted, as some was used to
@@ -2694,16 +2562,12 @@ describe('CDP', () => {
2694
2562
  test<MyContext>('Close CDP; non-ADA collateral', async (context: MyContext) => {
2695
2563
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
2696
2564
 
2697
- const [sysParams, [iusdAssetInfo]] = await init(
2698
- context.lucid,
2699
- [
2700
- {
2701
- ...iusdInitialAssetCfg(),
2702
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
2703
- },
2704
- ],
2705
- context.emulator.slot,
2706
- );
2565
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
2566
+ {
2567
+ ...iusdInitialAssetCfg(),
2568
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
2569
+ },
2570
+ ]);
2707
2571
 
2708
2572
  // Admin mints some iAsset to send to the user so the user can successfully
2709
2573
  // close the CDP (the user has less iAsset than minted, as some was used to
@@ -2759,11 +2623,9 @@ describe('CDP', () => {
2759
2623
  test<IndigoTestContext>('Close CDP w/ interest, ADA collateral', async (context: IndigoTestContext) => {
2760
2624
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
2761
2625
 
2762
- const [sysParams, [iusdAssetInfo]] = await init(
2763
- context.lucid,
2764
- [iusdInitialAssetCfg()],
2765
- context.emulator.slot,
2766
- );
2626
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
2627
+ iusdInitialAssetCfg(),
2628
+ ]);
2767
2629
 
2768
2630
  await runAndAwaitTx(
2769
2631
  context.lucid,
@@ -2859,16 +2721,12 @@ describe('CDP', () => {
2859
2721
  test<MyContext>('Close CDP w/ interest; non-ADA collateral', async (context: MyContext) => {
2860
2722
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
2861
2723
 
2862
- const [sysParams, [iusdAssetInfo]] = await init(
2863
- context.lucid,
2864
- [
2865
- {
2866
- ...iusdInitialAssetCfg(),
2867
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
2868
- },
2869
- ],
2870
- context.emulator.slot,
2871
- );
2724
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
2725
+ {
2726
+ ...iusdInitialAssetCfg(),
2727
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
2728
+ },
2729
+ ]);
2872
2730
 
2873
2731
  await runAndAwaitTx(
2874
2732
  context.lucid,
@@ -2964,11 +2822,9 @@ describe('CDP', () => {
2964
2822
  test<IndigoTestContext>('Close CDP with expired oracle succeeds', async (context: IndigoTestContext) => {
2965
2823
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
2966
2824
 
2967
- const [sysParams, [iusdAssetInfo]] = await init(
2968
- context.lucid,
2969
- [iusdInitialAssetCfg()],
2970
- context.emulator.slot,
2971
- );
2825
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
2826
+ iusdInitialAssetCfg(),
2827
+ ]);
2972
2828
 
2973
2829
  await runAndAwaitTx(
2974
2830
  context.lucid,
@@ -2976,7 +2832,7 @@ describe('CDP', () => {
2976
2832
  iusdAssetInfo.collateralAssets[0].interestOracleParams,
2977
2833
  0n,
2978
2834
  context.lucid,
2979
- context.emulator.slot,
2835
+
2980
2836
  iusdAssetInfo.collateralAssets[0].interestOracleNft,
2981
2837
  ),
2982
2838
  );
@@ -3039,16 +2895,12 @@ describe('CDP', () => {
3039
2895
  test<IndigoTestContext>('Close CDP with delisted iAsset succeeds', async (context: IndigoTestContext) => {
3040
2896
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
3041
2897
 
3042
- const [sysParams, [iUsdInfo]] = await init(
3043
- context.lucid,
3044
- [
3045
- {
3046
- ...iusdInitialAssetCfg(),
3047
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
3048
- },
3049
- ],
3050
- context.emulator.slot,
3051
- );
2898
+ const [sysParams, [iUsdInfo]] = await init(context.lucid, [
2899
+ {
2900
+ ...iusdInitialAssetCfg(),
2901
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
2902
+ },
2903
+ ]);
3052
2904
 
3053
2905
  await runAndAwaitTx(
3054
2906
  context.lucid,
@@ -3125,7 +2977,7 @@ describe('CDP', () => {
3125
2977
  null,
3126
2978
  sysParams,
3127
2979
  context.lucid,
3128
- context.emulator.slot,
2980
+
3129
2981
  govUtxo.utxo,
3130
2982
  [],
3131
2983
  );
@@ -3156,7 +3008,6 @@ describe('CDP', () => {
3156
3008
  const [sysParams, [iusdAssetInfo, ieurAssetInfo]] = await init(
3157
3009
  context.lucid,
3158
3010
  [iusdInitialAssetCfg(), ieurInitialAssetCfg()],
3159
- context.emulator.slot,
3160
3011
  );
3161
3012
 
3162
3013
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
@@ -3223,7 +3074,7 @@ describe('CDP', () => {
3223
3074
  'C',
3224
3075
  runCloseCdpWrongOracle(
3225
3076
  context.lucid,
3226
- context.emulator.slot,
3077
+
3227
3078
  sysParams,
3228
3079
  'iUSD',
3229
3080
  'iEUR',
@@ -3238,7 +3089,7 @@ describe('CDP', () => {
3238
3089
  const [sysParams, [iusdAssetInfo]] = await init(
3239
3090
  context.lucid,
3240
3091
  [iusdInitialAssetCfg()],
3241
- context.emulator.slot,
3092
+
3242
3093
  () => [],
3243
3094
  {
3244
3095
  cdpRedemptionRequiredSignature: fromHex(
@@ -3253,7 +3104,7 @@ describe('CDP', () => {
3253
3104
  iusdAssetInfo.collateralAssets[0].interestOracleParams,
3254
3105
  0n,
3255
3106
  context.lucid,
3256
- context.emulator.slot,
3107
+
3257
3108
  iusdAssetInfo.collateralAssets[0].interestOracleNft,
3258
3109
  ),
3259
3110
  );
@@ -3319,7 +3170,7 @@ describe('CDP', () => {
3319
3170
  const [sysParams, [iusdAssetInfo]] = await init(
3320
3171
  context.lucid,
3321
3172
  [iusdInitialAssetCfg()],
3322
- context.emulator.slot,
3173
+
3323
3174
  () => [],
3324
3175
  {
3325
3176
  cdpRedemptionRequiredSignature: fromHex(
@@ -3334,7 +3185,7 @@ describe('CDP', () => {
3334
3185
  iusdAssetInfo.collateralAssets[0].interestOracleParams,
3335
3186
  0n,
3336
3187
  context.lucid,
3337
- context.emulator.slot,
3188
+
3338
3189
  iusdAssetInfo.collateralAssets[0].interestOracleNft,
3339
3190
  ),
3340
3191
  );
@@ -3407,7 +3258,7 @@ describe('CDP', () => {
3407
3258
  collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
3408
3259
  },
3409
3260
  ],
3410
- context.emulator.slot,
3261
+
3411
3262
  () => [],
3412
3263
  {
3413
3264
  cdpRedemptionRequiredSignature: fromHex(
@@ -3422,7 +3273,7 @@ describe('CDP', () => {
3422
3273
  iusdAssetInfo.collateralAssets[0].interestOracleParams,
3423
3274
  0n,
3424
3275
  context.lucid,
3425
- context.emulator.slot,
3276
+
3426
3277
  iusdAssetInfo.collateralAssets[0].interestOracleNft,
3427
3278
  ),
3428
3279
  );
@@ -3506,7 +3357,7 @@ describe('CDP', () => {
3506
3357
  collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
3507
3358
  },
3508
3359
  ],
3509
- context.emulator.slot,
3360
+
3510
3361
  () => [],
3511
3362
  {
3512
3363
  cdpRedemptionRequiredSignature: fromHex(
@@ -3521,7 +3372,7 @@ describe('CDP', () => {
3521
3372
  iusdAssetInfo.collateralAssets[0].interestOracleParams,
3522
3373
  0n,
3523
3374
  context.lucid,
3524
- context.emulator.slot,
3375
+
3525
3376
  iusdAssetInfo.collateralAssets[0].interestOracleNft,
3526
3377
  ),
3527
3378
  );
@@ -3614,7 +3465,7 @@ describe('CDP', () => {
3614
3465
  ],
3615
3466
  },
3616
3467
  ],
3617
- context.emulator.slot,
3468
+
3618
3469
  () => [],
3619
3470
  {
3620
3471
  cdpRedemptionRequiredSignature: fromHex(
@@ -3629,7 +3480,7 @@ describe('CDP', () => {
3629
3480
  iusdAssetInfo.collateralAssets[0].interestOracleParams,
3630
3481
  0n,
3631
3482
  context.lucid,
3632
- context.emulator.slot,
3483
+
3633
3484
  iusdAssetInfo.collateralAssets[0].interestOracleNft,
3634
3485
  ),
3635
3486
  );
@@ -3718,7 +3569,7 @@ describe('CDP', () => {
3718
3569
  ],
3719
3570
  },
3720
3571
  ],
3721
- context.emulator.slot,
3572
+
3722
3573
  () => [],
3723
3574
  {
3724
3575
  cdpRedemptionRequiredSignature: fromHex(
@@ -3733,7 +3584,7 @@ describe('CDP', () => {
3733
3584
  iusdAssetInfo.collateralAssets[0].interestOracleParams,
3734
3585
  0n,
3735
3586
  context.lucid,
3736
- context.emulator.slot,
3587
+
3737
3588
  iusdAssetInfo.collateralAssets[0].interestOracleNft,
3738
3589
  ),
3739
3590
  );
@@ -3810,7 +3661,7 @@ describe('CDP', () => {
3810
3661
  const [sysParams, [iusdAssetInfo]] = await init(
3811
3662
  context.lucid,
3812
3663
  [iusdInitialAssetCfg()],
3813
- context.emulator.slot,
3664
+
3814
3665
  () => [],
3815
3666
  {
3816
3667
  cdpRedemptionRequiredSignature: fromHex(
@@ -3825,7 +3676,7 @@ describe('CDP', () => {
3825
3676
  iusdAssetInfo.collateralAssets[0].interestOracleParams,
3826
3677
  0n,
3827
3678
  context.lucid,
3828
- context.emulator.slot,
3679
+
3829
3680
  iusdAssetInfo.collateralAssets[0].interestOracleNft,
3830
3681
  ),
3831
3682
  );
@@ -3906,7 +3757,6 @@ describe('CDP', () => {
3906
3757
  orefs.govUtxo,
3907
3758
  sysParams,
3908
3759
  context.lucid,
3909
- context.emulator.slot,
3910
3760
  ),
3911
3761
  );
3912
3762
  }
@@ -3915,11 +3765,9 @@ describe('CDP', () => {
3915
3765
  test<IndigoTestContext>('Redeem CDP by anyone succeeds when required signer in protocol params is none', async (context: IndigoTestContext) => {
3916
3766
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
3917
3767
 
3918
- const [sysParams, [iusdAssetInfo]] = await init(
3919
- context.lucid,
3920
- [iusdInitialAssetCfg()],
3921
- context.emulator.slot,
3922
- );
3768
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
3769
+ iusdInitialAssetCfg(),
3770
+ ]);
3923
3771
 
3924
3772
  await runAndAwaitTx(
3925
3773
  context.lucid,
@@ -3927,7 +3775,7 @@ describe('CDP', () => {
3927
3775
  iusdAssetInfo.collateralAssets[0].interestOracleParams,
3928
3776
  0n,
3929
3777
  context.lucid,
3930
- context.emulator.slot,
3778
+
3931
3779
  iusdAssetInfo.collateralAssets[0].interestOracleNft,
3932
3780
  ),
3933
3781
  );
@@ -3990,11 +3838,9 @@ describe('CDP', () => {
3990
3838
  test<IndigoTestContext>('Partial redeem CDP by anyone succeeds when required signer in protocol params is none; partial redemption is paid; ADA collateral', async (context: IndigoTestContext) => {
3991
3839
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
3992
3840
 
3993
- const [sysParams, [iusdAssetInfo]] = await init(
3994
- context.lucid,
3995
- [iusdInitialAssetCfg()],
3996
- context.emulator.slot,
3997
- );
3841
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
3842
+ iusdInitialAssetCfg(),
3843
+ ]);
3998
3844
 
3999
3845
  await runAndAwaitTx(
4000
3846
  context.lucid,
@@ -4002,7 +3848,7 @@ describe('CDP', () => {
4002
3848
  iusdAssetInfo.collateralAssets[0].interestOracleParams,
4003
3849
  0n,
4004
3850
  context.lucid,
4005
- context.emulator.slot,
3851
+
4006
3852
  iusdAssetInfo.collateralAssets[0].interestOracleNft,
4007
3853
  ),
4008
3854
  );
@@ -4063,7 +3909,7 @@ describe('CDP', () => {
4063
3909
  ).toBe(2.0);
4064
3910
 
4065
3911
  assertValueInRange(
4066
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
3912
+ await findCdpCR(context.lucid, sysParams, cdp),
4067
3913
 
4068
3914
  { min: 160, max: 161 },
4069
3915
  );
@@ -4113,7 +3959,6 @@ describe('CDP', () => {
4113
3959
  orefs.govUtxo,
4114
3960
  sysParams,
4115
3961
  context.lucid,
4116
- context.emulator.slot,
4117
3962
  ),
4118
3963
  ),
4119
3964
  );
@@ -4160,7 +4005,7 @@ describe('CDP', () => {
4160
4005
 
4161
4006
  // Since partial redemption has happened, the CR is not the redemption ratio.
4162
4007
  assertValueInRange(
4163
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
4008
+ await findCdpCR(context.lucid, sysParams, cdp),
4164
4009
 
4165
4010
  { min: 170, max: 190 },
4166
4011
  );
@@ -4170,16 +4015,12 @@ describe('CDP', () => {
4170
4015
  test<IndigoTestContext>('Partial redeem CDP by anyone succeeds when required signer in protocol params is none; partial redemption is paid; non-ADA collateral', async (context: IndigoTestContext) => {
4171
4016
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
4172
4017
 
4173
- const [sysParams, [iusdAssetInfo]] = await init(
4174
- context.lucid,
4175
- [
4176
- {
4177
- ...iusdInitialAssetCfg(),
4178
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
4179
- },
4180
- ],
4181
- context.emulator.slot,
4182
- );
4018
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
4019
+ {
4020
+ ...iusdInitialAssetCfg(),
4021
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
4022
+ },
4023
+ ]);
4183
4024
 
4184
4025
  await runAndAwaitTx(
4185
4026
  context.lucid,
@@ -4187,7 +4028,7 @@ describe('CDP', () => {
4187
4028
  iusdAssetInfo.collateralAssets[0].interestOracleParams,
4188
4029
  0n,
4189
4030
  context.lucid,
4190
- context.emulator.slot,
4031
+
4191
4032
  iusdAssetInfo.collateralAssets[0].interestOracleNft,
4192
4033
  ),
4193
4034
  );
@@ -4248,7 +4089,7 @@ describe('CDP', () => {
4248
4089
  ).toBe(2.0);
4249
4090
 
4250
4091
  assertValueInRange(
4251
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
4092
+ await findCdpCR(context.lucid, sysParams, cdp),
4252
4093
 
4253
4094
  { min: 160, max: 161 },
4254
4095
  );
@@ -4298,7 +4139,6 @@ describe('CDP', () => {
4298
4139
  orefs.govUtxo,
4299
4140
  sysParams,
4300
4141
  context.lucid,
4301
- context.emulator.slot,
4302
4142
  ),
4303
4143
  ),
4304
4144
  );
@@ -4350,7 +4190,7 @@ describe('CDP', () => {
4350
4190
 
4351
4191
  // Since partial redemption has happened, the CR is not the redemption ratio.
4352
4192
  assertValueInRange(
4353
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
4193
+ await findCdpCR(context.lucid, sysParams, cdp),
4354
4194
 
4355
4195
  { min: 170, max: 190 },
4356
4196
  );
@@ -4363,7 +4203,7 @@ describe('CDP', () => {
4363
4203
  const [sysParams, [iusdAssetInfo]] = await init(
4364
4204
  context.lucid,
4365
4205
  [iusdInitialAssetCfg()],
4366
- context.emulator.slot,
4206
+
4367
4207
  () => [],
4368
4208
  {
4369
4209
  cdpRedemptionRequiredSignature: fromHex(
@@ -4484,7 +4324,7 @@ describe('CDP', () => {
4484
4324
  const [sysParams, [iusdAssetInfo]] = await init(
4485
4325
  context.lucid,
4486
4326
  [iusdInitialAssetCfg()],
4487
- context.emulator.slot,
4327
+
4488
4328
  () => [],
4489
4329
  {
4490
4330
  cdpRedemptionRequiredSignature: fromHex(
@@ -4583,7 +4423,6 @@ describe('CDP', () => {
4583
4423
  orefs.govUtxo,
4584
4424
  sysParams,
4585
4425
  context.lucid,
4586
- context.emulator.slot,
4587
4426
  ),
4588
4427
  ),
4589
4428
  );
@@ -4621,7 +4460,7 @@ describe('CDP', () => {
4621
4460
  const [sysParams, [iusdAssetInfo]] = await init(
4622
4461
  context.lucid,
4623
4462
  [iusdInitialAssetCfg()],
4624
- context.emulator.slot,
4463
+
4625
4464
  () => [],
4626
4465
  {
4627
4466
  cdpRedemptionRequiredSignature: fromHex(
@@ -4666,10 +4505,10 @@ describe('CDP', () => {
4666
4505
  fromSystemParamsAsset(sysParams.cdpParams.cdpAuthToken),
4667
4506
  );
4668
4507
 
4669
- assertValueInRange(
4670
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
4671
- { min: 199, max: 200 },
4672
- );
4508
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
4509
+ min: 199,
4510
+ max: 200,
4511
+ });
4673
4512
 
4674
4513
  const orefs = await findAllNecessaryOrefs(
4675
4514
  context.lucid,
@@ -4691,15 +4530,14 @@ describe('CDP', () => {
4691
4530
  priceOracleUtxo!,
4692
4531
  { numerator: 125n, denominator: 100n },
4693
4532
  iusdAssetInfo.collateralAssets[0].oracleParams!,
4694
- context.emulator.slot,
4695
4533
  ),
4696
4534
  );
4697
4535
 
4698
4536
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
4699
- assertValueInRange(
4700
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
4701
- { min: 159, max: 160 },
4702
- );
4537
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
4538
+ min: 159,
4539
+ max: 160,
4540
+ });
4703
4541
  }
4704
4542
 
4705
4543
  {
@@ -4745,7 +4583,6 @@ describe('CDP', () => {
4745
4583
  orefs.govUtxo,
4746
4584
  sysParams,
4747
4585
  context.lucid,
4748
- context.emulator.slot,
4749
4586
  ),
4750
4587
  );
4751
4588
  }
@@ -4758,10 +4595,10 @@ describe('CDP', () => {
4758
4595
  fromSystemParamsAsset(sysParams.cdpParams.cdpAuthToken),
4759
4596
  );
4760
4597
 
4761
- assertValueInRange(
4762
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
4763
- { min: 199, max: 201 },
4764
- );
4598
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
4599
+ min: 199,
4600
+ max: 201,
4601
+ });
4765
4602
  }
4766
4603
  });
4767
4604
 
@@ -4771,7 +4608,7 @@ describe('CDP', () => {
4771
4608
  const [sysParams, [iusdAssetInfo]] = await init(
4772
4609
  context.lucid,
4773
4610
  [iusdInitialAssetCfg()],
4774
- context.emulator.slot,
4611
+
4775
4612
  () => [],
4776
4613
  {
4777
4614
  cdpRedemptionRequiredSignature: fromHex(
@@ -4816,10 +4653,10 @@ describe('CDP', () => {
4816
4653
  fromSystemParamsAsset(sysParams.cdpParams.cdpAuthToken),
4817
4654
  );
4818
4655
 
4819
- assertValueInRange(
4820
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
4821
- { min: 199, max: 200 },
4822
- );
4656
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
4657
+ min: 199,
4658
+ max: 200,
4659
+ });
4823
4660
 
4824
4661
  const orefs = await findAllNecessaryOrefs(
4825
4662
  context.lucid,
@@ -4841,15 +4678,14 @@ describe('CDP', () => {
4841
4678
  priceOracleUtxo!,
4842
4679
  { numerator: 1_999_990n, denominator: 1_000_000n },
4843
4680
  iusdAssetInfo.collateralAssets[0].oracleParams!,
4844
- context.emulator.slot,
4845
4681
  ),
4846
4682
  );
4847
4683
 
4848
4684
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
4849
- assertValueInRange(
4850
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
4851
- { min: 100, max: 101 },
4852
- );
4685
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
4686
+ min: 100,
4687
+ max: 101,
4688
+ });
4853
4689
  }
4854
4690
 
4855
4691
  {
@@ -4890,7 +4726,6 @@ describe('CDP', () => {
4890
4726
  orefs.govUtxo,
4891
4727
  sysParams,
4892
4728
  context.lucid,
4893
- context.emulator.slot,
4894
4729
  ),
4895
4730
  );
4896
4731
  }
@@ -4902,7 +4737,7 @@ describe('CDP', () => {
4902
4737
  const [sysParams, [iusdAssetInfo]] = await init(
4903
4738
  context.lucid,
4904
4739
  [iusdInitialAssetCfg()],
4905
- context.emulator.slot,
4740
+
4906
4741
  () => [],
4907
4742
  {
4908
4743
  cdpRedemptionRequiredSignature: fromHex(
@@ -4917,7 +4752,7 @@ describe('CDP', () => {
4917
4752
  iusdAssetInfo.collateralAssets[0].interestOracleParams,
4918
4753
  0n,
4919
4754
  context.lucid,
4920
- context.emulator.slot,
4755
+
4921
4756
  iusdAssetInfo.collateralAssets[0].interestOracleNft,
4922
4757
  ),
4923
4758
  );
@@ -4958,10 +4793,10 @@ describe('CDP', () => {
4958
4793
  fromSystemParamsAsset(sysParams.cdpParams.cdpAuthToken),
4959
4794
  );
4960
4795
 
4961
- assertValueInRange(
4962
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
4963
- { min: 199, max: 200 },
4964
- );
4796
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
4797
+ min: 199,
4798
+ max: 200,
4799
+ });
4965
4800
 
4966
4801
  const orefs = await findAllNecessaryOrefs(
4967
4802
  context.lucid,
@@ -4983,15 +4818,14 @@ describe('CDP', () => {
4983
4818
  priceOracleUtxo!,
4984
4819
  { numerator: 125n, denominator: 100n },
4985
4820
  iusdAssetInfo.collateralAssets[0].oracleParams!,
4986
- context.emulator.slot,
4987
4821
  ),
4988
4822
  );
4989
4823
 
4990
4824
  context.lucid.selectWallet.fromSeed(context.users.user.seedPhrase);
4991
- assertValueInRange(
4992
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
4993
- { min: 159, max: 160 },
4994
- );
4825
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
4826
+ min: 159,
4827
+ max: 160,
4828
+ });
4995
4829
  }
4996
4830
 
4997
4831
  {
@@ -5038,7 +4872,6 @@ describe('CDP', () => {
5038
4872
  orefs.govUtxo,
5039
4873
  sysParams,
5040
4874
  context.lucid,
5041
- context.emulator.slot,
5042
4875
  ),
5043
4876
  context.lucid,
5044
4877
  context.emulator,
@@ -5066,10 +4899,10 @@ describe('CDP', () => {
5066
4899
  ).toBe(2.0);
5067
4900
 
5068
4901
  // Since partial redemption has happened, the CR is not the redemption ratio.
5069
- assertValueInRange(
5070
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
5071
- { min: 160, max: 190 },
5072
- );
4902
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
4903
+ min: 160,
4904
+ max: 190,
4905
+ });
5073
4906
  }
5074
4907
  });
5075
4908
 
@@ -5079,7 +4912,7 @@ describe('CDP', () => {
5079
4912
  const [sysParams, [iusdAssetInfo]] = await init(
5080
4913
  context.lucid,
5081
4914
  [iusdInitialAssetCfg()],
5082
- context.emulator.slot,
4915
+
5083
4916
  () => [],
5084
4917
  {
5085
4918
  cdpRedemptionRequiredSignature: fromHex(
@@ -5094,7 +4927,7 @@ describe('CDP', () => {
5094
4927
  iusdAssetInfo.collateralAssets[0].interestOracleParams,
5095
4928
  0n,
5096
4929
  context.lucid,
5097
- context.emulator.slot,
4930
+
5098
4931
  iusdAssetInfo.collateralAssets[0].interestOracleNft,
5099
4932
  ),
5100
4933
  );
@@ -5169,7 +5002,7 @@ describe('CDP', () => {
5169
5002
  collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
5170
5003
  },
5171
5004
  ],
5172
- context.emulator.slot,
5005
+
5173
5006
  () => [],
5174
5007
  {
5175
5008
  cdpRedemptionRequiredSignature: fromHex(
@@ -5241,7 +5074,7 @@ describe('CDP', () => {
5241
5074
  null,
5242
5075
  sysParams,
5243
5076
  context.lucid,
5244
- context.emulator.slot,
5077
+
5245
5078
  govUtxo.utxo,
5246
5079
  [],
5247
5080
  );
@@ -5279,7 +5112,7 @@ describe('CDP', () => {
5279
5112
  const [sysParams, [iusdAssetInfo, ieurAssetInfo]] = await init(
5280
5113
  context.lucid,
5281
5114
  [iusdInitialAssetCfg(), ieurInitialAssetCfg()],
5282
- context.emulator.slot,
5115
+
5283
5116
  () => [],
5284
5117
  {
5285
5118
  cdpRedemptionRequiredSignature: fromHex(
@@ -5347,11 +5180,9 @@ describe('CDP', () => {
5347
5180
  test<MyContext>('Freeze CDP; ADA collateral', async (context: MyContext) => {
5348
5181
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
5349
5182
 
5350
- const [sysParams, [iusdAssetInfo]] = await init(
5351
- context.lucid,
5352
- [iusdInitialAssetCfg()],
5353
- context.emulator.slot,
5354
- );
5183
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
5184
+ iusdInitialAssetCfg(),
5185
+ ]);
5355
5186
  const [pkh, skh] = await addrDetails(context.lucid);
5356
5187
 
5357
5188
  await runAndAwaitTx(
@@ -5384,10 +5215,10 @@ describe('CDP', () => {
5384
5215
  fromSystemParamsAsset(sysParams.cdpParams.cdpAuthToken),
5385
5216
  );
5386
5217
 
5387
- assertValueInRange(
5388
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
5389
- { min: 111, max: 112 },
5390
- );
5218
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
5219
+ min: 111,
5220
+ max: 112,
5221
+ });
5391
5222
  }
5392
5223
 
5393
5224
  await benchmarkAndAwaitTx(
@@ -5426,16 +5257,12 @@ describe('CDP', () => {
5426
5257
  test<MyContext>('Freeze CDP; non-ADA collateral', async (context: MyContext) => {
5427
5258
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
5428
5259
 
5429
- const [sysParams, [iusdAssetInfo]] = await init(
5430
- context.lucid,
5431
- [
5432
- {
5433
- ...iusdInitialAssetCfg(),
5434
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
5435
- },
5436
- ],
5437
- context.emulator.slot,
5438
- );
5260
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
5261
+ {
5262
+ ...iusdInitialAssetCfg(),
5263
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
5264
+ },
5265
+ ]);
5439
5266
  const [pkh, skh] = await addrDetails(context.lucid);
5440
5267
 
5441
5268
  await runAndAwaitTx(
@@ -5468,10 +5295,10 @@ describe('CDP', () => {
5468
5295
  fromSystemParamsAsset(sysParams.cdpParams.cdpAuthToken),
5469
5296
  );
5470
5297
 
5471
- assertValueInRange(
5472
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
5473
- { min: 111, max: 112 },
5474
- );
5298
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
5299
+ min: 111,
5300
+ max: 112,
5301
+ });
5475
5302
  }
5476
5303
 
5477
5304
  await benchmarkAndAwaitTx(
@@ -5510,11 +5337,9 @@ describe('CDP', () => {
5510
5337
  test<IndigoTestContext>('Freeze CDP with expired oracle fails', async (context: IndigoTestContext) => {
5511
5338
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
5512
5339
 
5513
- const [sysParams, [iusdAssetInfo]] = await init(
5514
- context.lucid,
5515
- [iusdInitialAssetCfg()],
5516
- context.emulator.slot,
5517
- );
5340
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
5341
+ iusdInitialAssetCfg(),
5342
+ ]);
5518
5343
  const [pkh, skh] = await addrDetails(context.lucid);
5519
5344
 
5520
5345
  await runAndAwaitTx(
@@ -5547,10 +5372,10 @@ describe('CDP', () => {
5547
5372
  fromSystemParamsAsset(sysParams.cdpParams.cdpAuthToken),
5548
5373
  );
5549
5374
 
5550
- assertValueInRange(
5551
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
5552
- { min: 111, max: 112 },
5553
- );
5375
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
5376
+ min: 111,
5377
+ max: 112,
5378
+ });
5554
5379
  }
5555
5380
 
5556
5381
  //Await until oracle is expired
@@ -5568,16 +5393,12 @@ describe('CDP', () => {
5568
5393
  test<IndigoTestContext>('Freeze CDP with delisted iAsset succeeds', async (context: IndigoTestContext) => {
5569
5394
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
5570
5395
 
5571
- const [sysParams, [iusdAssetInfo]] = await init(
5572
- context.lucid,
5573
- [
5574
- {
5575
- ...iusdInitialAssetCfg(),
5576
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
5577
- },
5578
- ],
5579
- context.emulator.slot,
5580
- );
5396
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
5397
+ {
5398
+ ...iusdInitialAssetCfg(),
5399
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
5400
+ },
5401
+ ]);
5581
5402
 
5582
5403
  const [pkh, skh] = await addrDetails(context.lucid);
5583
5404
 
@@ -5626,7 +5447,7 @@ describe('CDP', () => {
5626
5447
  null,
5627
5448
  sysParams,
5628
5449
  context.lucid,
5629
- context.emulator.slot,
5450
+
5630
5451
  govUtxo.utxo,
5631
5452
  [],
5632
5453
  );
@@ -5653,10 +5474,10 @@ describe('CDP', () => {
5653
5474
  fromSystemParamsAsset(sysParams.cdpParams.cdpAuthToken),
5654
5475
  );
5655
5476
 
5656
- assertValueInRange(
5657
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
5658
- { min: 99, max: 100 },
5659
- );
5477
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
5478
+ min: 99,
5479
+ max: 100,
5480
+ });
5660
5481
  }
5661
5482
 
5662
5483
  await runAndAwaitTx(
@@ -5668,11 +5489,9 @@ describe('CDP', () => {
5668
5489
  test<MyContext>('Liquidate CDP; ADA collateral', async (context: MyContext) => {
5669
5490
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
5670
5491
 
5671
- const [sysParams, [iusdAssetInfo]] = await init(
5672
- context.lucid,
5673
- [iusdInitialAssetCfg()],
5674
- context.emulator.slot,
5675
- );
5492
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
5493
+ iusdInitialAssetCfg(),
5494
+ ]);
5676
5495
 
5677
5496
  // Open CDP
5678
5497
  // This is the position that will get liquidated.
@@ -5734,10 +5553,10 @@ describe('CDP', () => {
5734
5553
  skh,
5735
5554
  );
5736
5555
 
5737
- assertValueInRange(
5738
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
5739
- { min: 111, max: 112 },
5740
- );
5556
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
5557
+ min: 111,
5558
+ max: 112,
5559
+ });
5741
5560
  }
5742
5561
 
5743
5562
  // We want user to do the freeze of admin's CDP
@@ -5813,11 +5632,9 @@ describe('CDP', () => {
5813
5632
  test<MyContext>('Liquidate CDP; ADA collateral - direct treasury payment', async (context: MyContext) => {
5814
5633
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
5815
5634
 
5816
- const [sysParams, [iusdAssetInfo]] = await init(
5817
- context.lucid,
5818
- [iusdInitialAssetCfg()],
5819
- context.emulator.slot,
5820
- );
5635
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
5636
+ iusdInitialAssetCfg(),
5637
+ ]);
5821
5638
 
5822
5639
  // Open CDP
5823
5640
  // This is the position that will get liquidated.
@@ -5879,10 +5696,10 @@ describe('CDP', () => {
5879
5696
  skh,
5880
5697
  );
5881
5698
 
5882
- assertValueInRange(
5883
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
5884
- { min: 111, max: 112 },
5885
- );
5699
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
5700
+ min: 111,
5701
+ max: 112,
5702
+ });
5886
5703
  }
5887
5704
 
5888
5705
  // We want user to do the freeze of admin's CDP
@@ -5959,16 +5776,12 @@ describe('CDP', () => {
5959
5776
  test<MyContext>('Liquidate CDP; non-ADA collateral', async (context: MyContext) => {
5960
5777
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
5961
5778
 
5962
- const [sysParams, [iusdAssetInfo]] = await init(
5963
- context.lucid,
5964
- [
5965
- {
5966
- ...iusdInitialAssetCfg(),
5967
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
5968
- },
5969
- ],
5970
- context.emulator.slot,
5971
- );
5779
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
5780
+ {
5781
+ ...iusdInitialAssetCfg(),
5782
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
5783
+ },
5784
+ ]);
5972
5785
 
5973
5786
  // Open CDP
5974
5787
  // This is the position that will get liquidated.
@@ -6030,10 +5843,10 @@ describe('CDP', () => {
6030
5843
  skh,
6031
5844
  );
6032
5845
 
6033
- assertValueInRange(
6034
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
6035
- { min: 111, max: 112 },
6036
- );
5846
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
5847
+ min: 111,
5848
+ max: 112,
5849
+ });
6037
5850
  }
6038
5851
 
6039
5852
  // We want user to do the freeze of admin's CDP
@@ -6109,16 +5922,12 @@ describe('CDP', () => {
6109
5922
  test<MyContext>('Liquidate CDP; non-ADA collateral - direct treasury payment', async (context: MyContext) => {
6110
5923
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
6111
5924
 
6112
- const [sysParams, [iusdAssetInfo]] = await init(
6113
- context.lucid,
6114
- [
6115
- {
6116
- ...iusdInitialAssetCfg(),
6117
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
6118
- },
6119
- ],
6120
- context.emulator.slot,
6121
- );
5925
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
5926
+ {
5927
+ ...iusdInitialAssetCfg(),
5928
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
5929
+ },
5930
+ ]);
6122
5931
 
6123
5932
  // Open CDP
6124
5933
  // This is the position that will get liquidated.
@@ -6180,10 +5989,10 @@ describe('CDP', () => {
6180
5989
  skh,
6181
5990
  );
6182
5991
 
6183
- assertValueInRange(
6184
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
6185
- { min: 111, max: 112 },
6186
- );
5992
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
5993
+ min: 111,
5994
+ max: 112,
5995
+ });
6187
5996
  }
6188
5997
 
6189
5998
  // We want user to do the freeze of admin's CDP
@@ -6260,11 +6069,9 @@ describe('CDP', () => {
6260
6069
  test<IndigoTestContext>('Partially liquidate CDP; ADA collateral', async (context: IndigoTestContext) => {
6261
6070
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
6262
6071
 
6263
- const [sysParams, [iusdAssetInfo]] = await init(
6264
- context.lucid,
6265
- [iusdInitialAssetCfg()],
6266
- context.emulator.slot,
6267
- );
6072
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
6073
+ iusdInitialAssetCfg(),
6074
+ ]);
6268
6075
 
6269
6076
  // Open CDP
6270
6077
  // This is the position that will get liquidated.
@@ -6337,10 +6144,10 @@ describe('CDP', () => {
6337
6144
  skh,
6338
6145
  );
6339
6146
 
6340
- assertValueInRange(
6341
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
6342
- { min: 111, max: 112 },
6343
- );
6147
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
6148
+ min: 111,
6149
+ max: 112,
6150
+ });
6344
6151
  }
6345
6152
 
6346
6153
  // We want user to do the freeze of admin's CDP
@@ -6415,16 +6222,12 @@ describe('CDP', () => {
6415
6222
  test<IndigoTestContext>('Partially liquidate CDP; non-ADA collateral', async (context: IndigoTestContext) => {
6416
6223
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
6417
6224
 
6418
- const [sysParams, [iusdAssetInfo]] = await init(
6419
- context.lucid,
6420
- [
6421
- {
6422
- ...iusdInitialAssetCfg(),
6423
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
6424
- },
6425
- ],
6426
- context.emulator.slot,
6427
- );
6225
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
6226
+ {
6227
+ ...iusdInitialAssetCfg(),
6228
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
6229
+ },
6230
+ ]);
6428
6231
 
6429
6232
  // Open CDP
6430
6233
  // This is the position that will get liquidated.
@@ -6497,10 +6300,10 @@ describe('CDP', () => {
6497
6300
  skh,
6498
6301
  );
6499
6302
 
6500
- assertValueInRange(
6501
- await findCdpCR(context.lucid, sysParams, cdp, context.emulator.slot),
6502
- { min: 111, max: 112 },
6503
- );
6303
+ assertValueInRange(await findCdpCR(context.lucid, sysParams, cdp), {
6304
+ min: 111,
6305
+ max: 112,
6306
+ });
6504
6307
  }
6505
6308
 
6506
6309
  // We want user to do the freeze of admin's CDP
@@ -6576,11 +6379,9 @@ describe('CDP', () => {
6576
6379
  test<MyContext>('Merge 3 CDPs; ADA collateral', async (context: MyContext) => {
6577
6380
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
6578
6381
 
6579
- const [sysParams, [iusdAssetInfo]] = await init(
6580
- context.lucid,
6581
- [iusdInitialAssetCfg()],
6582
- context.emulator.slot,
6583
- );
6382
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
6383
+ iusdInitialAssetCfg(),
6384
+ ]);
6584
6385
 
6585
6386
  await runCreateAndFreezeCdps(
6586
6387
  context,
@@ -6613,16 +6414,12 @@ describe('CDP', () => {
6613
6414
  test<MyContext>('Merge 3 CDPs; non-ADA collateral', async (context: MyContext) => {
6614
6415
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
6615
6416
 
6616
- const [sysParams, [iusdAssetInfo]] = await init(
6617
- context.lucid,
6618
- [
6619
- {
6620
- ...iusdInitialAssetCfg(),
6621
- collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
6622
- },
6623
- ],
6624
- context.emulator.slot,
6625
- );
6417
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
6418
+ {
6419
+ ...iusdInitialAssetCfg(),
6420
+ collateralAssets: [mkBaseCollateralAsset(collateralAssetA)],
6421
+ },
6422
+ ]);
6626
6423
 
6627
6424
  await runCreateAndFreezeCdps(
6628
6425
  context,
@@ -6655,11 +6452,9 @@ describe('CDP', () => {
6655
6452
  test<IndigoTestContext>('Merge 5 CDPs', async (context: IndigoTestContext) => {
6656
6453
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
6657
6454
 
6658
- const [sysParams, [iusdAssetInfo]] = await init(
6659
- context.lucid,
6660
- [iusdInitialAssetCfg()],
6661
- context.emulator.slot,
6662
- );
6455
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
6456
+ iusdInitialAssetCfg(),
6457
+ ]);
6663
6458
 
6664
6459
  await createUtxoAtTreasury(mkLovelacesOf(2_000_000n), sysParams, context);
6665
6460
 
@@ -6694,11 +6489,9 @@ describe('CDP', () => {
6694
6489
  test<IndigoTestContext>('Merge 7 CDPs', async (context: IndigoTestContext) => {
6695
6490
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
6696
6491
 
6697
- const [sysParams, [iusdAssetInfo]] = await init(
6698
- context.lucid,
6699
- [iusdInitialAssetCfg()],
6700
- context.emulator.slot,
6701
- );
6492
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
6493
+ iusdInitialAssetCfg(),
6494
+ ]);
6702
6495
 
6703
6496
  await createMultipleUtxosAtTreasury(
6704
6497
  mkLovelacesOf(2_000_000n),
@@ -6738,11 +6531,9 @@ describe('CDP', () => {
6738
6531
  test<IndigoTestContext>('Merge 9 CDPs', async (context: IndigoTestContext) => {
6739
6532
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
6740
6533
 
6741
- const [sysParams, [iusdAssetInfo]] = await init(
6742
- context.lucid,
6743
- [iusdInitialAssetCfg()],
6744
- context.emulator.slot,
6745
- );
6534
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
6535
+ iusdInitialAssetCfg(),
6536
+ ]);
6746
6537
 
6747
6538
  await createMultipleUtxosAtTreasury(
6748
6539
  mkLovelacesOf(2_000_000n),
@@ -6782,11 +6573,9 @@ describe('CDP', () => {
6782
6573
  test<IndigoTestContext>('Merge CDPs and liquidate merged', async (context: IndigoTestContext) => {
6783
6574
  context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
6784
6575
 
6785
- const [sysParams, [iusdAssetInfo]] = await init(
6786
- context.lucid,
6787
- [iusdInitialAssetCfg()],
6788
- context.emulator.slot,
6789
- );
6576
+ const [sysParams, [iusdAssetInfo]] = await init(context.lucid, [
6577
+ iusdInitialAssetCfg(),
6578
+ ]);
6790
6579
 
6791
6580
  await runCreateAndFreezeCdps(
6792
6581
  context,
@@ -6847,7 +6636,6 @@ describe('CDP', () => {
6847
6636
  orefs.interestOracleUtxo,
6848
6637
  orefs.treasuryUtxo,
6849
6638
  context.lucid,
6850
- context.emulator.slot,
6851
6639
  ),
6852
6640
  );
6853
6641