Преглед на файлове

Feature flag for bridge address (#289)

* Feature flag for bridge address

* Feature flag for bridge address
guibescos преди 3 години
родител
ревизия
e7b9c883ff

+ 1 - 1
pythnet/remote-executor/programs/remote-executor/src/state/governance_payload.rs

@@ -15,7 +15,7 @@ use crate::{
     error::ExecutorError,
 };
 
-pub const MAGIC_NUMBER: u32 = 0x4d475450; // Reverse order of the solidity contract because borsh uses little endian numbers
+pub const MAGIC_NUMBER: u32 = 0x4d475450; // Reverse order of the solidity contract because borsh uses little endian numbers (the solidity contract uses 0x5054474d)
 
 #[derive(AnchorDeserialize, AnchorSerialize)]
 pub struct ExecutorPayload {

+ 7 - 1
pythnet/remote-executor/programs/remote-executor/src/state/posted_vaa.rs

@@ -6,10 +6,16 @@ use std::{
 };
 use wormhole_solana::VAA;
 
+// The current chain's wormhole bridge owns the VAA accounts
 impl Owner for AnchorVaa {
+    #[cfg(not(feature = "pythtest"))]
     fn owner() -> Pubkey {
         Pubkey::from_str("H3fxXJ86ADW2PNuDDmZJg6mzTtPxkYCpNuQUTgmJ7AjU").unwrap()
-        // Pythnet bridge address
+    }
+
+    #[cfg(feature = "pythtest")]
+    fn owner() -> Pubkey {
+        Pubkey::from_str("EUrRARh92Cdc54xrDn6qzaqjA77NRrCcfbr8kPwoTL4z").unwrap()
     }
 }