@indigo-labs/indigo-sdk 0.4.2 → 0.4.4
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/.claude/settings.local.json +7 -0
- package/dist/index.d.mts +892 -867
- package/dist/index.d.ts +892 -867
- package/dist/index.js +1805 -1712
- package/dist/index.mjs +1592 -1499
- package/package.json +12 -20
- package/scripts/bench.sh +0 -0
- package/src/contracts/gov/transactions.ts +3 -1
- package/{tests/queries/stability-pool-queries.ts → src/contracts/stability-pool/queries.ts} +22 -14
- package/src/index.ts +4 -3
- package/tests/cdp/cdp-queries.ts +7 -2
- package/tests/pyth/pyth-feeds.test.ts +943 -0
- package/tests/stability-pool/actions.ts +27 -14
- package/tests/stability-pool.test.ts +62 -64
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { AssetClass } from '@3rd-eye-labs/cardano-offchain-common';
|
|
2
2
|
import {
|
|
3
|
+
fromHex,
|
|
4
|
+
fromText,
|
|
3
5
|
LucidEvolution,
|
|
4
6
|
TxBuilder,
|
|
5
7
|
unixTimeToSlot,
|
|
@@ -15,16 +17,15 @@ import {
|
|
|
15
17
|
openCdp,
|
|
16
18
|
processSpRequest,
|
|
17
19
|
SystemParams,
|
|
20
|
+
findStabilityPool,
|
|
21
|
+
findStabilityPoolAccount,
|
|
22
|
+
findE2s2sSnapshots,
|
|
18
23
|
} from '../../src';
|
|
19
24
|
import {
|
|
20
25
|
findAllNecessaryOrefs,
|
|
21
26
|
findPriceOracleFromCollateralAsset,
|
|
22
27
|
} from '../cdp/cdp-queries';
|
|
23
|
-
|
|
24
|
-
findE2s2sSnapshots,
|
|
25
|
-
findStabilityPool,
|
|
26
|
-
findStabilityPoolAccount,
|
|
27
|
-
} from '../queries/stability-pool-queries';
|
|
28
|
+
|
|
28
29
|
import { LucidContext, runAndAwaitTx } from '../test-helpers';
|
|
29
30
|
import { expect } from 'vitest';
|
|
30
31
|
import { findIAsset } from '../queries/iasset-queries';
|
|
@@ -113,7 +114,7 @@ async function waitForAccountCooldown(
|
|
|
113
114
|
context.lucid,
|
|
114
115
|
sysParams,
|
|
115
116
|
pkh,
|
|
116
|
-
asset,
|
|
117
|
+
fromHex(fromText(asset)),
|
|
117
118
|
);
|
|
118
119
|
|
|
119
120
|
if (accountUtxo.datum.lastRequestProcessingTime !== 0n) {
|
|
@@ -138,7 +139,11 @@ export async function runProcessSpRequest(
|
|
|
138
139
|
// Request owner
|
|
139
140
|
pkh: string,
|
|
140
141
|
): Promise<TxBuilder> {
|
|
141
|
-
const sp = await findStabilityPool(
|
|
142
|
+
const sp = await findStabilityPool(
|
|
143
|
+
context.lucid,
|
|
144
|
+
sysParams,
|
|
145
|
+
fromHex(fromText(asset)),
|
|
146
|
+
);
|
|
142
147
|
|
|
143
148
|
const ia = await findIAsset(
|
|
144
149
|
context.lucid,
|
|
@@ -151,7 +156,7 @@ export async function runProcessSpRequest(
|
|
|
151
156
|
context.lucid,
|
|
152
157
|
sysParams,
|
|
153
158
|
pkh,
|
|
154
|
-
asset,
|
|
159
|
+
fromHex(fromText(asset)),
|
|
155
160
|
);
|
|
156
161
|
|
|
157
162
|
await waitForAccountCooldown(context, sysParams, asset, pkh);
|
|
@@ -160,9 +165,13 @@ export async function runProcessSpRequest(
|
|
|
160
165
|
sp.utxo,
|
|
161
166
|
accountUtxo.utxo,
|
|
162
167
|
ia.utxo,
|
|
163
|
-
(
|
|
164
|
-
(
|
|
165
|
-
|
|
168
|
+
(
|
|
169
|
+
await findE2s2sSnapshots(
|
|
170
|
+
context.lucid,
|
|
171
|
+
sysParams,
|
|
172
|
+
fromHex(fromText(asset)),
|
|
173
|
+
)
|
|
174
|
+
).map((res) => res.utxo),
|
|
166
175
|
sysParams,
|
|
167
176
|
context.lucid,
|
|
168
177
|
context.emulator.slot,
|
|
@@ -181,7 +190,7 @@ export async function runCreateAdjustRequest(
|
|
|
181
190
|
lucid,
|
|
182
191
|
sysParams,
|
|
183
192
|
pkh.hash,
|
|
184
|
-
asset,
|
|
193
|
+
fromHex(fromText(asset)),
|
|
185
194
|
);
|
|
186
195
|
|
|
187
196
|
return requestSpAccountAdjustment(
|
|
@@ -203,7 +212,7 @@ export async function runCreateCloseRequest(
|
|
|
203
212
|
lucid,
|
|
204
213
|
sysParams,
|
|
205
214
|
pkh.hash,
|
|
206
|
-
asset,
|
|
215
|
+
fromHex(fromText(asset)),
|
|
207
216
|
);
|
|
208
217
|
|
|
209
218
|
return requestSpAccountClosure(accountUtxo.utxo, sysParams, lucid);
|
|
@@ -214,7 +223,11 @@ export async function runCreateE2s2sSnapshots(
|
|
|
214
223
|
sysParams: SystemParams,
|
|
215
224
|
asset: string,
|
|
216
225
|
): Promise<TxBuilder> {
|
|
217
|
-
const spUtxo = await findStabilityPool(
|
|
226
|
+
const spUtxo = await findStabilityPool(
|
|
227
|
+
context.lucid,
|
|
228
|
+
sysParams,
|
|
229
|
+
fromHex(fromText(asset)),
|
|
230
|
+
);
|
|
218
231
|
|
|
219
232
|
return createE2s2sSnapshots(spUtxo.utxo, sysParams, context.lucid);
|
|
220
233
|
}
|
|
@@ -12,11 +12,9 @@ import {
|
|
|
12
12
|
requestSpAccountCreation,
|
|
13
13
|
fromSystemParamsAsset,
|
|
14
14
|
MAX_E2S2S_ENTRIES_COUNT,
|
|
15
|
-
} from '../src';
|
|
16
|
-
import {
|
|
17
|
-
findStabilityPoolAccount,
|
|
18
15
|
findStabilityPool,
|
|
19
|
-
|
|
16
|
+
findStabilityPoolAccount,
|
|
17
|
+
} from '../src';
|
|
20
18
|
import {
|
|
21
19
|
readonlyArray as RA,
|
|
22
20
|
function as F,
|
|
@@ -365,7 +363,7 @@ describe('Stability pool', () => {
|
|
|
365
363
|
context.lucid,
|
|
366
364
|
sysParams,
|
|
367
365
|
pkh.hash,
|
|
368
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
366
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
369
367
|
);
|
|
370
368
|
|
|
371
369
|
await benchmarkAndAwaitTx(
|
|
@@ -434,7 +432,7 @@ describe('Stability pool', () => {
|
|
|
434
432
|
context.lucid,
|
|
435
433
|
sysParams,
|
|
436
434
|
pkh.hash,
|
|
437
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
435
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
438
436
|
);
|
|
439
437
|
|
|
440
438
|
await benchmarkAndAwaitTx(
|
|
@@ -502,7 +500,7 @@ describe('Stability pool', () => {
|
|
|
502
500
|
context.lucid,
|
|
503
501
|
sysParams,
|
|
504
502
|
pkh.hash,
|
|
505
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
503
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
506
504
|
);
|
|
507
505
|
|
|
508
506
|
await benchmarkAndAwaitTx(
|
|
@@ -1778,13 +1776,13 @@ describe('Stability pool', () => {
|
|
|
1778
1776
|
context.lucid,
|
|
1779
1777
|
sysParams,
|
|
1780
1778
|
paymentCredentialOf(context.users.user1.address).hash,
|
|
1781
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
1779
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
1782
1780
|
);
|
|
1783
1781
|
|
|
1784
1782
|
const stabilityPoolBefore = await findStabilityPool(
|
|
1785
1783
|
context.lucid,
|
|
1786
1784
|
sysParams,
|
|
1787
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
1785
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
1788
1786
|
);
|
|
1789
1787
|
|
|
1790
1788
|
context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
|
|
@@ -1813,7 +1811,7 @@ describe('Stability pool', () => {
|
|
|
1813
1811
|
const stabilityPoolAfter = await findStabilityPool(
|
|
1814
1812
|
context.lucid,
|
|
1815
1813
|
sysParams,
|
|
1816
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
1814
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
1817
1815
|
);
|
|
1818
1816
|
|
|
1819
1817
|
const iasset = await findIAsset(
|
|
@@ -1982,13 +1980,13 @@ describe('Stability pool', () => {
|
|
|
1982
1980
|
context.lucid,
|
|
1983
1981
|
sysParams,
|
|
1984
1982
|
paymentCredentialOf(context.users.user1.address).hash,
|
|
1985
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
1983
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
1986
1984
|
);
|
|
1987
1985
|
|
|
1988
1986
|
const stabilityPoolBefore = await findStabilityPool(
|
|
1989
1987
|
context.lucid,
|
|
1990
1988
|
sysParams,
|
|
1991
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
1989
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
1992
1990
|
);
|
|
1993
1991
|
|
|
1994
1992
|
context.lucid.selectWallet.fromSeed(context.users.admin.seedPhrase);
|
|
@@ -2017,7 +2015,7 @@ describe('Stability pool', () => {
|
|
|
2017
2015
|
const stabilityPoolAfter = await findStabilityPool(
|
|
2018
2016
|
context.lucid,
|
|
2019
2017
|
sysParams,
|
|
2020
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
2018
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
2021
2019
|
);
|
|
2022
2020
|
|
|
2023
2021
|
const iasset = await findIAsset(
|
|
@@ -2233,7 +2231,7 @@ describe('Stability pool', () => {
|
|
|
2233
2231
|
const sp = await findStabilityPool(
|
|
2234
2232
|
context.lucid,
|
|
2235
2233
|
sysParams,
|
|
2236
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
2234
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
2237
2235
|
);
|
|
2238
2236
|
|
|
2239
2237
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(0n);
|
|
@@ -2286,7 +2284,7 @@ describe('Stability pool', () => {
|
|
|
2286
2284
|
const sp = await findStabilityPool(
|
|
2287
2285
|
context.lucid,
|
|
2288
2286
|
sysParams,
|
|
2289
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
2287
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
2290
2288
|
);
|
|
2291
2289
|
|
|
2292
2290
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(0n);
|
|
@@ -2431,7 +2429,7 @@ describe('Stability pool', () => {
|
|
|
2431
2429
|
const sp = await findStabilityPool(
|
|
2432
2430
|
context.lucid,
|
|
2433
2431
|
sysParams,
|
|
2434
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
2432
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
2435
2433
|
);
|
|
2436
2434
|
|
|
2437
2435
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(0n);
|
|
@@ -2481,7 +2479,7 @@ describe('Stability pool', () => {
|
|
|
2481
2479
|
const sp = await findStabilityPool(
|
|
2482
2480
|
context.lucid,
|
|
2483
2481
|
sysParams,
|
|
2484
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
2482
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
2485
2483
|
);
|
|
2486
2484
|
|
|
2487
2485
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(0n);
|
|
@@ -2623,7 +2621,7 @@ describe('Stability pool', () => {
|
|
|
2623
2621
|
const sp = await findStabilityPool(
|
|
2624
2622
|
context.lucid,
|
|
2625
2623
|
sysParams,
|
|
2626
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
2624
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
2627
2625
|
);
|
|
2628
2626
|
|
|
2629
2627
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(0n);
|
|
@@ -2674,7 +2672,7 @@ describe('Stability pool', () => {
|
|
|
2674
2672
|
const sp = await findStabilityPool(
|
|
2675
2673
|
context.lucid,
|
|
2676
2674
|
sysParams,
|
|
2677
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
2675
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
2678
2676
|
);
|
|
2679
2677
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(1n);
|
|
2680
2678
|
expect(sp.datum.state.scale, 'Unexpected scale').toEqual(0n);
|
|
@@ -2874,7 +2872,7 @@ describe('Stability pool', () => {
|
|
|
2874
2872
|
const sp = await findStabilityPool(
|
|
2875
2873
|
context.lucid,
|
|
2876
2874
|
sysParams,
|
|
2877
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
2875
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
2878
2876
|
);
|
|
2879
2877
|
|
|
2880
2878
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(0n);
|
|
@@ -2927,7 +2925,7 @@ describe('Stability pool', () => {
|
|
|
2927
2925
|
const sp = await findStabilityPool(
|
|
2928
2926
|
context.lucid,
|
|
2929
2927
|
sysParams,
|
|
2930
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
2928
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
2931
2929
|
);
|
|
2932
2930
|
|
|
2933
2931
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(0n);
|
|
@@ -3110,7 +3108,7 @@ describe('Stability pool', () => {
|
|
|
3110
3108
|
const sp = await findStabilityPool(
|
|
3111
3109
|
context.lucid,
|
|
3112
3110
|
sysParams,
|
|
3113
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
3111
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
3114
3112
|
);
|
|
3115
3113
|
|
|
3116
3114
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(4n);
|
|
@@ -3143,7 +3141,7 @@ describe('Stability pool', () => {
|
|
|
3143
3141
|
const sp = await findStabilityPool(
|
|
3144
3142
|
context.lucid,
|
|
3145
3143
|
sysParams,
|
|
3146
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
3144
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
3147
3145
|
);
|
|
3148
3146
|
|
|
3149
3147
|
expect(
|
|
@@ -3502,7 +3500,7 @@ describe('Stability pool', () => {
|
|
|
3502
3500
|
await findStabilityPool(
|
|
3503
3501
|
context.lucid,
|
|
3504
3502
|
sysParams,
|
|
3505
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
3503
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
3506
3504
|
)
|
|
3507
3505
|
).datum.state.scale,
|
|
3508
3506
|
'Unexpected scale',
|
|
@@ -3723,7 +3721,7 @@ describe('Stability pool', () => {
|
|
|
3723
3721
|
await findStabilityPool(
|
|
3724
3722
|
context.lucid,
|
|
3725
3723
|
sysParams,
|
|
3726
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
3724
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
3727
3725
|
)
|
|
3728
3726
|
).datum.state.scale,
|
|
3729
3727
|
'Unexpected scale',
|
|
@@ -3903,7 +3901,7 @@ describe('Stability pool', () => {
|
|
|
3903
3901
|
await findStabilityPool(
|
|
3904
3902
|
context.lucid,
|
|
3905
3903
|
sysParams,
|
|
3906
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
3904
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
3907
3905
|
)
|
|
3908
3906
|
).datum.assetStates.every(
|
|
3909
3907
|
([_, assetState]) =>
|
|
@@ -3926,7 +3924,7 @@ describe('Stability pool', () => {
|
|
|
3926
3924
|
await findStabilityPool(
|
|
3927
3925
|
context.lucid,
|
|
3928
3926
|
sysParams,
|
|
3929
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
3927
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
3930
3928
|
)
|
|
3931
3929
|
).datum.assetStates.every(
|
|
3932
3930
|
([_, assetState]) => assetState.epoch2scale2sum.length === 1,
|
|
@@ -4012,7 +4010,7 @@ describe('Stability pool', () => {
|
|
|
4012
4010
|
const sp = await findStabilityPool(
|
|
4013
4011
|
context.lucid,
|
|
4014
4012
|
sysParams,
|
|
4015
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
4013
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
4016
4014
|
);
|
|
4017
4015
|
|
|
4018
4016
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(0n);
|
|
@@ -4036,7 +4034,7 @@ describe('Stability pool', () => {
|
|
|
4036
4034
|
context.lucid,
|
|
4037
4035
|
sysParams,
|
|
4038
4036
|
paymentCredentialOf(context.users.user1.address).hash,
|
|
4039
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
4037
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
4040
4038
|
);
|
|
4041
4039
|
|
|
4042
4040
|
expect(
|
|
@@ -4084,7 +4082,7 @@ describe('Stability pool', () => {
|
|
|
4084
4082
|
const sp = await findStabilityPool(
|
|
4085
4083
|
context.lucid,
|
|
4086
4084
|
sysParams,
|
|
4087
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
4085
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
4088
4086
|
);
|
|
4089
4087
|
|
|
4090
4088
|
const spCollateralAssets = sp.datum.assetStates.map(([key, _]) => key);
|
|
@@ -4257,7 +4255,7 @@ describe('Stability pool', () => {
|
|
|
4257
4255
|
await findStabilityPool(
|
|
4258
4256
|
context.lucid,
|
|
4259
4257
|
sysParams,
|
|
4260
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
4258
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
4261
4259
|
)
|
|
4262
4260
|
).datum.state.scale,
|
|
4263
4261
|
'Unexpected scale',
|
|
@@ -4365,7 +4363,7 @@ describe('Stability pool', () => {
|
|
|
4365
4363
|
await findStabilityPool(
|
|
4366
4364
|
context.lucid,
|
|
4367
4365
|
sysParams,
|
|
4368
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
4366
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
4369
4367
|
)
|
|
4370
4368
|
).datum.assetStates.every(
|
|
4371
4369
|
([_, assetState]) =>
|
|
@@ -4388,7 +4386,7 @@ describe('Stability pool', () => {
|
|
|
4388
4386
|
await findStabilityPool(
|
|
4389
4387
|
context.lucid,
|
|
4390
4388
|
sysParams,
|
|
4391
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
4389
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
4392
4390
|
)
|
|
4393
4391
|
).datum.assetStates.every(
|
|
4394
4392
|
([_, assetState]) => assetState.epoch2scale2sum.length === 1,
|
|
@@ -4460,7 +4458,7 @@ describe('Stability pool', () => {
|
|
|
4460
4458
|
const sp = await findStabilityPool(
|
|
4461
4459
|
context.lucid,
|
|
4462
4460
|
sysParams,
|
|
4463
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
4461
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
4464
4462
|
);
|
|
4465
4463
|
|
|
4466
4464
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(0n);
|
|
@@ -4479,7 +4477,7 @@ describe('Stability pool', () => {
|
|
|
4479
4477
|
await findStabilityPool(
|
|
4480
4478
|
context.lucid,
|
|
4481
4479
|
sysParams,
|
|
4482
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
4480
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
4483
4481
|
)
|
|
4484
4482
|
).datum.assetStates.every(
|
|
4485
4483
|
([_, assetState]) =>
|
|
@@ -4502,7 +4500,7 @@ describe('Stability pool', () => {
|
|
|
4502
4500
|
await findStabilityPool(
|
|
4503
4501
|
context.lucid,
|
|
4504
4502
|
sysParams,
|
|
4505
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
4503
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
4506
4504
|
)
|
|
4507
4505
|
).datum.assetStates.every(
|
|
4508
4506
|
([_, assetState]) => assetState.epoch2scale2sum.length === 1,
|
|
@@ -4574,7 +4572,7 @@ describe('Stability pool', () => {
|
|
|
4574
4572
|
const sp = await findStabilityPool(
|
|
4575
4573
|
context.lucid,
|
|
4576
4574
|
sysParams,
|
|
4577
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
4575
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
4578
4576
|
);
|
|
4579
4577
|
|
|
4580
4578
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(0n);
|
|
@@ -4601,7 +4599,7 @@ describe('Stability pool', () => {
|
|
|
4601
4599
|
context.lucid,
|
|
4602
4600
|
sysParams,
|
|
4603
4601
|
paymentCredentialOf(context.users.user1.address).hash,
|
|
4604
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
4602
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
4605
4603
|
);
|
|
4606
4604
|
|
|
4607
4605
|
expect(
|
|
@@ -4648,7 +4646,7 @@ describe('Stability pool', () => {
|
|
|
4648
4646
|
const sp = await findStabilityPool(
|
|
4649
4647
|
context.lucid,
|
|
4650
4648
|
sysParams,
|
|
4651
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
4649
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
4652
4650
|
);
|
|
4653
4651
|
|
|
4654
4652
|
const spCollateralAssets = sp.datum.assetStates.map(([key, _]) => key);
|
|
@@ -4867,7 +4865,7 @@ describe('Stability pool', () => {
|
|
|
4867
4865
|
await findStabilityPool(
|
|
4868
4866
|
context.lucid,
|
|
4869
4867
|
sysParams,
|
|
4870
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
4868
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
4871
4869
|
)
|
|
4872
4870
|
).datum.state.scale,
|
|
4873
4871
|
'Unexpected scale',
|
|
@@ -4974,7 +4972,7 @@ describe('Stability pool', () => {
|
|
|
4974
4972
|
const sp = await findStabilityPool(
|
|
4975
4973
|
context.lucid,
|
|
4976
4974
|
sysParams,
|
|
4977
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
4975
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
4978
4976
|
);
|
|
4979
4977
|
|
|
4980
4978
|
expect(
|
|
@@ -5005,7 +5003,7 @@ describe('Stability pool', () => {
|
|
|
5005
5003
|
await findStabilityPool(
|
|
5006
5004
|
context.lucid,
|
|
5007
5005
|
sysParams,
|
|
5008
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5006
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5009
5007
|
)
|
|
5010
5008
|
).datum.assetStates.every(
|
|
5011
5009
|
([_, assetState]) => assetState.epoch2scale2sum.length === 1,
|
|
@@ -5077,7 +5075,7 @@ describe('Stability pool', () => {
|
|
|
5077
5075
|
const sp = await findStabilityPool(
|
|
5078
5076
|
context.lucid,
|
|
5079
5077
|
sysParams,
|
|
5080
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5078
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5081
5079
|
);
|
|
5082
5080
|
|
|
5083
5081
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(0n);
|
|
@@ -5096,7 +5094,7 @@ describe('Stability pool', () => {
|
|
|
5096
5094
|
await findStabilityPool(
|
|
5097
5095
|
context.lucid,
|
|
5098
5096
|
sysParams,
|
|
5099
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5097
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5100
5098
|
)
|
|
5101
5099
|
).datum.assetStates.every(
|
|
5102
5100
|
([_, assetState]) =>
|
|
@@ -5119,7 +5117,7 @@ describe('Stability pool', () => {
|
|
|
5119
5117
|
await findStabilityPool(
|
|
5120
5118
|
context.lucid,
|
|
5121
5119
|
sysParams,
|
|
5122
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5120
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5123
5121
|
)
|
|
5124
5122
|
).datum.assetStates.every(
|
|
5125
5123
|
([_, assetState]) => assetState.epoch2scale2sum.length === 1,
|
|
@@ -5191,7 +5189,7 @@ describe('Stability pool', () => {
|
|
|
5191
5189
|
const sp = await findStabilityPool(
|
|
5192
5190
|
context.lucid,
|
|
5193
5191
|
sysParams,
|
|
5194
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5192
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5195
5193
|
);
|
|
5196
5194
|
|
|
5197
5195
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(0n);
|
|
@@ -5218,7 +5216,7 @@ describe('Stability pool', () => {
|
|
|
5218
5216
|
context.lucid,
|
|
5219
5217
|
sysParams,
|
|
5220
5218
|
paymentCredentialOf(context.users.user1.address).hash,
|
|
5221
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5219
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5222
5220
|
);
|
|
5223
5221
|
|
|
5224
5222
|
expect(
|
|
@@ -5270,7 +5268,7 @@ describe('Stability pool', () => {
|
|
|
5270
5268
|
const sp = await findStabilityPool(
|
|
5271
5269
|
context.lucid,
|
|
5272
5270
|
sysParams,
|
|
5273
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5271
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5274
5272
|
);
|
|
5275
5273
|
|
|
5276
5274
|
const spCollateralAssets = sp.datum.assetStates.map(([key, _]) => key);
|
|
@@ -5461,7 +5459,7 @@ describe('Stability pool', () => {
|
|
|
5461
5459
|
await findStabilityPool(
|
|
5462
5460
|
context.lucid,
|
|
5463
5461
|
sysParams,
|
|
5464
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5462
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5465
5463
|
)
|
|
5466
5464
|
).datum.state.scale,
|
|
5467
5465
|
'Unexpected scale',
|
|
@@ -5623,7 +5621,7 @@ describe('Stability pool', () => {
|
|
|
5623
5621
|
await findStabilityPool(
|
|
5624
5622
|
context.lucid,
|
|
5625
5623
|
sysParams,
|
|
5626
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5624
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5627
5625
|
)
|
|
5628
5626
|
).datum.state.scale,
|
|
5629
5627
|
'Unexpected scale',
|
|
@@ -5640,7 +5638,7 @@ describe('Stability pool', () => {
|
|
|
5640
5638
|
const sp = await findStabilityPool(
|
|
5641
5639
|
context.lucid,
|
|
5642
5640
|
sysParams,
|
|
5643
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5641
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5644
5642
|
);
|
|
5645
5643
|
|
|
5646
5644
|
expect(
|
|
@@ -5670,7 +5668,7 @@ describe('Stability pool', () => {
|
|
|
5670
5668
|
await findStabilityPool(
|
|
5671
5669
|
context.lucid,
|
|
5672
5670
|
sysParams,
|
|
5673
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5671
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5674
5672
|
)
|
|
5675
5673
|
).datum.assetStates.some(
|
|
5676
5674
|
([_, assetState]) =>
|
|
@@ -5745,7 +5743,7 @@ describe('Stability pool', () => {
|
|
|
5745
5743
|
const sp = await findStabilityPool(
|
|
5746
5744
|
context.lucid,
|
|
5747
5745
|
sysParams,
|
|
5748
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5746
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5749
5747
|
);
|
|
5750
5748
|
|
|
5751
5749
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(0n);
|
|
@@ -5780,7 +5778,7 @@ describe('Stability pool', () => {
|
|
|
5780
5778
|
await findStabilityPool(
|
|
5781
5779
|
context.lucid,
|
|
5782
5780
|
sysParams,
|
|
5783
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5781
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5784
5782
|
)
|
|
5785
5783
|
).datum.assetStates.some(
|
|
5786
5784
|
([_, assetState]) =>
|
|
@@ -5855,7 +5853,7 @@ describe('Stability pool', () => {
|
|
|
5855
5853
|
const sp = await findStabilityPool(
|
|
5856
5854
|
context.lucid,
|
|
5857
5855
|
sysParams,
|
|
5858
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5856
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5859
5857
|
);
|
|
5860
5858
|
|
|
5861
5859
|
expect(sp.datum.state.epoch, 'Unexpected epoch').toEqual(0n);
|
|
@@ -5882,7 +5880,7 @@ describe('Stability pool', () => {
|
|
|
5882
5880
|
context.lucid,
|
|
5883
5881
|
sysParams,
|
|
5884
5882
|
paymentCredentialOf(context.users.user1.address).hash,
|
|
5885
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5883
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5886
5884
|
);
|
|
5887
5885
|
|
|
5888
5886
|
expect(
|
|
@@ -5934,7 +5932,7 @@ describe('Stability pool', () => {
|
|
|
5934
5932
|
const sp = await findStabilityPool(
|
|
5935
5933
|
context.lucid,
|
|
5936
5934
|
sysParams,
|
|
5937
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
5935
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
5938
5936
|
);
|
|
5939
5937
|
|
|
5940
5938
|
const spCollateralAssets = sp.datum.assetStates.map(([key, _]) => key);
|
|
@@ -6239,7 +6237,7 @@ describe('Stability pool', () => {
|
|
|
6239
6237
|
const sp = await findStabilityPool(
|
|
6240
6238
|
context.lucid,
|
|
6241
6239
|
sysParams,
|
|
6242
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
6240
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
6243
6241
|
);
|
|
6244
6242
|
|
|
6245
6243
|
const spCollateralAssets = sp.datum.assetStates.map(([key, _]) => key);
|
|
@@ -6266,7 +6264,7 @@ describe('Stability pool', () => {
|
|
|
6266
6264
|
context.lucid,
|
|
6267
6265
|
sysParams,
|
|
6268
6266
|
paymentCredentialOf(context.users.user1.address).hash,
|
|
6269
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
6267
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
6270
6268
|
);
|
|
6271
6269
|
|
|
6272
6270
|
expect(
|
|
@@ -6421,7 +6419,7 @@ describe('Stability pool', () => {
|
|
|
6421
6419
|
const sp = await findStabilityPool(
|
|
6422
6420
|
context.lucid,
|
|
6423
6421
|
sysParams,
|
|
6424
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
6422
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
6425
6423
|
);
|
|
6426
6424
|
|
|
6427
6425
|
expect(sp.datum.state.epoch, 'Unexpected sp epoch').toEqual(0n);
|
|
@@ -6489,7 +6487,7 @@ describe('Stability pool', () => {
|
|
|
6489
6487
|
const sp = await findStabilityPool(
|
|
6490
6488
|
context.lucid,
|
|
6491
6489
|
sysParams,
|
|
6492
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
6490
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
6493
6491
|
);
|
|
6494
6492
|
|
|
6495
6493
|
expect(sp.datum.state.epoch, 'Unexpected sp epoch').toEqual(0n);
|
|
@@ -6505,7 +6503,7 @@ describe('Stability pool', () => {
|
|
|
6505
6503
|
context.lucid,
|
|
6506
6504
|
sysParams,
|
|
6507
6505
|
paymentCredentialOf(context.users.user1.address).hash,
|
|
6508
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
6506
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
6509
6507
|
);
|
|
6510
6508
|
|
|
6511
6509
|
expect(account.datum.state.epoch, 'Expected account epoch').toEqual(0n);
|
|
@@ -6543,7 +6541,7 @@ describe('Stability pool', () => {
|
|
|
6543
6541
|
const sp = await findStabilityPool(
|
|
6544
6542
|
context.lucid,
|
|
6545
6543
|
sysParams,
|
|
6546
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
6544
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
6547
6545
|
);
|
|
6548
6546
|
|
|
6549
6547
|
const spCollateralAssets = sp.datum.assetStates.map(([key, _]) => key);
|
|
@@ -6566,7 +6564,7 @@ describe('Stability pool', () => {
|
|
|
6566
6564
|
context.lucid,
|
|
6567
6565
|
sysParams,
|
|
6568
6566
|
paymentCredentialOf(context.users.user1.address).hash,
|
|
6569
|
-
iusdAssetInfo.iassetTokenNameAscii,
|
|
6567
|
+
fromHex(fromText(iusdAssetInfo.iassetTokenNameAscii)),
|
|
6570
6568
|
);
|
|
6571
6569
|
|
|
6572
6570
|
expect(account.datum.state.epoch, 'Expected account epoch').toEqual(0n);
|