@cardano-sdk/e2e 0.36.10 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +2 -1
- package/CHANGELOG.md +31 -0
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/cjs/util/util.d.ts.map +1 -1
- package/dist/cjs/util/util.js +3 -0
- package/dist/cjs/util/util.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/util/util.d.ts.map +1 -1
- package/dist/esm/util/util.js +3 -0
- package/dist/esm/util/util.js.map +1 -1
- package/docker-compose.yml +1 -0
- package/local-network/Dockerfile +20 -18
- package/local-network/scripts/install.sh +3 -3
- package/local-network/scripts/make-babbage.sh +8 -2
- package/local-network/scripts/pools/update-node-utils.sh +226 -159
- package/local-network/scripts/setup-new-delegator-keys.sh +2 -1
- package/local-network/scripts/start.sh +2 -0
- package/local-network/templates/babbage/alonzo-babbage-test-genesis.json +11 -1
- package/local-network/templates/babbage/conway-babbage-test-genesis.json +281 -22
- package/local-network/templates/babbage/db-sync-config.json +1 -0
- package/package.json +21 -21
- package/src/util/util.ts +3 -0
- package/test/wallet_epoch_0/PersonalWallet/txChainHistory.test.ts +2 -2
- package/test/{wallet_epoch_0 → wallet_epoch_3}/PersonalWallet/conwayTransactions.test.ts +104 -26
|
@@ -1,38 +1,297 @@
|
|
|
1
1
|
{
|
|
2
2
|
"poolVotingThresholds": {
|
|
3
|
-
"committeeNormal": 0.
|
|
4
|
-
"committeeNoConfidence": 0.
|
|
3
|
+
"committeeNormal": 0.65,
|
|
4
|
+
"committeeNoConfidence": 0.65,
|
|
5
5
|
"hardForkInitiation": 0.51,
|
|
6
|
-
"motionNoConfidence": 0.
|
|
7
|
-
"ppSecurityGroup": 0.
|
|
6
|
+
"motionNoConfidence": 0.6,
|
|
7
|
+
"ppSecurityGroup": 0.6
|
|
8
8
|
},
|
|
9
9
|
"dRepVotingThresholds": {
|
|
10
|
-
"motionNoConfidence": 0.
|
|
11
|
-
"committeeNormal": 0.
|
|
12
|
-
"committeeNoConfidence": 0.
|
|
13
|
-
"updateToConstitution": 0.
|
|
14
|
-
"hardForkInitiation": 0.
|
|
15
|
-
"ppNetworkGroup": 0.
|
|
16
|
-
"ppEconomicGroup": 0.
|
|
17
|
-
"ppTechnicalGroup": 0.
|
|
18
|
-
"ppGovGroup": 0.
|
|
19
|
-
"treasuryWithdrawal": 0.
|
|
10
|
+
"motionNoConfidence": 0.67,
|
|
11
|
+
"committeeNormal": 0.67,
|
|
12
|
+
"committeeNoConfidence": 0.65,
|
|
13
|
+
"updateToConstitution": 0.75,
|
|
14
|
+
"hardForkInitiation": 0.6,
|
|
15
|
+
"ppNetworkGroup": 0.67,
|
|
16
|
+
"ppEconomicGroup": 0.67,
|
|
17
|
+
"ppTechnicalGroup": 0.67,
|
|
18
|
+
"ppGovGroup": 0.75,
|
|
19
|
+
"treasuryWithdrawal": 0.67
|
|
20
20
|
},
|
|
21
|
-
"committeeMinSize":
|
|
22
|
-
"committeeMaxTermLength":
|
|
23
|
-
"govActionLifetime":
|
|
24
|
-
"govActionDeposit":
|
|
25
|
-
"dRepDeposit":
|
|
21
|
+
"committeeMinSize": 5,
|
|
22
|
+
"committeeMaxTermLength": 146,
|
|
23
|
+
"govActionLifetime": 14,
|
|
24
|
+
"govActionDeposit": 100000000000,
|
|
25
|
+
"dRepDeposit": 500000000,
|
|
26
26
|
"dRepActivity": 20,
|
|
27
|
+
"minFeeRefScriptCostPerByte": 15,
|
|
28
|
+
"plutusV3CostModel": [
|
|
29
|
+
100788,
|
|
30
|
+
420,
|
|
31
|
+
1,
|
|
32
|
+
1,
|
|
33
|
+
1000,
|
|
34
|
+
173,
|
|
35
|
+
0,
|
|
36
|
+
1,
|
|
37
|
+
1000,
|
|
38
|
+
59957,
|
|
39
|
+
4,
|
|
40
|
+
1,
|
|
41
|
+
11183,
|
|
42
|
+
32,
|
|
43
|
+
201305,
|
|
44
|
+
8356,
|
|
45
|
+
4,
|
|
46
|
+
16000,
|
|
47
|
+
100,
|
|
48
|
+
16000,
|
|
49
|
+
100,
|
|
50
|
+
16000,
|
|
51
|
+
100,
|
|
52
|
+
16000,
|
|
53
|
+
100,
|
|
54
|
+
16000,
|
|
55
|
+
100,
|
|
56
|
+
16000,
|
|
57
|
+
100,
|
|
58
|
+
100,
|
|
59
|
+
100,
|
|
60
|
+
16000,
|
|
61
|
+
100,
|
|
62
|
+
94375,
|
|
63
|
+
32,
|
|
64
|
+
132994,
|
|
65
|
+
32,
|
|
66
|
+
61462,
|
|
67
|
+
4,
|
|
68
|
+
72010,
|
|
69
|
+
178,
|
|
70
|
+
0,
|
|
71
|
+
1,
|
|
72
|
+
22151,
|
|
73
|
+
32,
|
|
74
|
+
91189,
|
|
75
|
+
769,
|
|
76
|
+
4,
|
|
77
|
+
2,
|
|
78
|
+
85848,
|
|
79
|
+
123203,
|
|
80
|
+
7305,
|
|
81
|
+
-900,
|
|
82
|
+
1716,
|
|
83
|
+
549,
|
|
84
|
+
57,
|
|
85
|
+
85848,
|
|
86
|
+
0,
|
|
87
|
+
1,
|
|
88
|
+
1,
|
|
89
|
+
1000,
|
|
90
|
+
42921,
|
|
91
|
+
4,
|
|
92
|
+
2,
|
|
93
|
+
24548,
|
|
94
|
+
29498,
|
|
95
|
+
38,
|
|
96
|
+
1,
|
|
97
|
+
898148,
|
|
98
|
+
27279,
|
|
99
|
+
1,
|
|
100
|
+
51775,
|
|
101
|
+
558,
|
|
102
|
+
1,
|
|
103
|
+
39184,
|
|
104
|
+
1000,
|
|
105
|
+
60594,
|
|
106
|
+
1,
|
|
107
|
+
141895,
|
|
108
|
+
32,
|
|
109
|
+
83150,
|
|
110
|
+
32,
|
|
111
|
+
15299,
|
|
112
|
+
32,
|
|
113
|
+
76049,
|
|
114
|
+
1,
|
|
115
|
+
13169,
|
|
116
|
+
4,
|
|
117
|
+
22100,
|
|
118
|
+
10,
|
|
119
|
+
28999,
|
|
120
|
+
74,
|
|
121
|
+
1,
|
|
122
|
+
28999,
|
|
123
|
+
74,
|
|
124
|
+
1,
|
|
125
|
+
43285,
|
|
126
|
+
552,
|
|
127
|
+
1,
|
|
128
|
+
44749,
|
|
129
|
+
541,
|
|
130
|
+
1,
|
|
131
|
+
33852,
|
|
132
|
+
32,
|
|
133
|
+
68246,
|
|
134
|
+
32,
|
|
135
|
+
72362,
|
|
136
|
+
32,
|
|
137
|
+
7243,
|
|
138
|
+
32,
|
|
139
|
+
7391,
|
|
140
|
+
32,
|
|
141
|
+
11546,
|
|
142
|
+
32,
|
|
143
|
+
85848,
|
|
144
|
+
123203,
|
|
145
|
+
7305,
|
|
146
|
+
-900,
|
|
147
|
+
1716,
|
|
148
|
+
549,
|
|
149
|
+
57,
|
|
150
|
+
85848,
|
|
151
|
+
0,
|
|
152
|
+
1,
|
|
153
|
+
90434,
|
|
154
|
+
519,
|
|
155
|
+
0,
|
|
156
|
+
1,
|
|
157
|
+
74433,
|
|
158
|
+
32,
|
|
159
|
+
85848,
|
|
160
|
+
123203,
|
|
161
|
+
7305,
|
|
162
|
+
-900,
|
|
163
|
+
1716,
|
|
164
|
+
549,
|
|
165
|
+
57,
|
|
166
|
+
85848,
|
|
167
|
+
0,
|
|
168
|
+
1,
|
|
169
|
+
1,
|
|
170
|
+
85848,
|
|
171
|
+
123203,
|
|
172
|
+
7305,
|
|
173
|
+
-900,
|
|
174
|
+
1716,
|
|
175
|
+
549,
|
|
176
|
+
57,
|
|
177
|
+
85848,
|
|
178
|
+
0,
|
|
179
|
+
1,
|
|
180
|
+
955506,
|
|
181
|
+
213312,
|
|
182
|
+
0,
|
|
183
|
+
2,
|
|
184
|
+
270652,
|
|
185
|
+
22588,
|
|
186
|
+
4,
|
|
187
|
+
1457325,
|
|
188
|
+
64566,
|
|
189
|
+
4,
|
|
190
|
+
20467,
|
|
191
|
+
1,
|
|
192
|
+
4,
|
|
193
|
+
0,
|
|
194
|
+
141992,
|
|
195
|
+
32,
|
|
196
|
+
100788,
|
|
197
|
+
420,
|
|
198
|
+
1,
|
|
199
|
+
1,
|
|
200
|
+
81663,
|
|
201
|
+
32,
|
|
202
|
+
59498,
|
|
203
|
+
32,
|
|
204
|
+
20142,
|
|
205
|
+
32,
|
|
206
|
+
24588,
|
|
207
|
+
32,
|
|
208
|
+
20744,
|
|
209
|
+
32,
|
|
210
|
+
25933,
|
|
211
|
+
32,
|
|
212
|
+
24623,
|
|
213
|
+
32,
|
|
214
|
+
43053543,
|
|
215
|
+
10,
|
|
216
|
+
53384111,
|
|
217
|
+
14333,
|
|
218
|
+
10,
|
|
219
|
+
43574283,
|
|
220
|
+
26308,
|
|
221
|
+
10,
|
|
222
|
+
16000,
|
|
223
|
+
100,
|
|
224
|
+
16000,
|
|
225
|
+
100,
|
|
226
|
+
962335,
|
|
227
|
+
18,
|
|
228
|
+
2780678,
|
|
229
|
+
6,
|
|
230
|
+
442008,
|
|
231
|
+
1,
|
|
232
|
+
52538055,
|
|
233
|
+
3756,
|
|
234
|
+
18,
|
|
235
|
+
267929,
|
|
236
|
+
18,
|
|
237
|
+
76433006,
|
|
238
|
+
8868,
|
|
239
|
+
18,
|
|
240
|
+
52948122,
|
|
241
|
+
18,
|
|
242
|
+
1995836,
|
|
243
|
+
36,
|
|
244
|
+
3227919,
|
|
245
|
+
12,
|
|
246
|
+
901022,
|
|
247
|
+
1,
|
|
248
|
+
166917843,
|
|
249
|
+
4307,
|
|
250
|
+
36,
|
|
251
|
+
284546,
|
|
252
|
+
36,
|
|
253
|
+
158221314,
|
|
254
|
+
26549,
|
|
255
|
+
36,
|
|
256
|
+
74698472,
|
|
257
|
+
36,
|
|
258
|
+
333849714,
|
|
259
|
+
1,
|
|
260
|
+
254006273,
|
|
261
|
+
72,
|
|
262
|
+
2174038,
|
|
263
|
+
72,
|
|
264
|
+
2261318,
|
|
265
|
+
64571,
|
|
266
|
+
4,
|
|
267
|
+
207616,
|
|
268
|
+
8310,
|
|
269
|
+
4,
|
|
270
|
+
1293828,
|
|
271
|
+
28716,
|
|
272
|
+
63,
|
|
273
|
+
0,
|
|
274
|
+
1,
|
|
275
|
+
1006041,
|
|
276
|
+
43623,
|
|
277
|
+
251,
|
|
278
|
+
0,
|
|
279
|
+
1
|
|
280
|
+
],
|
|
27
281
|
"constitution": {
|
|
28
282
|
"anchor": {
|
|
29
|
-
"url": "",
|
|
30
|
-
"dataHash": "
|
|
283
|
+
"url": "ipfs://QmQq5hWDNzvDR1ForEktAHrdCQmfSL2u5yctNpzDwoSBu4",
|
|
284
|
+
"dataHash": "23b43bebac48a4acc39e578715aa06635d6d900fa3ea7441dfffd6e43b914f7b"
|
|
31
285
|
}
|
|
32
286
|
},
|
|
33
287
|
"committee": {
|
|
34
288
|
"members": {
|
|
289
|
+
"scriptHash-7ceede7d6a89e006408e6b7c6acb3dd094b3f6817e43b4a36d01535b": 500,
|
|
290
|
+
"scriptHash-6095e643ea6f1cccb6e463ec34349026b3a48621aac5d512655ab1bf": 500,
|
|
291
|
+
"scriptHash-27999ed757d6dac217471ae61d69b1b067b8b240d9e3ff36eb66b5d0": 500,
|
|
292
|
+
"scriptHash-87f867a31c0f81360d4d7dcddb6b025ba8383db9bf77a2af7797799d": 500,
|
|
293
|
+
"scriptHash-a19a7ba1caede8f3ab3e5e2a928b3798d7d011af18fbd577f7aeb0ec": 500
|
|
35
294
|
},
|
|
36
|
-
"
|
|
295
|
+
"threshold": 0.67
|
|
37
296
|
}
|
|
38
297
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cardano-sdk/e2e",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "End to end tests for the cardano-js-sdk packages.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16.20.2"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"test:web-extension:watch": "run-s test:web-extension:build test:web-extension:watch:bg",
|
|
48
48
|
"test:web-extension:watch:bg": "run-p test:web-extension:watch:build test:web-extension:watch:run",
|
|
49
49
|
"test:ws": "jest -c jest.config.js --forceExit --selectProjects ws-server --runInBand --verbose",
|
|
50
|
-
"local-network:common": "
|
|
50
|
+
"local-network:common": "DISABLE_DB_CACHE=${DISABLE_DB_CACHE:-true} SUBMIT_API_ARGS='--testnet-magic 888' USE_BLOCKFROST=false __FIX_UMASK__=$(chmod -R a+r ../../compose/placeholder-secrets) docker compose --env-file ../cardano-services/environments/.env.local -p local-network-e2e -f docker-compose.yml -f ../../compose/common.yml -f ../../compose/$(uname -m).yml $FILES up",
|
|
51
51
|
"local-network:up": "FILES='' yarn local-network:common",
|
|
52
52
|
"local-network:single:up": "FILES='' yarn local-network:common cardano-node file-server local-testnet ogmios postgres",
|
|
53
53
|
"local-network:profile:up": "FILES='-f ../../compose/pg-agent.yml' yarn local-network:common",
|
|
@@ -80,21 +80,21 @@
|
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
82
|
"@cardano-foundation/ledgerjs-hw-app-cardano": "^7.1.2",
|
|
83
|
-
"@cardano-ogmios/client": "6.
|
|
84
|
-
"@cardano-sdk/cardano-services": "~0.
|
|
85
|
-
"@cardano-sdk/cardano-services-client": "~0.19.
|
|
86
|
-
"@cardano-sdk/core": "~0.
|
|
87
|
-
"@cardano-sdk/crypto": "~0.1.
|
|
88
|
-
"@cardano-sdk/hardware-ledger": "~0.10.
|
|
89
|
-
"@cardano-sdk/hardware-trezor": "~0.4.
|
|
90
|
-
"@cardano-sdk/input-selection": "~0.13.
|
|
91
|
-
"@cardano-sdk/key-management": "~0.21.
|
|
92
|
-
"@cardano-sdk/ogmios": "~0.
|
|
93
|
-
"@cardano-sdk/tx-construction": "~0.19.
|
|
83
|
+
"@cardano-ogmios/client": "6.5.0",
|
|
84
|
+
"@cardano-sdk/cardano-services": "~0.29.0",
|
|
85
|
+
"@cardano-sdk/cardano-services-client": "~0.19.15",
|
|
86
|
+
"@cardano-sdk/core": "~0.36.0",
|
|
87
|
+
"@cardano-sdk/crypto": "~0.1.29",
|
|
88
|
+
"@cardano-sdk/hardware-ledger": "~0.10.2",
|
|
89
|
+
"@cardano-sdk/hardware-trezor": "~0.4.36",
|
|
90
|
+
"@cardano-sdk/input-selection": "~0.13.9",
|
|
91
|
+
"@cardano-sdk/key-management": "~0.21.2",
|
|
92
|
+
"@cardano-sdk/ogmios": "~0.16.0",
|
|
93
|
+
"@cardano-sdk/tx-construction": "~0.19.9",
|
|
94
94
|
"@cardano-sdk/util": "~0.15.4",
|
|
95
|
-
"@cardano-sdk/util-dev": "~0.
|
|
96
|
-
"@cardano-sdk/util-rxjs": "~0.7.
|
|
97
|
-
"@cardano-sdk/wallet": "~0.
|
|
95
|
+
"@cardano-sdk/util-dev": "~0.22.0",
|
|
96
|
+
"@cardano-sdk/util-rxjs": "~0.7.22",
|
|
97
|
+
"@cardano-sdk/wallet": "~0.40.0",
|
|
98
98
|
"@dcspark/cardano-multiplatform-lib-nodejs": "^3.1.1",
|
|
99
99
|
"@vespaiach/axios-fetch-adapter": "^0.3.0",
|
|
100
100
|
"axios": "^0.28.0",
|
|
@@ -124,10 +124,10 @@
|
|
|
124
124
|
"@babel/core": "^7.18.2",
|
|
125
125
|
"@babel/preset-env": "^7.18.2",
|
|
126
126
|
"@babel/preset-typescript": "^7.17.12",
|
|
127
|
-
"@cardano-sdk/dapp-connector": "~0.12.
|
|
128
|
-
"@cardano-sdk/projection": "~0.11.
|
|
129
|
-
"@cardano-sdk/projection-typeorm": "~0.8.
|
|
130
|
-
"@cardano-sdk/web-extension": "~0.29.
|
|
127
|
+
"@cardano-sdk/dapp-connector": "~0.12.27",
|
|
128
|
+
"@cardano-sdk/projection": "~0.11.26",
|
|
129
|
+
"@cardano-sdk/projection-typeorm": "~0.8.28",
|
|
130
|
+
"@cardano-sdk/web-extension": "~0.29.11",
|
|
131
131
|
"@dcspark/cardano-multiplatform-lib-browser": "^3.1.1",
|
|
132
132
|
"@emurgo/cardano-message-signing-asmjs": "^1.0.1",
|
|
133
133
|
"@types/bunyan": "^1.8.8",
|
|
@@ -181,5 +181,5 @@
|
|
|
181
181
|
"webpack-cli": "^4.9.2",
|
|
182
182
|
"webpack-merge": "^5.8.0"
|
|
183
183
|
},
|
|
184
|
-
"gitHead": "
|
|
184
|
+
"gitHead": "2181645577a4cc7ed7597ce9cfb62b72bb32301e"
|
|
185
185
|
}
|
package/src/util/util.ts
CHANGED
|
@@ -83,6 +83,9 @@ export const normalizeTxBody = (body: Cardano.HydratedTxBody | Cardano.TxBody) =
|
|
|
83
83
|
dehydratedTx.inputs = sortTxIn(dehydratedTx.inputs);
|
|
84
84
|
dehydratedTx.collaterals = sortTxIn(dehydratedTx.collaterals);
|
|
85
85
|
dehydratedTx.referenceInputs = sortTxIn(dehydratedTx.referenceInputs);
|
|
86
|
+
if (dehydratedTx.withdrawals) {
|
|
87
|
+
dehydratedTx.withdrawals = sortBy(dehydratedTx.withdrawals, ['stakeAddress']);
|
|
88
|
+
}
|
|
86
89
|
|
|
87
90
|
return dehydratedTx;
|
|
88
91
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseWallet } from '@cardano-sdk/wallet';
|
|
2
|
-
import { Cardano, CardanoNodeUtil
|
|
2
|
+
import { Cardano, CardanoNodeUtil } from '@cardano-sdk/core';
|
|
3
3
|
import { filter, firstValueFrom, map, take } from 'rxjs';
|
|
4
4
|
import { getEnv, getWallet, normalizeTxBody, walletReady, walletVariables } from '../../../src';
|
|
5
5
|
import { isNotNil } from '@cardano-sdk/util';
|
|
@@ -77,7 +77,7 @@ describe('PersonalWallet/txChainHistory', () => {
|
|
|
77
77
|
// Submit the same transaction again.
|
|
78
78
|
await wallet.submitTx(signedTx);
|
|
79
79
|
} catch (error) {
|
|
80
|
-
if (error
|
|
80
|
+
if (CardanoNodeUtil.isProviderError(error)) {
|
|
81
81
|
expect(CardanoNodeUtil.isValueNotConservedError(error?.innerError)).toBeTruthy();
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -24,6 +24,7 @@ const {
|
|
|
24
24
|
CertificateType,
|
|
25
25
|
CredentialType,
|
|
26
26
|
GovernanceActionType,
|
|
27
|
+
PlutusLanguageVersion,
|
|
27
28
|
RewardAccount,
|
|
28
29
|
StakeCredentialStatus,
|
|
29
30
|
StakePoolStatus,
|
|
@@ -49,8 +50,84 @@ const getTestWallet = async (idx: number, name: string, minCoinBalance?: bigint)
|
|
|
49
50
|
return wallet;
|
|
50
51
|
};
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
export const vasilPlutusV1Costmdls = [
|
|
54
|
+
205_665, 812, 1, 1, 1000, 571, 0, 1, 1000, 24_177, 4, 1, 1000, 32, 117_366, 10_475, 4, 23_000, 100, 23_000, 100,
|
|
55
|
+
23_000, 100, 23_000, 100, 23_000, 100, 23_000, 100, 100, 100, 23_000, 100, 19_537, 32, 175_354, 32, 46_417, 4,
|
|
56
|
+
221_973, 511, 0, 1, 89_141, 32, 497_525, 14_068, 4, 2, 196_500, 453_240, 220, 0, 1, 1, 1000, 28_662, 4, 2, 245_000,
|
|
57
|
+
216_773, 62, 1, 1_060_367, 12_586, 1, 208_512, 421, 1, 187_000, 1000, 52_998, 1, 80_436, 32, 43_249, 32, 1000, 32,
|
|
58
|
+
80_556, 1, 57_667, 4, 1000, 10, 197_145, 156, 1, 197_145, 156, 1, 204_924, 473, 1, 208_896, 511, 1, 52_467, 32,
|
|
59
|
+
64_832, 32, 65_493, 32, 22_558, 32, 16_563, 32, 76_511, 32, 196_500, 453_240, 220, 0, 1, 1, 69_522, 11_687, 0, 1,
|
|
60
|
+
60_091, 32, 196_500, 453_240, 220, 0, 1, 1, 196_500, 453_240, 220, 0, 1, 1, 806_990, 30_482, 4, 1_927_926, 82_523, 4,
|
|
61
|
+
265_318, 0, 4, 0, 85_931, 32, 205_665, 812, 1, 1, 41_182, 32, 212_342, 32, 31_220, 32, 32_696, 32, 43_357, 32, 32_247,
|
|
62
|
+
32, 38_314, 32, 57_996_947, 18_975, 10
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
export const vasilPlutusV2Costmdls = [
|
|
66
|
+
205_665, 812, 1, 1, 1000, 571, 0, 1, 1000, 24_177, 4, 1, 1000, 32, 117_366, 10_475, 4, 23_000, 100, 23_000, 100,
|
|
67
|
+
23_000, 100, 23_000, 100, 23_000, 100, 23_000, 100, 100, 100, 23_000, 100, 19_537, 32, 175_354, 32, 46_417, 4,
|
|
68
|
+
221_973, 511, 0, 1, 89_141, 32, 497_525, 14_068, 4, 2, 196_500, 453_240, 220, 0, 1, 1, 1000, 28_662, 4, 2, 245_000,
|
|
69
|
+
216_773, 62, 1, 1_060_367, 12_586, 1, 208_512, 421, 1, 187_000, 1000, 52_998, 1, 80_436, 32, 43_249, 32, 1000, 32,
|
|
70
|
+
80_556, 1, 57_667, 4, 1000, 10, 197_145, 156, 1, 197_145, 156, 1, 204_924, 473, 1, 208_896, 511, 1, 52_467, 32,
|
|
71
|
+
64_832, 32, 65_493, 32, 22_558, 32, 16_563, 32, 76_511, 32, 196_500, 453_240, 220, 0, 1, 1, 69_522, 11_687, 0, 1,
|
|
72
|
+
60_091, 32, 196_500, 453_240, 220, 0, 1, 1, 196_500, 453_240, 220, 0, 1, 1, 1_159_724, 392_670, 0, 2, 806_990, 30_482,
|
|
73
|
+
4, 1_927_926, 82_523, 4, 265_318, 0, 4, 0, 85_931, 32, 205_665, 812, 1, 1, 41_182, 32, 212_342, 32, 31_220, 32,
|
|
74
|
+
32_696, 32, 43_357, 32, 32_247, 32, 38_314, 32, 35_892_428, 10, 57_996_947, 18_975, 10, 38_887_044, 32_947, 10
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
export const paramsUpdate: Cardano.ProtocolParametersUpdateConway = {
|
|
78
|
+
coinsPerUtxoByte: 35_000,
|
|
79
|
+
collateralPercentage: 852,
|
|
80
|
+
committeeTermLimit: Cardano.EpochNo(200),
|
|
81
|
+
costModels: new Map([
|
|
82
|
+
[PlutusLanguageVersion.V1, vasilPlutusV1Costmdls],
|
|
83
|
+
[PlutusLanguageVersion.V2, vasilPlutusV2Costmdls]
|
|
84
|
+
]),
|
|
85
|
+
dRepDeposit: 2000,
|
|
86
|
+
dRepInactivityPeriod: Cardano.EpochNo(5000),
|
|
87
|
+
dRepVotingThresholds: {
|
|
88
|
+
committeeNoConfidence: { denominator: 3, numerator: 1 },
|
|
89
|
+
committeeNormal: { denominator: 3, numerator: 1 },
|
|
90
|
+
hardForkInitiation: { denominator: 7, numerator: 4 },
|
|
91
|
+
motionNoConfidence: { denominator: 3, numerator: 1 },
|
|
92
|
+
ppEconomicGroup: { denominator: 7, numerator: 6 },
|
|
93
|
+
ppGovernanceGroup: { denominator: 7, numerator: 6 },
|
|
94
|
+
ppNetworkGroup: { denominator: 7, numerator: 6 },
|
|
95
|
+
ppTechnicalGroup: { denominator: 7, numerator: 6 },
|
|
96
|
+
treasuryWithdrawal: { denominator: 7, numerator: 6 },
|
|
97
|
+
updateConstitution: { denominator: 7, numerator: 6 }
|
|
98
|
+
},
|
|
99
|
+
desiredNumberOfPools: 900,
|
|
100
|
+
governanceActionDeposit: 1000,
|
|
101
|
+
governanceActionValidityPeriod: Cardano.EpochNo(1_000_000),
|
|
102
|
+
maxBlockBodySize: 300,
|
|
103
|
+
maxBlockHeaderSize: 500,
|
|
104
|
+
maxCollateralInputs: 100,
|
|
105
|
+
maxExecutionUnitsPerBlock: { memory: 4_294_967_296, steps: 4_294_967_296 },
|
|
106
|
+
maxExecutionUnitsPerTransaction: { memory: 4_294_967_296, steps: 4_294_967_296 },
|
|
107
|
+
maxTxSize: 400,
|
|
108
|
+
maxValueSize: 954,
|
|
109
|
+
minCommitteeSize: 100,
|
|
110
|
+
minFeeCoefficient: 100,
|
|
111
|
+
minFeeConstant: 200,
|
|
112
|
+
minFeeRefScriptCostPerByte: '44.5',
|
|
113
|
+
minPoolCost: 1000,
|
|
114
|
+
monetaryExpansion: '0.3333333333333333',
|
|
115
|
+
poolDeposit: 200_000_000,
|
|
116
|
+
poolInfluence: '0.5',
|
|
117
|
+
poolRetirementEpochBound: 800,
|
|
118
|
+
poolVotingThresholds: {
|
|
119
|
+
committeeNoConfidence: { denominator: 3, numerator: 1 },
|
|
120
|
+
committeeNormal: { denominator: 3, numerator: 1 },
|
|
121
|
+
hardForkInitiation: { denominator: 7, numerator: 6 },
|
|
122
|
+
motionNoConfidence: { denominator: 3, numerator: 1 },
|
|
123
|
+
securityRelevantParamVotingThreshold: { denominator: 3, numerator: 1 }
|
|
124
|
+
},
|
|
125
|
+
prices: { memory: 0.5, steps: 0.5 },
|
|
126
|
+
stakeKeyDeposit: 2_000_000,
|
|
127
|
+
treasuryExpansion: '0.25'
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
describe('PersonalWallet/conwayTransactions', () => {
|
|
54
131
|
let dRepWallet: BaseWallet;
|
|
55
132
|
let wallet: BaseWallet;
|
|
56
133
|
|
|
@@ -79,8 +156,8 @@ describe.skip('PersonalWallet/conwayTransactions', () => {
|
|
|
79
156
|
const protocolParameters = await wallet.networkInfoProvider.protocolParameters();
|
|
80
157
|
|
|
81
158
|
return [
|
|
82
|
-
BigInt(protocolParameters.dRepDeposit),
|
|
83
|
-
BigInt(protocolParameters.governanceActionDeposit),
|
|
159
|
+
BigInt(protocolParameters.dRepDeposit!),
|
|
160
|
+
BigInt(protocolParameters.governanceActionDeposit!),
|
|
84
161
|
BigInt(protocolParameters.stakeKeyDeposit)
|
|
85
162
|
];
|
|
86
163
|
};
|
|
@@ -103,22 +180,20 @@ describe.skip('PersonalWallet/conwayTransactions', () => {
|
|
|
103
180
|
};
|
|
104
181
|
};
|
|
105
182
|
|
|
106
|
-
// TODO LW-10555: Revert this to feed the dRep wallet, not the `wallet`, once the dbsync bug is fixed
|
|
107
|
-
// https://github.com/IntersectMBO/cardano-db-sync/issues/1702
|
|
108
183
|
const feedDRepWallet = async (amount: bigint) => {
|
|
109
|
-
const balance = await firstValueFrom(
|
|
184
|
+
const balance = await firstValueFrom(dRepWallet.balance.utxo.total$);
|
|
110
185
|
|
|
111
186
|
if (balance.coins > amount) return;
|
|
112
187
|
|
|
113
|
-
const address = await firstValueFrom(
|
|
188
|
+
const address = await firstValueFrom(dRepWallet.addresses$.pipe(map((addresses) => addresses[0].address)));
|
|
114
189
|
|
|
115
|
-
const signedTx = await
|
|
190
|
+
const signedTx = await wallet
|
|
116
191
|
.createTxBuilder()
|
|
117
192
|
.addOutput({ address, value: { coins: amount } })
|
|
118
193
|
.build()
|
|
119
194
|
.sign();
|
|
120
195
|
|
|
121
|
-
await submitAndConfirm(
|
|
196
|
+
await submitAndConfirm(wallet, signedTx.tx, 1);
|
|
122
197
|
};
|
|
123
198
|
|
|
124
199
|
const sendDRepRegCert = async (register: boolean) => {
|
|
@@ -161,21 +236,18 @@ describe.skip('PersonalWallet/conwayTransactions', () => {
|
|
|
161
236
|
};
|
|
162
237
|
|
|
163
238
|
beforeAll(async () => {
|
|
239
|
+
// TODO: remove once mainnet hardforks to conway-era, and this becomes "the norm"
|
|
164
240
|
setInConwayEra(true);
|
|
165
241
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
getTestWallet(0, 'Conway DRep Wallet', 100_000_000n),
|
|
170
|
-
getTestWallet(1, 'Conway Wallet', 0n)
|
|
242
|
+
[wallet, dRepWallet] = await Promise.all([
|
|
243
|
+
getTestWallet(0, 'Conway Wallet', 100_000_000n),
|
|
244
|
+
getTestWallet(1, 'Conway DRep Wallet', 0n)
|
|
171
245
|
]);
|
|
172
246
|
|
|
173
247
|
[dRepCredential, [dRepDeposit, governanceActionDeposit, stakeKeyDeposit], poolId, stakeCredential] =
|
|
174
248
|
await Promise.all([getDRepCredential(), getDeposits(), getPoolId(), getStakeCredential()]);
|
|
175
249
|
|
|
176
|
-
|
|
177
|
-
// https://github.com/IntersectMBO/cardano-db-sync/issues/1702
|
|
178
|
-
await feedDRepWallet(governanceActionDeposit * 6n + 100_000_000n);
|
|
250
|
+
await feedDRepWallet(dRepDeposit * 2n);
|
|
179
251
|
|
|
180
252
|
if (!(await isRegisteredDRep())) await sendDRepRegCert(true);
|
|
181
253
|
});
|
|
@@ -189,6 +261,7 @@ describe.skip('PersonalWallet/conwayTransactions', () => {
|
|
|
189
261
|
wallet.shutdown();
|
|
190
262
|
dRepWallet.shutdown();
|
|
191
263
|
|
|
264
|
+
// TODO: remove once mainnet hardforks to conway-era, and this becomes "the norm"
|
|
192
265
|
setInConwayEra(false);
|
|
193
266
|
});
|
|
194
267
|
|
|
@@ -374,9 +447,11 @@ describe.skip('PersonalWallet/conwayTransactions', () => {
|
|
|
374
447
|
|
|
375
448
|
describe('with proposal procedure', () => {
|
|
376
449
|
let actionId: Cardano.GovernanceActionId;
|
|
450
|
+
let confirmedTx: Cardano.HydratedTx;
|
|
451
|
+
let proposalProcedures: Cardano.ProposalProcedure[];
|
|
377
452
|
|
|
378
453
|
beforeAll(async () => {
|
|
379
|
-
|
|
454
|
+
proposalProcedures = [
|
|
380
455
|
{
|
|
381
456
|
anchor,
|
|
382
457
|
deposit: governanceActionDeposit,
|
|
@@ -384,7 +459,7 @@ describe.skip('PersonalWallet/conwayTransactions', () => {
|
|
|
384
459
|
__typename: GovernanceActionType.parameter_change_action,
|
|
385
460
|
governanceActionId: null,
|
|
386
461
|
policyHash: null,
|
|
387
|
-
protocolParamUpdate: {
|
|
462
|
+
protocolParamUpdate: { ...paramsUpdate }
|
|
388
463
|
},
|
|
389
464
|
rewardAccount
|
|
390
465
|
},
|
|
@@ -394,7 +469,7 @@ describe.skip('PersonalWallet/conwayTransactions', () => {
|
|
|
394
469
|
governanceAction: {
|
|
395
470
|
__typename: GovernanceActionType.hard_fork_initiation_action,
|
|
396
471
|
governanceActionId: null,
|
|
397
|
-
protocolVersion: { major:
|
|
472
|
+
protocolVersion: { major: 11, minor: 0 }
|
|
398
473
|
},
|
|
399
474
|
rewardAccount
|
|
400
475
|
},
|
|
@@ -439,13 +514,16 @@ describe.skip('PersonalWallet/conwayTransactions', () => {
|
|
|
439
514
|
.customize(({ txBody }) => ({ ...txBody, proposalProcedures }))
|
|
440
515
|
.build()
|
|
441
516
|
.sign();
|
|
442
|
-
const [id,
|
|
443
|
-
|
|
444
|
-
expect(confirmedTx.body.proposalProcedures).toEqual(proposalProcedures);
|
|
517
|
+
const [id, tx] = await submitAndConfirm(wallet, signedTx.tx, 1);
|
|
518
|
+
confirmedTx = tx;
|
|
445
519
|
|
|
446
520
|
actionId = { actionIndex: 0, id };
|
|
447
521
|
});
|
|
448
522
|
|
|
523
|
+
it('parameter_change_action correctly submits protocol parameters update', () => {
|
|
524
|
+
expect(confirmedTx.body.proposalProcedures).toEqual(proposalProcedures);
|
|
525
|
+
});
|
|
526
|
+
|
|
449
527
|
it('delegation representatives can vote proposal procedure', async () => {
|
|
450
528
|
const votingProcedures: Cardano.VotingProcedures = [
|
|
451
529
|
{
|
|
@@ -458,9 +536,9 @@ describe.skip('PersonalWallet/conwayTransactions', () => {
|
|
|
458
536
|
.customize(({ txBody }) => ({ ...txBody, votingProcedures }))
|
|
459
537
|
.build()
|
|
460
538
|
.sign();
|
|
461
|
-
const [,
|
|
539
|
+
const [, tx] = await submitAndConfirm(dRepWallet, signedTx.tx, 1);
|
|
462
540
|
|
|
463
|
-
expect(
|
|
541
|
+
expect(tx.body.votingProcedures).toEqual(votingProcedures);
|
|
464
542
|
});
|
|
465
543
|
});
|
|
466
544
|
});
|