Skip to content

Commit 5e5ea7b

Browse files
committed
update pr tests
1 parent cf74710 commit 5e5ea7b

File tree

4 files changed

+65
-71
lines changed

4 files changed

+65
-71
lines changed

.github/workflows/vaults-and-reserve-metrics-testing.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -51,41 +51,41 @@ jobs:
5151
- name: Wait for GraphQL server
5252
run: sleep 60
5353

54-
# - name: Test VaultManagerGovernance
55-
# run: ./scripts/validateData.mjs
56-
# env:
57-
# entity: vaultManagerGovernances
58-
# blockHeight: 1178
59-
60-
# - name: Test VaultManagerMetrics
61-
# run: ./scripts/validateData.mjs
62-
# env:
63-
# entity: vaultManagerMetrics
64-
# blockHeight: 1170
54+
- name: Test VaultManagerGovernance
55+
run: ./scripts/validateData.mjs
56+
env:
57+
entity: vaultManagerGovernances
58+
blockHeight: 1185
59+
60+
- name: Test VaultManagerMetrics
61+
run: ./scripts/validateData.mjs
62+
env:
63+
entity: vaultManagerMetrics
64+
blockHeight: 1226
6565

6666
- name: Test VaultManagerMetricsDaily
6767
run: ./scripts/validateData.mjs
6868
env:
6969
entity: vaultManagerMetricsDailies
70-
blockHeight: 1231
70+
blockHeight: 1226
7171

7272
- name: Test ReserveMetrics
7373
run: ./scripts/validateData.mjs
7474
env:
7575
entity: reserveMetrics
76-
blockHeight: 1231
76+
blockHeight: 1226
7777

7878
- name: Test ReserveAllocationMetrics
7979
run: ./scripts/validateData.mjs
8080
env:
8181
entity: reserveAllocationMetrics
82-
blockHeight: 1231
82+
blockHeight: 1226
8383

8484
- name: Test ReserveAllocationMetricsDaily
8585
run: ./scripts/validateData.mjs
8686
env:
8787
entity: reserveAllocationMetricsDailies
88-
blockHeight: 1231
88+
blockHeight: 1226
8989

9090
- name: Notify About Failure
9191
if: >

scripts/queries.mjs

