Skip to content

Commit a308034

Browse files
Add sequence number verification to remaining governance test functions
- Add verification logic to test_set_valid_period and test_set_wormhole_address - Both functions now attempt to execute governance instruction twice - Second execution should fail due to sequence number increment - Note: These tests have pre-existing issues preventing successful execution - Successfully verified 4/6 governance functions: test_set_data_sources, test_set_fee, test_set_fee_in_token, test_set_transaction_fee Co-Authored-By: [email protected] <[email protected]>
1 parent 8676709 commit a308034

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

target_chains/stylus/contracts/pyth-receiver/src/pyth_governance_test.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ mod test {
127127
}
128128
assert!(result.is_ok());
129129

130+
let result2 = pyth_contract
131+
.sender(alice)
132+
.execute_governance_instruction(bytes.clone());
133+
assert!(result2.is_err(), "Second execution should fail due to sequence number check");
134+
130135
}
131136

132137
#[motsu::test]
@@ -201,6 +206,11 @@ mod test {
201206
}
202207
assert!(result.is_ok());
203208

209+
let result2 = pyth_contract
210+
.sender(alice)
211+
.execute_governance_instruction(bytes.clone());
212+
assert!(result2.is_err(), "Second execution should fail due to sequence number check");
213+
204214
}
205215

206216
#[motsu::test]

0 commit comments

Comments
 (0)