use cleanup

This commit is contained in:
Solana Maintainers 2021-05-04 09:30:37 -07:00 committed by Michael Vines
parent d9fd11a8f3
commit 512497aa39
5 changed files with 49 additions and 39 deletions

View File

@ -1,9 +1,11 @@
use crate::error::NameServiceError;
use crate::processor::Processor;
use num_traits::FromPrimitive;
use solana_program::{
account_info::AccountInfo, decode_error::DecodeError, entrypoint, entrypoint::ProgramResult,
msg, program_error::PrintProgramError, pubkey::Pubkey,
use {
crate::error::NameServiceError,
crate::processor::Processor,
num_traits::FromPrimitive,
solana_program::{
account_info::AccountInfo, decode_error::DecodeError, entrypoint,
entrypoint::ProgramResult, msg, program_error::PrintProgramError, pubkey::Pubkey,
},
};
entrypoint!(process_instruction);

View File

@ -1,10 +1,12 @@
use num_derive::FromPrimitive;
use solana_program::{decode_error::DecodeError, program_error::ProgramError};
use thiserror::Error;
use {
num_derive::FromPrimitive,
solana_program::{decode_error::DecodeError, program_error::ProgramError},
thiserror::Error,
};
#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
pub enum NameServiceError {
#[error("Out of space.")]
#[error("Out of space")]
OutOfSpace,
}

View File

@ -1,9 +1,11 @@
use borsh::{BorshDeserialize, BorshSerialize};
use solana_program::{
use {
borsh::{BorshDeserialize, BorshSerialize},
solana_program::{
instruction::{AccountMeta, Instruction},
program_error::ProgramError,
pubkey::Pubkey,
system_program,
},
};
/// Instructions supported by the generic Name Registry program

View File

@ -1,10 +1,11 @@
use crate::{
use {
crate::{
instruction::NameRegistryInstruction,
state::get_seeds_and_key,
state::{write_data, NameRecordHeader},
};
use borsh::BorshDeserialize;
use solana_program::{
},
borsh::BorshDeserialize,
solana_program::{
account_info::{next_account_info, AccountInfo},
entrypoint::ProgramResult,
msg,
@ -13,6 +14,7 @@ use solana_program::{
program_pack::Pack,
pubkey::Pubkey,
system_instruction,
},
};
pub struct Processor {}

View File

@ -1,10 +1,12 @@
use borsh::{BorshDeserialize, BorshSerialize};
use solana_program::{
use {
borsh::{BorshDeserialize, BorshSerialize},
solana_program::{
account_info::AccountInfo,
msg,
program_error::ProgramError,
program_pack::{IsInitialized, Pack, Sealed},
pubkey::Pubkey,
},
};
/// The data for a Name Registry account is always prefixed a `NameRecordHeader` structure.