|
@@ -2,10 +2,14 @@
|
|
|
|
|
|
use crate::bpf_writer::BpfWriter;
|
|
|
use crate::error::ErrorCode;
|
|
|
-use crate::*;
|
|
|
+use crate::{
|
|
|
+ AccountDeserialize, AccountSerialize, Accounts, AccountsClose, AccountsExit, Key, Owner,
|
|
|
+ Result, ToAccountInfo, ToAccountInfos, ToAccountMetas,
|
|
|
+};
|
|
|
use solana_program::account_info::AccountInfo;
|
|
|
use solana_program::instruction::AccountMeta;
|
|
|
use solana_program::pubkey::Pubkey;
|
|
|
+use solana_program::system_program;
|
|
|
use std::collections::BTreeMap;
|
|
|
use std::fmt;
|
|
|
use std::ops::{Deref, DerefMut};
|
|
@@ -235,7 +239,7 @@ impl<'info, T: AccountSerialize + AccountDeserialize + Owner + Clone + fmt::Debu
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-impl<'a, T: AccountSerialize + AccountDeserialize + Owner + Clone> Account<'a, T> {
|
|
|
+impl<'a, T: AccountSerialize + AccountDeserialize + crate::Owner + Clone> Account<'a, T> {
|
|
|
fn new(info: AccountInfo<'a>, account: T) -> Account<'a, T> {
|
|
|
Self { info, account }
|
|
|
}
|
|
@@ -411,3 +415,9 @@ impl<'a, T: AccountSerialize + AccountDeserialize + Owner + Clone> DerefMut for
|
|
|
&mut self.account
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+impl<'info, T: AccountSerialize + AccountDeserialize + Owner + Clone> Key for Account<'info, T> {
|
|
|
+ fn key(&self) -> Pubkey {
|
|
|
+ *self.info.key
|
|
|
+ }
|
|
|
+}
|