@@ -166,15 +166,11 @@ describe("api", async () => {
166
166
} ) ;
167
167
168
168
it ( "postSignatures" , async ( ) => {
169
- const signaturesKeypair = Keypair . generate ( ) ;
170
- await stakeConnection . postSignatures (
169
+ const guardianSignaturesPda = await await stakeConnection . postSignatures (
171
170
ethProposalResponse . signatures ,
172
- signaturesKeypair ,
173
171
) ;
174
172
const { guardianSignaturesData } =
175
- await stakeConnection . fetchGuardianSignaturesData (
176
- signaturesKeypair . publicKey ,
177
- ) ;
173
+ await stakeConnection . fetchGuardianSignaturesData ( guardianSignaturesPda ) ;
178
174
const expectedSignatures = signaturesToSolanaArray (
179
175
ethProposalResponse . signatures ,
180
176
) ;
@@ -196,16 +192,17 @@ describe("api", async () => {
196
192
proposalIdInput ,
197
193
voteStart ,
198
194
) ;
199
- const signaturesKeypair = Keypair . generate ( ) ;
195
+
200
196
const mock = new QueryProxyMock ( { } ) ;
201
197
const mockSignatures = mock . sign ( ethProposalResponseBytes ) ;
202
- await stakeConnection . postSignatures ( mockSignatures , signaturesKeypair ) ;
198
+ const guardianSignaturesPda =
199
+ await stakeConnection . postSignatures ( mockSignatures ) ;
203
200
const mockGuardianSetIndex = 5 ;
204
201
205
202
await stakeConnection . addProposal (
206
203
proposalIdInput ,
207
204
ethProposalResponseBytes ,
208
- signaturesKeypair . publicKey ,
205
+ guardianSignaturesPda ,
209
206
mockGuardianSetIndex ,
210
207
) ;
211
208
@@ -234,16 +231,14 @@ describe("api", async () => {
234
231
"hex" ,
235
232
) ;
236
233
237
- const signaturesKeypair = Keypair . generate ( ) ;
238
- await stakeConnection . postSignatures (
234
+ const guardianSignaturesPda = await stakeConnection . postSignatures (
239
235
sepoliaEthProposalResponse . signatures ,
240
- signaturesKeypair ,
241
236
) ;
242
237
243
238
await stakeConnection . addProposal (
244
239
proposalIdArray ,
245
240
Buffer . from ( sepoliaEthProposalResponse . bytes , "hex" ) ,
246
- signaturesKeypair . publicKey ,
241
+ guardianSignaturesPda ,
247
242
0 ,
248
243
) ;
249
244
@@ -276,17 +271,17 @@ describe("api", async () => {
276
271
voteStart ,
277
272
) ;
278
273
279
- const signaturesKeypair = Keypair . generate ( ) ;
280
274
const mock = new QueryProxyMock ( { } ) ;
281
275
const mockSignatures = mock . sign ( nonFinalizedEthProposalResponseBytes ) ;
282
- await stakeConnection . postSignatures ( mockSignatures , signaturesKeypair ) ;
276
+ const guardianSignaturesPda =
277
+ await stakeConnection . postSignatures ( mockSignatures ) ;
283
278
const mockGuardianSetIndex = 5 ;
284
279
285
280
try {
286
281
await stakeConnection . addProposal (
287
282
proposalIdInput ,
288
283
nonFinalizedEthProposalResponseBytes ,
289
- signaturesKeypair . publicKey ,
284
+ guardianSignaturesPda ,
290
285
mockGuardianSetIndex ,
291
286
true ,
292
287
) ;
@@ -312,17 +307,17 @@ describe("api", async () => {
312
307
voteStart ,
313
308
) ;
314
309
315
- const signaturesKeypair = Keypair . generate ( ) ;
316
310
const mock = new QueryProxyMock ( { } ) ;
317
311
const mockSignatures = mock . sign ( invalidQueryEthProposalResponseBytes ) ;
318
- await stakeConnection . postSignatures ( mockSignatures , signaturesKeypair ) ;
312
+ const guardianSignaturesPda =
313
+ await stakeConnection . postSignatures ( mockSignatures ) ;
319
314
const mockGuardianSetIndex = 5 ;
320
315
321
316
try {
322
317
await stakeConnection . addProposal (
323
318
proposalIdInput ,
324
319
invalidQueryEthProposalResponseBytes ,
325
- signaturesKeypair . publicKey ,
320
+ guardianSignaturesPda ,
326
321
mockGuardianSetIndex ,
327
322
true ,
328
323
) ;
@@ -349,17 +344,17 @@ describe("api", async () => {
349
344
voteStart ,
350
345
) ;
351
346
352
- const signaturesKeypair = Keypair . generate ( ) ;
353
347
const mock = new QueryProxyMock ( { } ) ;
354
348
const mockSignatures = mock . sign ( invalidResponseEthProposalResponseBytes ) ;
355
- await stakeConnection . postSignatures ( mockSignatures , signaturesKeypair ) ;
349
+ const guardianSignaturesPda =
350
+ await stakeConnection . postSignatures ( mockSignatures ) ;
356
351
const mockGuardianSetIndex = 5 ;
357
352
358
353
try {
359
354
await stakeConnection . addProposal (
360
355
proposalIdInput ,
361
356
invalidResponseEthProposalResponseBytes ,
362
- signaturesKeypair . publicKey ,
357
+ guardianSignaturesPda ,
363
358
mockGuardianSetIndex ,
364
359
true ,
365
360
) ;
@@ -386,19 +381,19 @@ describe("api", async () => {
386
381
voteStart ,
387
382
) ;
388
383
389
- const signaturesKeypair = Keypair . generate ( ) ;
390
384
const mock = new QueryProxyMock ( { } ) ;
391
385
const mockSignatures = mock . sign (
392
386
invalidFunctionSignatureEthProposalResponseBytes ,
393
387
) ;
394
- await stakeConnection . postSignatures ( mockSignatures , signaturesKeypair ) ;
388
+ const guardianSignaturesPda =
389
+ await stakeConnection . postSignatures ( mockSignatures ) ;
395
390
const mockGuardianSetIndex = 5 ;
396
391
397
392
try {
398
393
await stakeConnection . addProposal (
399
394
proposalIdInput ,
400
395
invalidFunctionSignatureEthProposalResponseBytes ,
401
- signaturesKeypair . publicKey ,
396
+ guardianSignaturesPda ,
402
397
mockGuardianSetIndex ,
403
398
true ,
404
399
) ;
@@ -422,17 +417,17 @@ describe("api", async () => {
422
417
proposalIdInput ,
423
418
voteStart ,
424
419
) ;
425
- const signaturesKeypair = Keypair . generate ( ) ;
426
420
const mock = new QueryProxyMock ( { } ) ;
427
421
const mockSignatures = mock . sign ( ethProposalResponseBytes ) ;
428
- await stakeConnection . postSignatures ( mockSignatures , signaturesKeypair ) ;
422
+ const guardianSignaturesPda =
423
+ await stakeConnection . postSignatures ( mockSignatures ) ;
429
424
const mockGuardianSetIndex = 5 ;
430
425
431
426
try {
432
427
await stakeConnection . addProposal (
433
428
proposalIdInput ,
434
429
ethProposalResponseBytes ,
435
- signaturesKeypair . publicKey ,
430
+ guardianSignaturesPda ,
436
431
mockGuardianSetIndex ,
437
432
true ,
438
433
) ;
@@ -457,17 +452,17 @@ describe("api", async () => {
457
452
proposalIdInput ,
458
453
voteStart ,
459
454
) ;
460
- const signaturesKeypair = Keypair . generate ( ) ;
461
455
const mock = new QueryProxyMock ( { } ) ;
462
456
const mockSignatures = mock . sign ( ethProposalResponseBytes ) ;
463
- await stakeConnection . postSignatures ( mockSignatures , signaturesKeypair ) ;
457
+ const guardianSignaturesPda =
458
+ await stakeConnection . postSignatures ( mockSignatures ) ;
464
459
const mockGuardianSetIndex = 5 ;
465
460
466
461
try {
467
462
await stakeConnection . addProposal (
468
463
proposalIdInput ,
469
464
ethProposalResponseBytes ,
470
- signaturesKeypair . publicKey ,
465
+ guardianSignaturesPda ,
471
466
mockGuardianSetIndex ,
472
467
true ,
473
468
) ;
@@ -493,16 +488,16 @@ describe("api", async () => {
493
488
proposalIdInput ,
494
489
voteStart ,
495
490
) ;
496
- const signaturesKeypair = Keypair . generate ( ) ;
497
491
const mock = new QueryProxyMock ( { } ) ;
498
492
const mockSignatures = mock . sign ( ethProposalResponseBytes ) ;
499
- await stakeConnection . postSignatures ( mockSignatures , signaturesKeypair ) ;
493
+ const guardianSignaturesPda =
494
+ await stakeConnection . postSignatures ( mockSignatures ) ;
500
495
const mockGuardianSetIndex = 5 ;
501
496
502
497
await stakeConnection . addProposal (
503
498
proposalIdInput ,
504
499
ethProposalResponseBytes ,
505
- signaturesKeypair . publicKey ,
500
+ guardianSignaturesPda ,
506
501
mockGuardianSetIndex ,
507
502
) ;
508
503
@@ -1210,16 +1205,16 @@ async function addTestProposal(
1210
1205
proposalIdInput ,
1211
1206
voteStart ,
1212
1207
) ;
1213
- const signaturesKeypair = Keypair . generate ( ) ;
1214
1208
const mock = new QueryProxyMock ( { } ) ;
1215
1209
const mockSignatures = mock . sign ( ethProposalResponseBytes ) ;
1216
- await stakeConnection . postSignatures ( mockSignatures , signaturesKeypair ) ;
1210
+ const guardianSignaturesPda =
1211
+ await stakeConnection . postSignatures ( mockSignatures ) ;
1217
1212
const mockGuardianSetIndex = 5 ;
1218
1213
1219
1214
await stakeConnection . addProposal (
1220
1215
proposalIdInput ,
1221
1216
ethProposalResponseBytes ,
1222
- signaturesKeypair . publicKey ,
1217
+ guardianSignaturesPda ,
1223
1218
mockGuardianSetIndex ,
1224
1219
) ;
1225
1220
0 commit comments