+9-9
Original file line numberDiff line numberDiff line change
@@ -127,40 +127,40 @@ export const expectations = {
127127
mintFeeNumerator: '50',
128128
},
129129
vaultManagerMetrics: {
130-
liquidatingCollateralBrand: 'stATOM',
130+
liquidatingCollateralBrand: 'ATOM',
131131
liquidatingCollateralValue: '0',
132132
liquidatingDebtBrand: 'IST',
133133
liquidatingDebtValue: '0',
134134
lockedQuoteDenominator: '0',
135135
lockedQuoteNumerator: '0',
136-
numActiveVaults: '0',
136+
numActiveVaults: '7',
137137
numLiquidatingVaults: '0',
138138
numLiquidationsAborted: '0',
139139
numLiquidationsCompleted: '0',
140140
retainedCollateral: '0',
141-
totalCollateral: '0',
141+
totalCollateral: '5982000000',
142142
totalCollateralSold: '0',
143-
totalDebt: '0',
143+
totalDebt: '35984025000',
144144
totalOverageReceived: '0',
145145
totalProceedsReceived: '0',
146146
totalShortfallReceived: '0',
147147
},
148148
vaultManagerMetricsDailies: {
149-
path: 'published.vaultFactory.managers.manager1.metrics',
150-
liquidatingCollateralBrand: 'stATOM',
149+
path: 'published.vaultFactory.managers.manager0.metrics',
150+
liquidatingCollateralBrand: 'ATOM',
151151
liquidatingDebtBrand: 'IST',
152152
liquidatingCollateralValueLast: '0',
153153
liquidatingDebtValueLast: '0',
154154
lockedQuoteDenominatorLast: '0',
155155
lockedQuoteNumeratorLast: '0',
156-
numActiveVaultsLast: '0',
156+
numActiveVaultsLast: '7',
157157
numLiquidatingVaultsLast: '0',
158158
numLiquidationsAbortedLast: '0',
159159
numLiquidationsCompletedLast: '0',
160160
retainedCollateralLast: '0',
161-
totalCollateralLast: '0',
161+
totalCollateralLast: '5982000000',
162162
totalCollateralSoldLast: '0',
163-
totalDebtLast: '0',
163+
totalDebtLast: '35984025000',
164164
totalOverageReceivedLast: '0',
165165
totalProceedsReceivedLast: '0',
166166
totalShortfallReceivedLast: '0',

src/test/installBundleHandler.test.ts

+4-4
Large diffs are not rendered by default.

src/test/mappingHandlers.test.ts

+37-43
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,33 @@ import {
77
PsmGovernance,
88
PsmMetrics,
99
PsmMetricsDaily,
10-
ReserveAllocationMetrics,
11-
ReserveAllocationMetricsDaily,
12-
ReserveMetrics,
1310
StateChangeEvent,
1411
Vault,
15-
VaultManagerGovernance,
16-
VaultManagerMetrics,
17-
VaultManagerMetricsDaily,
1812
VaultStatesDaily,
1913
Wallet,
2014
} from '../types';
2115

2216
// FIXME observed in A3P:latest but not passing tests
2317
subqlTest(
24-
'StateChangeEvent in state_change at block 627',
25-
627,
18+
'StateChangeEvent in state_change at block 642',
19+
642,
2620
[],
2721
[
2822
new Wallet(
2923
'published.wallet.agoric1rwwley550k9mmk6uq6mm6z4udrg8kyuyvfszjk.current',
30-
BigInt(627),
31-
new Date('2024-12-09T23:07:18.273Z'),
24+
BigInt(642),
25+
new Date('2024-12-26T13:10:11.903Z'),
3226
'agoric1rwwley550k9mmk6uq6mm6z4udrg8kyuyvfszjk',
3327
),
3428
new StateChangeEvent(
35-
'627:39:3',
36-
BigInt(627),
37-
new Date('2024-12-09T23:07:18.273Z'),
29+
'642:39:3',
30+
BigInt(642),
31+
new Date('2024-12-26T13:10:11.903Z'),
3832
'published.wallet',
3933
'published.wallet.agoric1rwwley550k9mmk6uq6mm6z4udrg8kyuyvfszjk.current',
4034
3,
4135
'["board05557","board0257","board0074",null,"board05815","board00360"]',
42-
'{"liveOffers":[["openVault-1733785637736",{"id":"openVault-1733785637736","invitationSpec":{"callPipe":[["getCollateralManager",["$0.Alleged: ATOM brand"]],["makeVaultInvitation"]],"instancePath":["VaultFactory"],"source":"agoricContract"},"proposal":{"give":{"Collateral":{"brand":"$0","value":"+583000000","__brand":"ATOM","__value":"583000000"}},"want":{"Minted":{"brand":"$1.Alleged: IST brand","value":"+3489000000","__brand":"IST","__value":"3489000000"}}}}]],"offerToPublicSubscriberPaths":[["openVault-1733785637736",{"vault":"published.vaultFactory.managers.manager0.vaults.vault4"}]],"offerToUsedInvitation":[["openVault-1733785637736",{"brand":"$2.Alleged: Zoe Invitation brand","value":[{"description":"manager0: MakeVault","handle":"$3.Alleged: InvitationHandle","installation":"$4.Alleged: BundleIDInstallation","instance":"$5.Alleged: InstanceHandle","__handle":"InvitationHandle","__installation":"BundleIDInstallation","__instance":"InstanceHandle"}],"__brand":"Zoe Invitation"}]],"purses":[{"balance":{"brand":"$2","value":[],"__brand":"Zoe Invitation"},"brand":"$2","__brand":"Zoe Invitation"}]}',
36+
'{"liveOffers":[["openVault-1735218611466",{"id":"openVault-1735218611466","invitationSpec":{"callPipe":[["getCollateralManager",["$0.Alleged: ATOM brand"]],["makeVaultInvitation"]],"instancePath":["VaultFactory"],"source":"agoricContract"},"proposal":{"give":{"Collateral":{"brand":"$0","value":"+583000000","__brand":"ATOM","__value":"583000000"}},"want":{"Minted":{"brand":"$1.Alleged: IST brand","value":"+3489000000","__brand":"IST","__value":"3489000000"}}}}]],"offerToPublicSubscriberPaths":[["openVault-1735218611466",{"vault":"published.vaultFactory.managers.manager0.vaults.vault4"}]],"offerToUsedInvitation":[["openVault-1735218611466",{"brand":"$2.Alleged: Zoe Invitation brand","value":[{"description":"manager0: MakeVault","handle":"$3.Alleged: InvitationHandle","installation":"$4.Alleged: BundleIDInstallation","instance":"$5.Alleged: InstanceHandle","__handle":"InvitationHandle","__installation":"BundleIDInstallation","__instance":"InstanceHandle"}],"__brand":"Zoe Invitation"}]],"purses":[{"balance":{"brand":"$2","value":[],"__brand":"Zoe Invitation"},"brand":"$2","__brand":"Zoe Invitation"}]}',
4337
),
4438
],
4539

@@ -48,8 +42,8 @@ subqlTest(
4842

4943
const vault = new Vault(
5044
'published.vaultFactory.managers.manager0.vaults.vault6',
51-
BigInt(742),
52-
new Date('2024-12-09 23:13:19.186'),
45+
BigInt(758),
46+
new Date('2024-12-26T13:16:21.039'),
5347
'published.wallet.agoric1ee9hr0jyrxhy999y755mp862ljgycmwyp4pl7q.current',
5448
);
5549

@@ -61,15 +55,15 @@ vault.debt = BigInt(4745610000);
6155
vault.state = 'active';
6256

6357
subqlTest(
64-
'Vault and VaultStateDailies at height 742',
65-
742,
58+
'Vault and VaultStateDailies at height 758',
59+
758,
6660
[],
6761
[
6862
vault,
6963
new VaultStatesDaily(
70-
'20241209',
71-
BigInt(742),
72-
new Date('2024-12-09 23:13:19.186'),
64+
'20241226',
65+
BigInt(758),
66+
new Date('2024-12-26T13:16:21.039'),
7367
BigInt(1),
7468
BigInt(0),
7569
BigInt(0),
@@ -82,31 +76,31 @@ subqlTest(
8276
);
8377

8478
subqlTest(
85-
'BoardAux at block 643',
86-
643,
79+
'BoardAux at block 658',
80+
658,
8781
[],
8882
[
8983
new BoardAux(
9084
'published.boardAux.board0074',
91-
BigInt(643),
92-
new Date('2024-12-09T23:07:37.423Z'),
85+
BigInt(658),
86+
new Date('2024-12-26T13:10:30.706Z'),
9387
'Zoe Invitation',
9488
'set',
9589
0,
9690
),
9791
new BoardAux(
9892
'published.boardAux.board01744',
99-
BigInt(643),
100-
new Date('2024-12-09T23:07:37.423Z'),
93+
BigInt(658),
94+
new Date('2024-12-26T13:10:30.706Z'),
10195
'USDT_axl',
10296
'nat',
10397
6,
10498
),
105-
new BoardAux('published.boardAux.board0257', BigInt(643), new Date('2024-12-09T23:07:37.423Z'), 'IST', 'nat', 6),
99+
new BoardAux('published.boardAux.board0257', BigInt(658), new Date('2024-12-26T13:10:30.706Z'), 'IST', 'nat', 6),
106100
new BoardAux(
107101
'published.boardAux.board03040',
108-
BigInt(643),
109-
new Date('2024-12-09T23:07:37.423Z'),
102+
BigInt(658),
103+
new Date('2024-12-26T13:10:30.706Z'),
110104
'USDC_axl',
111105
'nat',
112106
6,
@@ -117,10 +111,10 @@ subqlTest(
117111
);
118112

119113
const oraclePriceDaily = new OraclePriceDaily(
120-
'ATOM-USD:20241209',
121-
20241209,
122-
BigInt(506),
123-
new Date('2024-12-09T23:03:17.000Z'),
114+
'ATOM-USD:20241226',
115+
20241226,
116+
BigInt(512),
117+
new Date('2024-12-26T13:05:53.000Z'),
124118
);
125119

126120
oraclePriceDaily.typeInAmountLast = BigInt(1000000);
@@ -133,8 +127,8 @@ oraclePriceDaily.metricsCount = BigInt(1);
133127

134128
const oraclePrice = new OraclePrice(
135129
'ATOM-USD',
136-
BigInt(506),
137-
new Date('2024-12-09T23:03:17.564Z'),
130+
BigInt(512),
131+
new Date('2024-12-26T13:05:53.914Z'),
138132
'ATOM-USD',
139133
BigInt(1000000),
140134
BigInt(12010000),
@@ -143,20 +137,20 @@ const oraclePrice = new OraclePrice(
143137
);
144138

145139
subqlTest(
146-
'oraclePrice at block 506',
147-
506,
140+
'oraclePrice at block 512',
141+
512,
148142
[],
149143
[oraclePriceDaily, oraclePrice],
150144

151145
'handleStateChangeEvent',
152146
);
153147

154148
const psmMetricsDaily = new PsmMetricsDaily(
155-
'published.psm.IST.USDC_axl.metrics:20241207',
149+
'published.psm.IST.USDC_axl.metrics:20241226',
156150
'published.psm.IST.USDC_axl.metrics',
157-
20241207,
151+
20241226,
158152
BigInt(35),
159-
new Date('2024-12-07T02:03:32.000Z'),
153+
new Date('2024-12-26T12:49:56.000'),
160154
);
161155

162156
psmMetricsDaily.denom = 'USDC_axl';
@@ -170,7 +164,7 @@ psmMetricsDaily.metricsCount = BigInt(1);
170164
const psmMetrics = new PsmMetrics(
171165
'published.psm.IST.USDC_axl.metrics',
172166
BigInt(35),
173-
new Date('2024-12-07T02:03:32.920Z'),
167+
new Date('2024-12-26T12:49:56.863'),
174168
'USDC_axl',
175169
'USDC_axl',
176170
BigInt(0),
@@ -185,7 +179,7 @@ subqlTest('psmMetrics at block 35', 35, [], [psmMetricsDaily, psmMetrics], 'hand
185179
const psmGovernance = new PsmGovernance(
186180
'published.psm.IST.USDT_axl.governance',
187181
BigInt(35),
188-
new Date('2024-12-07T02:03:32.920Z'),
182+
new Date('2024-12-26T12:49:56.863'),
189183
'USDT_axl',
190184
'USDT_axl',
191185
BigInt(1000000000),

0 commit comments

Comments
 (0)