Reformat imports to a consistent style for imports
rustfmt.toml configuration: imports_granularity = "One" group_imports = "One"
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
|
||||
use solana_sdk::{
|
||||
instruction::{CompiledInstruction, Instruction},
|
||||
message::SanitizedMessage,
|
||||
use {
|
||||
solana_sdk::{
|
||||
instruction::{CompiledInstruction, Instruction},
|
||||
message::SanitizedMessage,
|
||||
},
|
||||
std::{cell::RefCell, rc::Rc},
|
||||
};
|
||||
|
||||
/// Records and compiles cross-program invoked instructions
|
||||
|
@ -1,26 +1,29 @@
|
||||
use crate::{
|
||||
ic_logger_msg, ic_msg, instruction_recorder::InstructionRecorder, log_collector::LogCollector,
|
||||
native_loader::NativeLoader, pre_account::PreAccount, timings::ExecuteDetailsTimings,
|
||||
};
|
||||
use solana_sdk::{
|
||||
account::{AccountSharedData, ReadableAccount},
|
||||
account_utils::StateMut,
|
||||
bpf_loader_upgradeable::{self, UpgradeableLoaderState},
|
||||
compute_budget::ComputeBudget,
|
||||
feature_set::{
|
||||
demote_program_write_locks, do_support_realloc, neon_evm_compute_budget,
|
||||
reject_empty_instruction_without_program, remove_native_loader, requestable_heap_size,
|
||||
tx_wide_compute_cap, FeatureSet,
|
||||
use {
|
||||
crate::{
|
||||
ic_logger_msg, ic_msg, instruction_recorder::InstructionRecorder,
|
||||
log_collector::LogCollector, native_loader::NativeLoader, pre_account::PreAccount,
|
||||
timings::ExecuteDetailsTimings,
|
||||
},
|
||||
hash::Hash,
|
||||
instruction::{AccountMeta, CompiledInstruction, Instruction, InstructionError},
|
||||
keyed_account::{create_keyed_accounts_unified, keyed_account_at_index, KeyedAccount},
|
||||
message::Message,
|
||||
pubkey::Pubkey,
|
||||
rent::Rent,
|
||||
sysvar::Sysvar,
|
||||
solana_sdk::{
|
||||
account::{AccountSharedData, ReadableAccount},
|
||||
account_utils::StateMut,
|
||||
bpf_loader_upgradeable::{self, UpgradeableLoaderState},
|
||||
compute_budget::ComputeBudget,
|
||||
feature_set::{
|
||||
demote_program_write_locks, do_support_realloc, neon_evm_compute_budget,
|
||||
reject_empty_instruction_without_program, remove_native_loader, requestable_heap_size,
|
||||
tx_wide_compute_cap, FeatureSet,
|
||||
},
|
||||
hash::Hash,
|
||||
instruction::{AccountMeta, CompiledInstruction, Instruction, InstructionError},
|
||||
keyed_account::{create_keyed_accounts_unified, keyed_account_at_index, KeyedAccount},
|
||||
message::Message,
|
||||
pubkey::Pubkey,
|
||||
rent::Rent,
|
||||
sysvar::Sysvar,
|
||||
},
|
||||
std::{cell::RefCell, collections::HashMap, fmt::Debug, rc::Rc, sync::Arc},
|
||||
};
|
||||
use std::{cell::RefCell, collections::HashMap, fmt::Debug, rc::Rc, sync::Arc};
|
||||
|
||||
pub type ProcessInstructionWithContext =
|
||||
fn(usize, &[u8], &mut InvokeContext) -> Result<(), InstructionError>;
|
||||
@ -936,13 +939,15 @@ pub fn mock_process_instruction(
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use solana_sdk::{
|
||||
account::{ReadableAccount, WritableAccount},
|
||||
instruction::{AccountMeta, Instruction, InstructionError},
|
||||
message::Message,
|
||||
native_loader,
|
||||
use {
|
||||
super::*,
|
||||
serde::{Deserialize, Serialize},
|
||||
solana_sdk::{
|
||||
account::{ReadableAccount, WritableAccount},
|
||||
instruction::{AccountMeta, Instruction, InstructionError},
|
||||
message::Message,
|
||||
native_loader,
|
||||
},
|
||||
};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
|
@ -1,28 +1,30 @@
|
||||
//! Native loader
|
||||
use crate::invoke_context::InvokeContext;
|
||||
#[cfg(unix)]
|
||||
use libloading::os::unix::*;
|
||||
#[cfg(windows)]
|
||||
use libloading::os::windows::*;
|
||||
use log::*;
|
||||
use num_derive::{FromPrimitive, ToPrimitive};
|
||||
use serde::Serialize;
|
||||
use solana_sdk::{
|
||||
account::ReadableAccount,
|
||||
decode_error::DecodeError,
|
||||
instruction::InstructionError,
|
||||
keyed_account::{keyed_account_at_index, KeyedAccount},
|
||||
native_loader,
|
||||
pubkey::Pubkey,
|
||||
use {
|
||||
crate::invoke_context::InvokeContext,
|
||||
log::*,
|
||||
num_derive::{FromPrimitive, ToPrimitive},
|
||||
serde::Serialize,
|
||||
solana_sdk::{
|
||||
account::ReadableAccount,
|
||||
decode_error::DecodeError,
|
||||
instruction::InstructionError,
|
||||
keyed_account::{keyed_account_at_index, KeyedAccount},
|
||||
native_loader,
|
||||
pubkey::Pubkey,
|
||||
},
|
||||
std::{
|
||||
collections::HashMap,
|
||||
env,
|
||||
path::{Path, PathBuf},
|
||||
str,
|
||||
sync::RwLock,
|
||||
},
|
||||
thiserror::Error,
|
||||
};
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
env,
|
||||
path::{Path, PathBuf},
|
||||
str,
|
||||
sync::RwLock,
|
||||
};
|
||||
use thiserror::Error;
|
||||
|
||||
/// Prototype of a native loader entry point
|
||||
///
|
||||
|
@ -1,16 +1,18 @@
|
||||
use crate::timings::ExecuteDetailsTimings;
|
||||
use solana_sdk::{
|
||||
account::{AccountSharedData, ReadableAccount, WritableAccount},
|
||||
instruction::InstructionError,
|
||||
pubkey::Pubkey,
|
||||
rent::Rent,
|
||||
system_instruction::MAX_PERMITTED_DATA_LENGTH,
|
||||
system_program,
|
||||
};
|
||||
use std::{
|
||||
cell::{Ref, RefCell},
|
||||
fmt::Debug,
|
||||
rc::Rc,
|
||||
use {
|
||||
crate::timings::ExecuteDetailsTimings,
|
||||
solana_sdk::{
|
||||
account::{AccountSharedData, ReadableAccount, WritableAccount},
|
||||
instruction::InstructionError,
|
||||
pubkey::Pubkey,
|
||||
rent::Rent,
|
||||
system_instruction::MAX_PERMITTED_DATA_LENGTH,
|
||||
system_program,
|
||||
},
|
||||
std::{
|
||||
cell::{Ref, RefCell},
|
||||
fmt::Debug,
|
||||
rc::Rc,
|
||||
},
|
||||
};
|
||||
|
||||
// The relevant state of an account before an Instruction executes, used
|
||||
@ -192,8 +194,10 @@ impl PreAccount {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use solana_sdk::{account::Account, instruction::InstructionError, system_program};
|
||||
use {
|
||||
super::*,
|
||||
solana_sdk::{account::Account, instruction::InstructionError, system_program},
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn test_is_zeroed() {
|
||||
|
@ -2,10 +2,12 @@
|
||||
//!
|
||||
//! The format of these log messages should not be modified to avoid breaking downstream consumers
|
||||
//! of program logging
|
||||
use crate::{ic_logger_msg, log_collector::LogCollector};
|
||||
use itertools::Itertools;
|
||||
use solana_sdk::{instruction::InstructionError, pubkey::Pubkey};
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
use {
|
||||
crate::{ic_logger_msg, log_collector::LogCollector},
|
||||
itertools::Itertools,
|
||||
solana_sdk::{instruction::InstructionError, pubkey::Pubkey},
|
||||
std::{cell::RefCell, rc::Rc},
|
||||
};
|
||||
|
||||
/// Log a program invoke.
|
||||
///
|
||||
|
@ -1,5 +1,4 @@
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use std::collections::HashMap;
|
||||
use {solana_sdk::pubkey::Pubkey, std::collections::HashMap};
|
||||
|
||||
#[derive(Default, Debug)]
|
||||
pub struct ProgramTiming {
|
||||
|
Reference in New Issue
Block a user