diff --git a/programs/move_funds/src/lib.rs b/programs/move_funds/src/lib.rs index ef9b186da..209fe5d28 100644 --- a/programs/move_funds/src/lib.rs +++ b/programs/move_funds/src/lib.rs @@ -2,7 +2,7 @@ extern crate bincode; extern crate solana; use bincode::deserialize; -use solana::dynamic_program::KeyedAccount; +use solana::account::KeyedAccount; #[no_mangle] pub extern "C" fn process(infos: &mut Vec, data: &[u8]) { diff --git a/programs/noop/src/lib.rs b/programs/noop/src/lib.rs index 470ee953a..59ba23d01 100644 --- a/programs/noop/src/lib.rs +++ b/programs/noop/src/lib.rs @@ -1,6 +1,6 @@ extern crate solana; -use solana::dynamic_program::KeyedAccount; +use solana::account::KeyedAccount; #[no_mangle] pub extern "C" fn process(_infos: &mut Vec, _data: &[u8]) {} diff --git a/programs/print/src/lib.rs b/programs/print/src/lib.rs index f2315daae..8947553e0 100644 --- a/programs/print/src/lib.rs +++ b/programs/print/src/lib.rs @@ -1,6 +1,6 @@ extern crate solana; -use solana::dynamic_program::KeyedAccount; +use solana::account::KeyedAccount; #[no_mangle] pub extern "C" fn process(infos: &mut Vec, _data: &[u8]) { diff --git a/src/account.rs b/src/account.rs index dfdb0e7a4..e39753dbd 100644 --- a/src/account.rs +++ b/src/account.rs @@ -21,3 +21,9 @@ impl Account { } } } + +#[derive(Debug)] +pub struct KeyedAccount<'a> { + pub key: &'a Pubkey, + pub account: &'a mut Account, +} diff --git a/src/bank.rs b/src/bank.rs index b8bf3e01b..1c4288f9b 100644 --- a/src/bank.rs +++ b/src/bank.rs @@ -3,13 +3,13 @@ //! on behalf of the caller, and a low-level API for when they have //! already been signed and verified. -use account::Account; +use account::{Account, KeyedAccount}; use bincode::deserialize; use bincode::serialize; use budget_program::BudgetState; use budget_transaction::BudgetTransaction; use counter::Counter; -use dynamic_program::{DynamicProgram, KeyedAccount}; +use dynamic_program::DynamicProgram; use entry::Entry; use hash::{hash, Hash}; use itertools::Itertools; diff --git a/src/dynamic_program.rs b/src/dynamic_program.rs index 76715cd2d..f8d20b2ad 100644 --- a/src/dynamic_program.rs +++ b/src/dynamic_program.rs @@ -1,10 +1,9 @@ extern crate bincode; extern crate generic_array; -use account::Account; +use account::KeyedAccount; use libc; use libloading; -use pubkey::Pubkey; use std::path::PathBuf; #[cfg(debug_assertions)] @@ -40,12 +39,6 @@ fn create_library_path(name: &str) -> PathBuf { path } -#[derive(Debug)] -pub struct KeyedAccount<'a> { - pub key: &'a Pubkey, - pub account: &'a mut Account, -} - // All programs export a symbol named process() const ENTRYPOINT: &str = "process"; type Entrypoint = unsafe extern "C" fn(infos: &mut Vec, data: &[u8]); diff --git a/src/system_program.rs b/src/system_program.rs index 7a1466c08..4ca41f43e 100644 --- a/src/system_program.rs +++ b/src/system_program.rs @@ -97,9 +97,8 @@ impl SystemProgram { } #[cfg(test)] mod test { - use account::Account; + use account::{Account, KeyedAccount}; use bincode::serialize; - use dynamic_program::KeyedAccount; use hash::Hash; use pubkey::Pubkey; use signature::{Keypair, KeypairUtil};