You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let sources = vec![(1u16,[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x11])];
let hex_str = "010000000001006fc27ac424b300c23a564bcabe1d7888a898cba92b8aec62468c35025baaf4a87056c50d443fbc172c3caa30d28ec57cefc0bbabf4590ffe98c44dff040d0e02000000000100000000000200000000000000000000000000000000000000000000000000000000000011110000000000000001005054474d0105000200000001";
240
+
let hex_str = "010000000001006fc27ac424b300c23a564bcabe1d7888a898cba92b8aec62468c35025baaf4a87056c50d443fbc172c3caa30d28ec57cefc0bbabf4590ffe98c44dff040d0e020000000001000000000002000000000000000000000000000000000000000000000000000000000000111100000000000001015054474d01010002010000000001006fc27ac424b300c23a564bcabe1d7888a898cba92b8aec62468c35025baaf4a87056c50d443fbc172c3caa30d28ec57cefc0bbabf4590ffe98c44dff040d0e02000000000100000000000200000000000000000000000000000000000000000000000000000000000011110000000000000001005054474d0105000200000001";
236
241
let bytes = Vec::from_hex(hex_str).expect("Invalid hex string");
237
242
238
243
let result = pyth_contract
@@ -341,10 +346,7 @@ mod test {
341
346
.sender(alice)
342
347
.execute_governance_instruction(bytes.clone());
343
348
344
-
assert!(
345
-
result.is_err(),
346
-
"Invalid VAA should revert the transaction"
347
-
);
349
+
assert!(result.is_err(),"Invalid VAA should revert the transaction");
348
350
}
349
351
350
352
#[motsu::test]
@@ -363,10 +365,7 @@ mod test {
363
365
.sender(alice)
364
366
.execute_governance_instruction(bytes.clone());
365
367
366
-
assert!(
367
-
result.is_err(),
368
-
"Invalid VAA should revert the transaction"
369
-
);
368
+
assert!(result.is_err(),"Invalid VAA should revert the transaction");
370
369
}
371
370
372
371
#[motsu::test]
@@ -384,10 +383,7 @@ mod test {
384
383
.sender(alice)
385
384
.execute_governance_instruction(bytes.clone());
386
385
387
-
assert!(
388
-
result.is_err(),
389
-
"Invalid VAA should revert the transaction"
390
-
);
386
+
assert!(result.is_err(),"Invalid VAA should revert the transaction");
391
387
}
392
388
393
389
#[motsu::test]
@@ -406,10 +402,7 @@ mod test {
406
402
.sender(alice)
407
403
.execute_governance_instruction(bytes.clone());
408
404
409
-
assert!(
410
-
result.is_err(),
411
-
"Invalid VAA should revert the transaction"
412
-
);
405
+
assert!(result.is_err(),"Invalid VAA should revert the transaction");
413
406
}
414
407
415
408
#[motsu::test]
@@ -428,10 +421,7 @@ mod test {
428
421
.sender(alice)
429
422
.execute_governance_instruction(bytes.clone());
430
423
431
-
assert!(
432
-
result.is_err(),
433
-
"Invalid VAA should revert the transaction"
434
-
);
424
+
assert!(result.is_err(),"Invalid VAA should revert the transaction");
435
425
}
436
426
437
427
#[motsu::test]
@@ -450,10 +440,7 @@ mod test {
450
440
.sender(alice)
451
441
.execute_governance_instruction(bytes.clone());
452
442
453
-
assert!(
454
-
result.is_err(),
455
-
"Invalid VAA should revert the transaction"
456
-
);
443
+
assert!(result.is_err(),"Invalid VAA should revert the transaction");
457
444
}
458
445
459
446
#[motsu::test]
@@ -471,10 +458,7 @@ mod test {
471
458
.sender(alice)
472
459
.execute_governance_instruction(bytes.clone());
473
460
474
-
assert!(
475
-
result.is_ok(),
476
-
"This is a valid VAA, should go through"
477
-
);
461
+
assert!(result.is_ok(),"This is a valid VAA, should go through");
478
462
479
463
let result = pyth_contract
480
464
.sender(alice)
@@ -529,5 +513,4 @@ mod test {
529
513
"Wrong action expected should lead to bad parsing"
let expected_source = (1u16,[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x11]);
if sources.len() == 1 && sources[0] == expected_source {
21
26
let hex_str = "0100000000010069825ef00344cf745b6e72a41d4f869d4e90de517849360c72bf94efc97681671d826e484747b21a80c8f1e7816021df9f55e458a6e7a717cb2bd2a1e85fd57100499602d200000000000100000000000000000000000000000000000000000000000000000000000000110000000000000001005054474d010200020100010000000000000000000000000000000000000000000000000000000000001111";
let hex_str = "01000000000100b2e15dd5ef41b800ec5ec10f61c6415f706a769f459757f43be78a8fd9f1f6e104e909239fe73b4d8652f7aa1a07825e3230d01a0a7bd6efa0be2e7e72377d71010000000100000000000100000000000000000000000000000000000000000000000000000000000000110000000000000001005054474d010500020000000000000000";
let sources = vec![(1u16,[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x11])];
0 commit comments