config.rs 712 B

12345678910111213141516171819202122
  1. use borsh::{BorshDeserialize, BorshSerialize};
  2. use solana_program::pubkey::Pubkey;
  3. use solitaire::{processors::seeded::AccountOwner, AccountState, Data, Derive, Owned};
  4. #[derive(Default, BorshDeserialize, BorshSerialize)]
  5. pub struct Pyth2WormholeConfig {
  6. /// Authority owning this contract
  7. pub owner: Pubkey,
  8. /// Wormhole bridge program
  9. pub wh_prog: Pubkey,
  10. /// Authority owning Pyth price data
  11. pub pyth_owner: Pubkey,
  12. }
  13. impl Owned for Pyth2WormholeConfig {
  14. fn owner(&self) -> AccountOwner {
  15. AccountOwner::This
  16. }
  17. }
  18. pub type P2WConfigAccount<'b, const IsInitialized: AccountState> =
  19. Derive<Data<'b, Pyth2WormholeConfig, { IsInitialized }>, "pyth2wormhole-config">;