@indigo-labs/indigo-sdk 0.1.2 → 0.1.3
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/.github/workflows/ci.yml +62 -0
- package/.github/workflows/test.yml +44 -0
- package/.husky/pre-commit +1 -0
- package/.prettierrc +1 -1
- package/README.md +52 -7
- package/dist/index.d.mts +1064 -182
- package/dist/index.d.ts +1064 -182
- package/dist/index.js +2565 -561
- package/dist/index.mjs +2546 -593
- package/eslint.config.mjs +35 -0
- package/package.json +61 -43
- package/src/contracts/cdp.ts +208 -359
- package/src/contracts/collector.ts +13 -6
- package/src/contracts/gov.ts +1 -58
- package/src/contracts/interest-oracle.ts +139 -39
- package/src/contracts/lrp.ts +223 -0
- package/src/contracts/one-shot.ts +67 -0
- package/src/contracts/stability-pool.ts +684 -0
- package/src/contracts/staking.ts +348 -0
- package/src/contracts/treasury.ts +30 -13
- package/src/helpers/asset-helpers.ts +51 -22
- package/src/helpers/helper-txs.ts +30 -0
- package/src/helpers/helpers.ts +29 -8
- package/src/helpers/indigo-helpers.ts +19 -0
- package/src/helpers/interest-oracle.ts +57 -0
- package/src/helpers/lucid-utils.ts +62 -16
- package/src/helpers/price-oracle-helpers.ts +36 -0
- package/src/helpers/stability-pool-helpers.ts +207 -0
- package/src/helpers/staking-helpers.ts +94 -0
- package/src/helpers/time-helpers.ts +4 -3
- package/src/helpers/value-helpers.ts +16 -0
- package/src/index.ts +15 -4
- package/src/scripts/always-fail-validator.ts +7 -0
- package/src/scripts/auth-token-policy.ts +23 -0
- package/src/scripts/cdp-creator-validator.ts +46 -2
- package/src/scripts/collector-validator.ts +2 -2
- package/src/scripts/execute-validator.ts +52 -0
- package/src/scripts/gov-validator.ts +44 -0
- package/src/scripts/iasset-policy.ts +22 -0
- package/src/scripts/interest-oracle-validator.ts +18 -3
- package/src/scripts/lrp-validator.ts +23 -0
- package/src/scripts/one-shot-policy.ts +62 -0
- package/src/scripts/poll-manager-validator.ts +52 -0
- package/src/scripts/poll-shard-validator.ts +47 -0
- package/src/scripts/price-oracle-validator.ts +26 -0
- package/src/scripts/stability-pool-validator.ts +60 -0
- package/src/scripts/staking-validator.ts +8 -0
- package/src/scripts/version-record-policy.ts +26 -0
- package/src/scripts/version-registry.ts +15 -0
- package/src/types/generic.ts +99 -6
- package/src/types/indigo/cdp-creator.ts +46 -0
- package/src/types/indigo/cdp.ts +86 -31
- package/src/types/indigo/execute.ts +21 -0
- package/src/types/indigo/gov.ts +50 -20
- package/src/types/indigo/interest-oracle.ts +55 -5
- package/src/types/indigo/lrp.ts +54 -0
- package/src/types/indigo/poll-manager.ts +21 -0
- package/src/types/indigo/poll-shard.ts +16 -0
- package/src/types/indigo/price-oracle.ts +38 -4
- package/src/types/indigo/stability-pool.ts +233 -0
- package/src/types/indigo/staking.ts +99 -0
- package/src/types/indigo/version-record.ts +17 -0
- package/src/types/on-chain-decimal.ts +23 -0
- package/src/types/one-shot.ts +22 -0
- package/src/types/system-params.ts +95 -77
- package/tests/data/system-params.json +972 -972
- package/tests/datums.test.ts +279 -44
- package/tests/endpoints/initialize.ts +1013 -0
- package/tests/hash-checks.test.ts +71 -15
- package/tests/indigo-test-helpers.ts +115 -0
- package/tests/initialize.test.ts +27 -0
- package/tests/interest-calculations.test.ts +110 -133
- package/tests/interest-oracle.test.ts +90 -0
- package/tests/lrp.test.ts +149 -0
- package/tests/queries/governance-queries.ts +31 -0
- package/tests/queries/iasset-queries.ts +39 -0
- package/tests/queries/interest-oracle-queries.ts +13 -0
- package/tests/queries/lrp-queries.ts +39 -0
- package/tests/queries/price-oracle-queries.ts +27 -0
- package/tests/queries/stability-pool-queries.ts +75 -0
- package/tests/queries/staking-queries.ts +43 -0
- package/tests/stability-pool.test.ts +364 -0
- package/tests/staking.test.ts +105 -0
- package/tests/test-helpers.ts +38 -0
- package/tsconfig.build.json +4 -0
- package/tsconfig.json +8 -27
- package/vitest.config.ts +9 -0
- package/babel.config.cjs +0 -13
- package/examples/sample-cdp.ts +0 -43
- package/jest.config.js +0 -13
- package/src/contracts/cdp-creator.ts +0 -86
- package/src/contracts/price-oracle.ts +0 -24
- package/src/helpers/cdp-helpers.ts +0 -9
package/tests/datums.test.ts
CHANGED
|
@@ -1,51 +1,286 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
CDPContent,
|
|
4
|
+
IAssetContent,
|
|
5
|
+
parseCDPDatum,
|
|
6
|
+
parseIAssetDatum,
|
|
7
|
+
parseInterestOracleDatum,
|
|
8
|
+
parsePriceOracleDatum,
|
|
9
|
+
parseStabilityPoolDatum,
|
|
10
|
+
serialiseCDPDatum,
|
|
11
|
+
serialiseFeedInterestOracleRedeemer,
|
|
12
|
+
serialiseIAssetDatum,
|
|
13
|
+
serialiseInterestOracleDatum,
|
|
14
|
+
serialisePriceOracleDatum,
|
|
15
|
+
serialiseStabilityPoolDatum,
|
|
16
|
+
StabilityPoolContent,
|
|
17
|
+
} from '../src/index';
|
|
18
|
+
import {
|
|
19
|
+
parseStakingManagerDatum,
|
|
20
|
+
parseStakingPositionDatum,
|
|
21
|
+
serialiseStakingDatum,
|
|
22
|
+
StakingManagerContent,
|
|
23
|
+
StakingPositionContent,
|
|
24
|
+
} from '../src/types/indigo/staking';
|
|
25
|
+
import { fromText } from '@lucid-evolution/lucid';
|
|
3
26
|
|
|
4
27
|
describe('Datum checks', () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
28
|
+
it('Price Oracle', () => {
|
|
29
|
+
expect(
|
|
30
|
+
parsePriceOracleDatum('d8799fd8799f1a0013c347ff1b00000194d68e13d8ff'),
|
|
31
|
+
).toEqual({
|
|
32
|
+
price: { getOnChainInt: 1295175n },
|
|
33
|
+
expiration: 1738766423000n,
|
|
8
34
|
});
|
|
35
|
+
expect(
|
|
36
|
+
serialisePriceOracleDatum({
|
|
37
|
+
price: { getOnChainInt: 1295175n },
|
|
38
|
+
expiration: 1738766423000n,
|
|
39
|
+
}),
|
|
40
|
+
).toEqual('d8799fd8799f1a0013c347ff1b00000194d68e13d8ff');
|
|
41
|
+
});
|
|
9
42
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
43
|
+
it('Interest Oracle', () => {
|
|
44
|
+
expect(
|
|
45
|
+
parseInterestOracleDatum(
|
|
46
|
+
'd8799f1b0180e51d1ae19514d8799f1a00030d40ff1b00000194ce33c598ff',
|
|
47
|
+
),
|
|
48
|
+
).toEqual({
|
|
49
|
+
unitaryInterest: 108338304224695572n,
|
|
50
|
+
interestRate: { getOnChainInt: 200000n },
|
|
51
|
+
lastUpdated: 1738626287000n,
|
|
13
52
|
});
|
|
53
|
+
expect(
|
|
54
|
+
serialiseInterestOracleDatum({
|
|
55
|
+
unitaryInterest: 108338304224695572n,
|
|
56
|
+
interestRate: { getOnChainInt: 200000n },
|
|
57
|
+
lastUpdated: 1738626287000n,
|
|
58
|
+
}),
|
|
59
|
+
).toEqual('d8799f1b0180e51d1ae19514d8799f1a00030d40ff1b00000194ce33c598ff');
|
|
60
|
+
});
|
|
14
61
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const frozenCDPDatum = 'd8799fd8799fd87a8044695553441a0050924ed87a9f1a0002765a1a0003ca56ffffff';
|
|
24
|
-
const frozenCDPObject: CDPDatum = { type: 'CDP', owner: undefined, asset: 'iUSD', mintedAmount: 5280334n, fees: { type: 'FrozenCDPAccumulatedFees', lovelaces_treasury: 161370n, lovelaces_indy_stakers: 248406n } };
|
|
25
|
-
expect(CDPContract.decodeCdpDatum(frozenCDPDatum)).toEqual(frozenCDPObject);
|
|
26
|
-
expect(CDPContract.encodeCdpDatum(frozenCDPObject)).toEqual(frozenCDPDatum);
|
|
27
|
-
});
|
|
62
|
+
it('Interest Oracle Redeemer', () => {
|
|
63
|
+
expect(
|
|
64
|
+
serialiseFeedInterestOracleRedeemer({
|
|
65
|
+
newInterestRate: { getOnChainInt: 1_000_000n },
|
|
66
|
+
currentTime: 1724851200n,
|
|
67
|
+
}),
|
|
68
|
+
).toEqual('d8799fd8799f1a000f4240ff1a66cf2400ff');
|
|
69
|
+
});
|
|
28
70
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
71
|
+
it('CDP', () => {
|
|
72
|
+
// Active CDP
|
|
73
|
+
const activeCDPDatum =
|
|
74
|
+
'd8799fd8799fd8799f581c98e30e1c6dbb727dc98bdcb48b99b313c97fabfb537ff4b29a94ed1cff44695553441b00000004d9b0a47ed8799f1b00000194d5ebec201b03022de04fddf5f9ffffff';
|
|
75
|
+
const activeCDPObject: CDPContent = {
|
|
76
|
+
cdpOwner: '98e30e1c6dbb727dc98bdcb48b99b313c97fabfb537ff4b29a94ed1c',
|
|
77
|
+
iasset: fromText('iUSD'),
|
|
78
|
+
mintedAmt: 20832101502n,
|
|
79
|
+
cdpFees: {
|
|
80
|
+
ActiveCDPInterestTracking: {
|
|
81
|
+
lastSettled: 1738755796000n,
|
|
82
|
+
unitaryInterestSnapshot: 216786173503075833n,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
expect(serialiseCDPDatum(activeCDPObject)).toEqual(activeCDPDatum);
|
|
87
|
+
expect(parseCDPDatum(activeCDPDatum)).toEqual(activeCDPObject);
|
|
88
|
+
|
|
89
|
+
// Frozen CDP
|
|
90
|
+
const frozenCDPDatum =
|
|
91
|
+
'd8799fd8799fd87a8044695553441a0050924ed87a9f1a0002765a1a0003ca56ffffff';
|
|
92
|
+
const frozenCDPObject: CDPContent = {
|
|
93
|
+
cdpOwner: null,
|
|
94
|
+
iasset: fromText('iUSD'),
|
|
95
|
+
mintedAmt: 5280334n,
|
|
96
|
+
cdpFees: {
|
|
97
|
+
FrozenCDPAccumulatedFees: {
|
|
98
|
+
lovelacesTreasury: 161370n,
|
|
99
|
+
lovelacesIndyStakers: 248406n,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
expect(parseCDPDatum(frozenCDPDatum)).toEqual(frozenCDPObject);
|
|
104
|
+
expect(serialiseCDPDatum(frozenCDPObject)).toEqual(frozenCDPDatum);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('iAsset', () => {
|
|
108
|
+
const assetDatum =
|
|
109
|
+
'd87a9fd8799f4469455448d87a9fd8799fd8799f581c6c9497ffd7e8baf86c3c0d6fcd43c524daa49ad5fceba26d715468e952694554483230323231323139313931333032ffffffd8799f581c7b75e317505dddce858ae7bf200656a967c7544e55efa5d18ef302494d694554485f494e544552455354ffd8799f1a08f0d180ffd8799f1a06dac2c0ffd8799f1a068e7780ffd8799f1a000186a0ffd8799f1a001e8480ffd8799f19c350ffd8799f1a000f4240ffd8799f1a000f4240ffd8799f1a01c9c380ffd87980d8799f4469534f4cffffff';
|
|
110
|
+
const assetObject: IAssetContent = {
|
|
111
|
+
assetName: fromText('iETH'),
|
|
112
|
+
price: {
|
|
113
|
+
Oracle: {
|
|
114
|
+
oracleNft: {
|
|
115
|
+
asset: {
|
|
116
|
+
currencySymbol:
|
|
117
|
+
'6c9497ffd7e8baf86c3c0d6fcd43c524daa49ad5fceba26d715468e9',
|
|
118
|
+
tokenName: fromText('iETH20221219191302'),
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
interestOracleNft: {
|
|
124
|
+
currencySymbol:
|
|
125
|
+
'7b75e317505dddce858ae7bf200656a967c7544e55efa5d18ef30249',
|
|
126
|
+
tokenName: fromText('iETH_INTEREST'),
|
|
127
|
+
},
|
|
128
|
+
redemptionRatio: { getOnChainInt: 150000000n },
|
|
129
|
+
maintenanceRatio: { getOnChainInt: 115000000n },
|
|
130
|
+
liquidationRatio: { getOnChainInt: 110000000n },
|
|
131
|
+
debtMintingFeePercentage: { getOnChainInt: 100000n },
|
|
132
|
+
liquidationProcessingFeePercentage: { getOnChainInt: 2000000n },
|
|
133
|
+
stabilityPoolWithdrawalFeePercentage: { getOnChainInt: 50000n },
|
|
134
|
+
redemptionReimbursementPercentage: { getOnChainInt: 1000000n },
|
|
135
|
+
redemptionProcessingFeePercentage: { getOnChainInt: 1000000n },
|
|
136
|
+
interestCollectorPortionPercentage: { getOnChainInt: 30000000n },
|
|
137
|
+
firstIAsset: false,
|
|
138
|
+
nextIAsset: fromText('iSOL'),
|
|
139
|
+
};
|
|
140
|
+
expect(serialiseIAssetDatum(assetObject)).toEqual(assetDatum);
|
|
141
|
+
expect(parseIAssetDatum(assetDatum)).toEqual(assetObject);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it('Staking Manager', () => {
|
|
145
|
+
const stakingManagerDatum =
|
|
146
|
+
'd8799fd8799f1b000009c04704429ed8799f1b000001402802fec1ffffff';
|
|
147
|
+
const stakingManagerObject: StakingManagerContent = {
|
|
148
|
+
totalStake: 10721429832350n,
|
|
149
|
+
managerSnapshot: {
|
|
150
|
+
snapshotAda: 1375060819649n,
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
expect(parseStakingManagerDatum(stakingManagerDatum)).toEqual(
|
|
155
|
+
stakingManagerObject,
|
|
156
|
+
);
|
|
157
|
+
expect(
|
|
158
|
+
serialiseStakingDatum({
|
|
159
|
+
StakingManager: { content: stakingManagerObject },
|
|
160
|
+
}),
|
|
161
|
+
).toEqual(stakingManagerDatum);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
it('Staking Position', () => {
|
|
165
|
+
const stakingPositionDatum =
|
|
166
|
+
'd87a9fd8799f581cd45527a088a92fd31f42b5777fe39c40f810e0f79d13c6d77eeb7f43bf1853d8799f1a5c8c1cfb1b0000019616971410ffffd8799f1b0000013a7ed5b0fdffffff';
|
|
167
|
+
const stakingPositionObject: StakingPositionContent = {
|
|
168
|
+
owner: 'd45527a088a92fd31f42b5777fe39c40f810e0f79d13c6d77eeb7f43',
|
|
169
|
+
lockedAmount: new Map([[83n, [1552686331n, 1744135722000n]]]),
|
|
170
|
+
positionSnapshot: {
|
|
171
|
+
snapshotAda: 1350747664637n,
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
expect(parseStakingPositionDatum(stakingPositionDatum)).toEqual(
|
|
176
|
+
stakingPositionObject,
|
|
177
|
+
);
|
|
178
|
+
expect(
|
|
179
|
+
serialiseStakingDatum({
|
|
180
|
+
StakingPosition: { content: stakingPositionObject },
|
|
181
|
+
}),
|
|
182
|
+
).toEqual(stakingPositionDatum);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it('Stability Pool', () => {
|
|
186
|
+
const stabilityPoolDatum =
|
|
187
|
+
'd8799fd8799f4469555344d8799fd8799f1b0a37ad5c452ffb2affd8799fc24d1f94ac680ce6b48ea21bb122baffd8799f1b0fde3bba456cd5deff0100ffa2d8799f0000ffd8799f1b084494e2d23b2b7effd8799f0100ffd8799f1b0fde3bba456cd5deffffff';
|
|
188
|
+
const stabilityPoolObject: StabilityPoolContent = {
|
|
189
|
+
asset: fromText('iUSD'),
|
|
190
|
+
snapshot: {
|
|
191
|
+
productVal: { value: 736247675907734314n },
|
|
192
|
+
depositVal: { value: 2502085246000826468068228145850n },
|
|
193
|
+
sumVal: { value: 1143417026613401054n },
|
|
194
|
+
epoch: 1n,
|
|
195
|
+
scale: 0n,
|
|
196
|
+
},
|
|
197
|
+
epochToScaleToSum: new Map([
|
|
198
|
+
[{ epoch: 0n, scale: 0n }, { value: 595764752630360958n }],
|
|
199
|
+
[{ epoch: 1n, scale: 0n }, { value: 1143417026613401054n }],
|
|
200
|
+
]),
|
|
201
|
+
};
|
|
202
|
+
expect(parseStabilityPoolDatum(stabilityPoolDatum)).toEqual(
|
|
203
|
+
stabilityPoolObject,
|
|
204
|
+
);
|
|
205
|
+
expect(
|
|
206
|
+
serialiseStabilityPoolDatum({
|
|
207
|
+
StabilityPool: { content: stabilityPoolObject },
|
|
208
|
+
}),
|
|
209
|
+
).toEqual(stabilityPoolDatum);
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
// it('Stability Pool Account', () => {
|
|
213
|
+
// const stabilityPoolDatum =
|
|
214
|
+
// 'd87a9fd8799f581c12c646d4c6d7a35c14788d15f0f6142f6148975d8932592fbd625f674469555344d8799fd8799f1b0a37ad5c452ffb2affd8799fc24c39fa2838b1f7dd38267f0a6dffd8799f1b0fde3b75c28ab489ff0100ffd87a80ffff';
|
|
215
|
+
// const stabilityPoolObject: AccountContent = {
|
|
216
|
+
// owner: '12c646d4c6d7a35c14788d15f0f6142f6148975d8932592fbd625f67',
|
|
217
|
+
// asset: fromText('iUSD'),
|
|
218
|
+
// snapshot: {
|
|
219
|
+
// productVal: { value: 736247675907734314n },
|
|
220
|
+
// depositVal: { value: 17943066955221270821727046253n },
|
|
221
|
+
// sumVal: { value: 1143416732359767177n },
|
|
222
|
+
// epoch: 1n,
|
|
223
|
+
// scale: 0n,
|
|
224
|
+
// },
|
|
225
|
+
// request: null,
|
|
226
|
+
// };
|
|
227
|
+
|
|
228
|
+
// expect(parseAccountDatum(stabilityPoolDatum)).toEqual(stabilityPoolObject);
|
|
229
|
+
// expect(
|
|
230
|
+
// serialiseStabilityPoolDatum({ Account: { content: stabilityPoolObject } }),
|
|
231
|
+
// ).toEqual(stabilityPoolDatum);
|
|
232
|
+
// });
|
|
233
|
+
|
|
234
|
+
// it('Stability Pool Account w/ Adjust Request', () => {
|
|
235
|
+
// const stabilityPoolDatum =
|
|
236
|
+
// 'd87a9fd8799f581c90e40129516ee738fa6aa9183cf57b45c46946496e1590d34ca1b15c4469555344d8799fd8799f1b0a374472be304a62ffd8799fc24b01aef07f96e5ce00f80000ffd8799f1b0f88aa07a1048079ff0100ffd8799fd87a9f3a0007c359d8799fd8799f581c90e40129516ee738fa6aa9183cf57b45c46946496e1590d34ca1b15cffd8799fd8799fd8799f581c75a4f9204b9308a92a09b0e22b94125e56f24b73bb85e2795f176c6affffffffffffffff';
|
|
237
|
+
// const stabilityPoolObject: AccountContent = {
|
|
238
|
+
// owner: '90e40129516ee738fa6aa9183cf57b45c46946496e1590d34ca1b15c',
|
|
239
|
+
// asset: fromText('iUSD'),
|
|
240
|
+
// snapshot: {
|
|
241
|
+
// productVal: { value: 736132323706161762n },
|
|
242
|
+
// depositVal: { value: 2035054000000000000000000n },
|
|
243
|
+
// sumVal: { value: 1119331457144488057n },
|
|
244
|
+
// epoch: 1n,
|
|
245
|
+
// scale: 0n,
|
|
246
|
+
// },
|
|
247
|
+
// request: {
|
|
248
|
+
// Adjust: {
|
|
249
|
+
// amount: -508762n,
|
|
250
|
+
// outputAddress: {
|
|
251
|
+
// paymentCredential: {
|
|
252
|
+
// PublicKeyCredential: ['90e40129516ee738fa6aa9183cf57b45c46946496e1590d34ca1b15c'],
|
|
253
|
+
// },
|
|
254
|
+
// stakeCredential: {
|
|
255
|
+
// Inline: [{PublicKeyCredential: ['75a4f9204b9308a92a09b0e22b94125e56f24b73bb85e2795f176c6a']}],
|
|
256
|
+
// },
|
|
257
|
+
// },
|
|
258
|
+
// },
|
|
259
|
+
// },
|
|
260
|
+
// };
|
|
261
|
+
|
|
262
|
+
// expect(parseAccountDatum(stabilityPoolDatum)).toEqual(stabilityPoolObject);
|
|
263
|
+
// expect(
|
|
264
|
+
// serialiseStabilityPoolDatum({ Account: { content: stabilityPoolObject } }),
|
|
265
|
+
// ).toEqual(stabilityPoolDatum);
|
|
266
|
+
// });
|
|
267
|
+
|
|
268
|
+
// it('Stability Pool SnapshotEpochToScaleToSum', () => {
|
|
269
|
+
// const stabilityPoolDatum =
|
|
270
|
+
// 'd87b9fd8799f4469555344bfd8799f0000ffd8799f1b084494e2d23b2b7effd8799f0100ffd8799f1b0fde3bba456cd5deffffffff';
|
|
271
|
+
// const stabilityPoolObject: SnapshotEpochToScaleToSumContent = {
|
|
272
|
+
// asset: fromText('iUSD'),
|
|
273
|
+
// snapshot: new Map([
|
|
274
|
+
// [{ epoch: 0n, scale: 0n }, { sum: 595764752630360958n }],
|
|
275
|
+
// [{ epoch: 1n, scale: 0n }, { sum: 1143417026613401054n }],
|
|
276
|
+
// ]),
|
|
277
|
+
// };
|
|
278
|
+
|
|
279
|
+
// expect(parseSnapshotEpochToScaleToSumDatum(stabilityPoolDatum)).toEqual(stabilityPoolObject);
|
|
280
|
+
// expect(
|
|
281
|
+
// serialiseStabilityPoolDatum({
|
|
282
|
+
// SnapshotEpochToScaleToSum: { content: stabilityPoolObject },
|
|
283
|
+
// }),
|
|
284
|
+
// ).toEqual(stabilityPoolDatum);
|
|
285
|
+
// });
|
|
286
|
+
});
|