|
1 | 1 | #[cfg(test)]
|
2 | 2 | mod test {
|
3 |
| - use crate::{PythReceiver, FeeSet, TransactionFeeSet, DataSourcesSet, GovernanceDataSourceSet}; |
4 |
| - use alloy_primitives::{address, Address, U256, FixedBytes}; |
| 3 | + use crate::{DataSourcesSet, FeeSet, GovernanceDataSourceSet, PythReceiver, TransactionFeeSet}; |
| 4 | + use alloy_primitives::{address, Address, FixedBytes, U256}; |
5 | 5 | use hex::FromHex;
|
6 | 6 | use motsu::prelude::*;
|
7 | 7 | use wormhole_contract::WormholeContract;
|
@@ -100,16 +100,18 @@ mod test {
|
100 | 100 | .execute_governance_instruction(bytes.clone());
|
101 | 101 | assert!(result.is_ok());
|
102 | 102 |
|
103 |
| - |
104 | 103 | let expected_event = DataSourcesSet {
|
105 | 104 | old_data_sources: vec![FixedBytes::from(PYTHNET_EMITTER_ADDRESS)],
|
106 | 105 | new_data_sources: vec![FixedBytes::from([
|
107 |
| - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
108 |
| - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
109 |
| - 0x11, 0x11 |
| 106 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 107 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 108 | + 0x00, 0x00, 0x11, 0x11, |
110 | 109 | ])],
|
111 | 110 | };
|
112 |
| - assert!(pyth_contract.emitted(&expected_event), "DataSourcesSet event should be emitted"); |
| 111 | + assert!( |
| 112 | + pyth_contract.emitted(&expected_event), |
| 113 | + "DataSourcesSet event should be emitted" |
| 114 | + ); |
113 | 115 |
|
114 | 116 | let result2 = pyth_contract
|
115 | 117 | .sender(alice)
|
@@ -161,7 +163,10 @@ mod test {
|
161 | 163 | old_fee: SINGLE_UPDATE_FEE_IN_WEI,
|
162 | 164 | new_fee: expected_new_fee,
|
163 | 165 | };
|
164 |
| - assert!(pyth_contract.emitted(&expected_event), "FeeSet event should be emitted"); |
| 166 | + assert!( |
| 167 | + pyth_contract.emitted(&expected_event), |
| 168 | + "FeeSet event should be emitted" |
| 169 | + ); |
165 | 170 |
|
166 | 171 | let result2 = pyth_contract
|
167 | 172 | .sender(alice)
|
@@ -271,7 +276,10 @@ mod test {
|
271 | 276 | new_emitter_address: FixedBytes::from(GOVERNANCE_EMITTER), // emitter_bytes from the VAA
|
272 | 277 | initial_sequence: 100, // claim_vm.body.sequence from the VAA (0x64 = 100)
|
273 | 278 | };
|
274 |
| - assert!(pyth_contract.emitted(&expected_event), "GovernanceDataSourceSet event should be emitted"); |
| 279 | + assert!( |
| 280 | + pyth_contract.emitted(&expected_event), |
| 281 | + "GovernanceDataSourceSet event should be emitted" |
| 282 | + ); |
275 | 283 | }
|
276 | 284 |
|
277 | 285 | #[motsu::test]
|
@@ -301,7 +309,10 @@ mod test {
|
301 | 309 | old_fee: U256::ZERO,
|
302 | 310 | new_fee: expected_new_fee,
|
303 | 311 | };
|
304 |
| - assert!(pyth_contract.emitted(&expected_event), "TransactionFeeSet event should be emitted"); |
| 312 | + assert!( |
| 313 | + pyth_contract.emitted(&expected_event), |
| 314 | + "TransactionFeeSet event should be emitted" |
| 315 | + ); |
305 | 316 |
|
306 | 317 | let result2 = pyth_contract
|
307 | 318 | .sender(alice)
|
|
0 commit comments