Move KeyedAccount out of solana-program. Native programs are not supported by solana-program

This commit is contained in:
Michael Vines
2020-10-26 09:14:57 -07:00
parent 0475107654
commit 1b343665a1
35 changed files with 384 additions and 382 deletions

View File

@ -5,12 +5,12 @@ extern crate test;
use log::*;
use solana_runtime::{bank::*, bank_client::BankClient, loader_utils::create_invoke_instruction};
use solana_sdk::{
account::KeyedAccount,
client::AsyncClient,
client::SyncClient,
clock::MAX_RECENT_BLOCKHASHES,
genesis_config::create_genesis_config,
instruction::InstructionError,
keyed_account::KeyedAccount,
message::Message,
pubkey::Pubkey,
signature::{Keypair, Signer},

View File

@ -4118,12 +4118,12 @@ mod tests {
status_cache::MAX_CACHE_ENTRIES,
};
use solana_sdk::{
account::KeyedAccount,
account_utils::StateMut,
clock::{DEFAULT_SLOTS_PER_EPOCH, DEFAULT_TICKS_PER_SLOT},
epoch_schedule::MINIMUM_SLOTS_PER_EPOCH,
genesis_config::create_genesis_config,
instruction::{AccountMeta, CompiledInstruction, Instruction, InstructionError},
keyed_account::KeyedAccount,
message::{Message, MessageHeader},
nonce,
poh_config::PohConfig,

View File

@ -12,9 +12,10 @@ use crate::{
use log::*;
use serde::{Deserialize, Serialize};
use solana_sdk::{
account::{create_keyed_readonly_accounts, Account, KeyedAccount},
account::Account,
clock::Epoch,
instruction::{CompiledInstruction, Instruction, InstructionError},
keyed_account::{create_keyed_readonly_accounts, KeyedAccount},
message::Message,
native_loader,
pubkey::Pubkey,

View File

@ -7,10 +7,10 @@ use libloading::os::windows::*;
use log::*;
use num_derive::{FromPrimitive, ToPrimitive};
use solana_sdk::{
account::{next_keyed_account, KeyedAccount},
decode_error::DecodeError,
entrypoint_native::ProgramEntrypoint,
instruction::InstructionError,
keyed_account::{next_keyed_account, KeyedAccount},
pubkey::Pubkey,
};
use std::{collections::HashMap, env, path::PathBuf, str, sync::RwLock};

View File

@ -3,8 +3,9 @@ use crate::feature_set::{
pubkey_log_syscall_enabled, FeatureSet,
};
use solana_sdk::{
account::{Account, KeyedAccount},
account::Account,
instruction::{CompiledInstruction, Instruction, InstructionError},
keyed_account::KeyedAccount,
message::Message,
pubkey::Pubkey,
};

View File

@ -1,14 +1,16 @@
use log::*;
use solana_sdk::{
account::{get_signers, next_keyed_account, Account, KeyedAccount},
account::Account,
account_utils::StateMut,
instruction::InstructionError,
nonce::{self, Account as NonceAccount},
keyed_account::{from_keyed_account, get_signers, next_keyed_account, KeyedAccount},
nonce,
nonce_keyed_account::NonceKeyedAccount,
program_utils::limited_deserialize,
pubkey::Pubkey,
system_instruction::{SystemError, SystemInstruction, MAX_PERMITTED_DATA_LENGTH},
system_program,
sysvar::{self, recent_blockhashes::RecentBlockhashes, rent::Rent, Sysvar},
sysvar::{self, recent_blockhashes::RecentBlockhashes, rent::Rent},
};
use std::collections::HashSet;
@ -267,7 +269,7 @@ pub fn process_instruction(
SystemInstruction::AdvanceNonceAccount => {
let me = &mut next_keyed_account(keyed_accounts_iter)?;
me.advance_nonce_account(
&RecentBlockhashes::from_keyed_account(next_keyed_account(keyed_accounts_iter)?)?,
&from_keyed_account::<RecentBlockhashes>(next_keyed_account(keyed_accounts_iter)?)?,
&signers,
)
}
@ -277,8 +279,8 @@ pub fn process_instruction(
me.withdraw_nonce_account(
lamports,
to,
&RecentBlockhashes::from_keyed_account(next_keyed_account(keyed_accounts_iter)?)?,
&Rent::from_keyed_account(next_keyed_account(keyed_accounts_iter)?)?,
&from_keyed_account::<RecentBlockhashes>(next_keyed_account(keyed_accounts_iter)?)?,
&from_keyed_account::<Rent>(next_keyed_account(keyed_accounts_iter)?)?,
&signers,
)
}
@ -286,8 +288,8 @@ pub fn process_instruction(
let me = &mut next_keyed_account(keyed_accounts_iter)?;
me.initialize_nonce_account(
&authorized,
&RecentBlockhashes::from_keyed_account(next_keyed_account(keyed_accounts_iter)?)?,
&Rent::from_keyed_account(next_keyed_account(keyed_accounts_iter)?)?,
&from_keyed_account::<RecentBlockhashes>(next_keyed_account(keyed_accounts_iter)?)?,
&from_keyed_account::<Rent>(next_keyed_account(keyed_accounts_iter)?)?,
)
}
SystemInstruction::AuthorizeNonceAccount(nonce_authority) => {