From c4286b9df514f07dd421c088719a0af56b49a249 Mon Sep 17 00:00:00 2001 From: Reisen Date: Mon, 3 May 2021 23:59:02 +0000 Subject: [PATCH] Move accounts back to lib.rs as associated breaks otherwise. Change-Id: Ic4e7cddaaac414cbc9afb5eee4e8a9c81b2f8548 --- .../programs/anchor-bridge/src/account.rs | 20 ------------------ .../programs/anchor-bridge/src/lib.rs | 21 ++++++++++++++++--- 2 files changed, 18 insertions(+), 23 deletions(-) delete mode 100644 solana/anchor-bridge/programs/anchor-bridge/src/account.rs diff --git a/solana/anchor-bridge/programs/anchor-bridge/src/account.rs b/solana/anchor-bridge/programs/anchor-bridge/src/account.rs deleted file mode 100644 index 952350a17..000000000 --- a/solana/anchor-bridge/programs/anchor-bridge/src/account.rs +++ /dev/null @@ -1,20 +0,0 @@ -use anchor_lang::{prelude::*, solana_program}; - -use crate::{types::Index, MAX_LEN_GUARDIAN_KEYS}; - -#[account] -pub struct BridgeInfo {} - -#[account] -pub struct GuardianSetInfo { - /// Version number of this guardian set. - pub index: Index, - /// Number of keys stored - pub len_keys: u8, - /// public key hashes of the guardian set - pub keys: [[u8; 20]; MAX_LEN_GUARDIAN_KEYS], - /// creation time - pub creation_time: u32, - /// expiration time when VAAs issued by this set are no longer valid - pub expiration_time: u32, -} diff --git a/solana/anchor-bridge/programs/anchor-bridge/src/lib.rs b/solana/anchor-bridge/programs/anchor-bridge/src/lib.rs index e8605bbdb..0a223ecc3 100644 --- a/solana/anchor-bridge/programs/anchor-bridge/src/lib.rs +++ b/solana/anchor-bridge/programs/anchor-bridge/src/lib.rs @@ -1,11 +1,9 @@ use anchor_lang::{prelude::*, solana_program}; -mod account; mod api; mod types; -use account::{BridgeInfo, GuardianSetInfo}; -use types::BridgeConfig; +use types::{Index, BridgeConfig}; /// An enum with labeled network identifiers. These must be consistent accross all wormhole /// contracts deployed on each chain. @@ -156,3 +154,20 @@ pub enum ErrorCode { #[msg("System account pubkey did not match expected address.")] InvalidSysVar, } + +#[account] +pub struct BridgeInfo {} + +#[account] +pub struct GuardianSetInfo { + /// Version number of this guardian set. + pub index: Index, + /// Number of keys stored + pub len_keys: u8, + /// public key hashes of the guardian set + pub keys: [[u8; 20]; MAX_LEN_GUARDIAN_KEYS], + /// creation time + pub creation_time: u32, + /// expiration time when VAAs issued by this set are no longer valid + pub expiration_time: u32, +}