We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c9453c commit a6f300eCopy full SHA for a6f300e
target_chains/stylus/contracts/pyth-receiver/src/lib.rs
@@ -165,6 +165,17 @@ impl PythReceiver {
165
166
// TODO: CHECK IF THE VAA IS FROM A VALID DATA SOURCE
167
168
+ let cur_emitter_address: &[u8; 32] = vaa.body.emitter_address.as_slice().try_into().expect("emitter address must be 32 bytes");
169
+
170
+ let cur_data_source = DataSource {
171
+ chain_id: U16::from(vaa.body.emitter_chain),
172
+ emitter_address: FixedBytes::from(cur_emitter_address),
173
+ };
174
175
+ if !self.is_valid_data_source.get(cur_data_source) {
176
+ return Err(PythReceiverError::InvalidWormholeMessage);
177
+ }
178
179
let root_digest: MerkleRoot<Keccak160> = parse_wormhole_proof(vaa).unwrap();
180
181
for update in updates {
0 commit comments