-
Notifications
You must be signed in to change notification settings - Fork 266
feat(stylus): Negative + Invalid Tests for Stylus Governance #2898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Use exact working Solidity VAA hex string instead of manual construction - Debugged wormhole validation process to understand root cause - Added comprehensive documentation explaining debugging findings - Removed debugging test function after investigation completed - Test now passes consistently with proper VAA structure Debug investigation revealed that manual VAA construction can produce identical results when using correct parameters. The original error was likely due to incorrect construction parameters rather than the manual approach itself. Co-Authored-By: [email protected] <[email protected]>
…ance actions - Add test_utils.rs with VAA generation functions for all 9 governance actions - Use pre-signed working VAA hex strings directly to ensure valid cryptographic signatures - Include unit tests for each VAA generation function (6 tests passing) - Update existing tests to use new utility functions instead of hardcoded hex strings - Fix test_set_data_sources which was previously failing with InvalidWormholeMessage - Enable easy test case creation without manual VAA construction Note: test_authorize_governance_data_source_transfer still fails with OldGovernanceMessage but this was a pre-existing issue in the original pyth-stylus-governance-better-tests branch Co-Authored-By: [email protected] <[email protected]>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
@@ -92,12 +92,24 @@ mod test { | |||
) { | |||
pyth_wormhole_init(&pyth_contract, &wormhole_contract, &alice, 0); | |||
|
|||
let sources = vec![( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this being used anywhere?
let bytes = Vec::from_hex(hex_str).expect("Invalid hex string"); | ||
|
||
let result = pyth_contract | ||
.sender(alice) | ||
.execute_governance_instruction(bytes.clone()); | ||
|
||
println!("Result: {:?}", result.unwrap_err()); | ||
// assert!(result.is_ok()); | ||
assert!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verify state / verify event emission here? maybe you're planning this in another PR
Summary
Added negative and invalid test cases for stylus governance.
How has this been tested?