Reformat imports to a consistent style for imports
rustfmt.toml configuration: imports_granularity = "One" group_imports = "One"
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
use crate::id;
|
||||
use crate::{ConfigKeys, ConfigState};
|
||||
use solana_sdk::{
|
||||
instruction::{AccountMeta, Instruction},
|
||||
pubkey::Pubkey,
|
||||
system_instruction,
|
||||
use {
|
||||
crate::{id, ConfigKeys, ConfigState},
|
||||
solana_sdk::{
|
||||
instruction::{AccountMeta, Instruction},
|
||||
pubkey::Pubkey,
|
||||
system_instruction,
|
||||
},
|
||||
};
|
||||
|
||||
fn initialize_account<T: ConfigState>(config_pubkey: &Pubkey) -> Instruction {
|
||||
|
@@ -1,17 +1,19 @@
|
||||
//! Config program
|
||||
|
||||
use crate::ConfigKeys;
|
||||
use bincode::deserialize;
|
||||
use solana_program_runtime::{ic_msg, invoke_context::InvokeContext};
|
||||
use solana_sdk::{
|
||||
account::{ReadableAccount, WritableAccount},
|
||||
feature_set,
|
||||
instruction::InstructionError,
|
||||
keyed_account::keyed_account_at_index,
|
||||
program_utils::limited_deserialize,
|
||||
pubkey::Pubkey,
|
||||
use {
|
||||
crate::ConfigKeys,
|
||||
bincode::deserialize,
|
||||
solana_program_runtime::{ic_msg, invoke_context::InvokeContext},
|
||||
solana_sdk::{
|
||||
account::{ReadableAccount, WritableAccount},
|
||||
feature_set,
|
||||
instruction::InstructionError,
|
||||
keyed_account::keyed_account_at_index,
|
||||
program_utils::limited_deserialize,
|
||||
pubkey::Pubkey,
|
||||
},
|
||||
std::collections::BTreeSet,
|
||||
};
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
pub fn process_instruction(
|
||||
first_instruction_account: usize,
|
||||
@@ -137,18 +139,20 @@ pub fn process_instruction(
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{config_instruction, get_config_data, id, ConfigKeys, ConfigState};
|
||||
use bincode::serialized_size;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use solana_program_runtime::invoke_context::mock_process_instruction;
|
||||
use solana_sdk::{
|
||||
account::AccountSharedData,
|
||||
pubkey::Pubkey,
|
||||
signature::{Keypair, Signer},
|
||||
system_instruction::SystemInstruction,
|
||||
use {
|
||||
super::*,
|
||||
crate::{config_instruction, get_config_data, id, ConfigKeys, ConfigState},
|
||||
bincode::serialized_size,
|
||||
serde_derive::{Deserialize, Serialize},
|
||||
solana_program_runtime::invoke_context::mock_process_instruction,
|
||||
solana_sdk::{
|
||||
account::AccountSharedData,
|
||||
pubkey::Pubkey,
|
||||
signature::{Keypair, Signer},
|
||||
system_instruction::SystemInstruction,
|
||||
},
|
||||
std::{cell::RefCell, rc::Rc},
|
||||
};
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
|
||||
fn process_instruction(
|
||||
instruction_data: &[u8],
|
||||
|
@@ -1,14 +1,16 @@
|
||||
use crate::{config_instruction, ConfigState};
|
||||
///
|
||||
/// A library for creating a trusted date oracle.
|
||||
///
|
||||
use bincode::{deserialize, serialized_size};
|
||||
use chrono::{
|
||||
prelude::{Date, DateTime, TimeZone, Utc},
|
||||
serde::ts_seconds,
|
||||
use {
|
||||
crate::{config_instruction, ConfigState},
|
||||
chrono::{
|
||||
prelude::{Date, DateTime, TimeZone, Utc},
|
||||
serde::ts_seconds,
|
||||
},
|
||||
serde_derive::{Deserialize, Serialize},
|
||||
solana_sdk::{instruction::Instruction, pubkey::Pubkey},
|
||||
};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use solana_sdk::{instruction::Instruction, pubkey::Pubkey};
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
|
||||
pub struct DateConfig {
|
||||
|
@@ -3,16 +3,17 @@ pub mod config_instruction;
|
||||
pub mod config_processor;
|
||||
pub mod date_instruction;
|
||||
|
||||
use bincode::{deserialize, serialize, serialized_size};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use solana_sdk::{
|
||||
account::{Account, AccountSharedData},
|
||||
pubkey::Pubkey,
|
||||
short_vec,
|
||||
stake::config::Config as StakeConfig,
|
||||
};
|
||||
|
||||
pub use solana_sdk::config::program::id;
|
||||
use {
|
||||
bincode::{deserialize, serialize, serialized_size},
|
||||
serde_derive::{Deserialize, Serialize},
|
||||
solana_sdk::{
|
||||
account::{Account, AccountSharedData},
|
||||
pubkey::Pubkey,
|
||||
short_vec,
|
||||
stake::config::Config as StakeConfig,
|
||||
},
|
||||
};
|
||||
|
||||
pub trait ConfigState: serde::Serialize + Default {
|
||||
/// Maximum space that the serialized representation will require
|
||||
|
Reference in New Issue
Block a user