Move ProgramError into sdk/

This commit is contained in:
Michael Vines 2018-12-03 12:26:23 -08:00
parent 68e99c18c0
commit 777a0a858e
9 changed files with 27 additions and 27 deletions

View File

@ -28,3 +28,24 @@ macro_rules! solana_entrypoint(
}
)
);
/// Reasons a program might have rejected an instruction.
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum ProgramError {
/// Contract's transactions resulted in an account with a negative balance
/// The difference from InsufficientFundsForFee is that the transaction was executed by the
/// contract
ResultWithNegativeTokens,
/// The program returned an error
GenericError,
/// Program's instruction token balance does not equal the balance after the instruction
UnbalancedInstruction,
/// Program modified an account's program id
ModifiedProgramId,
/// Program spent the tokens of an account that doesn't belong to it
ExternalAccountTokenSpend,
}

View File

@ -19,12 +19,12 @@ use native_loader;
use payment_plan::Payment;
use poh_recorder::PohRecorder;
use poh_service::NUM_TICKS_PER_SECOND;
use program::ProgramError;
use rayon::prelude::*;
use rpc::RpcSignatureStatus;
use runtime::{self, RuntimeError};
use solana_sdk::account::Account;
use solana_sdk::hash::{hash, Hash};
use solana_sdk::native_program::ProgramError;
use solana_sdk::pubkey::Pubkey;
use solana_sdk::signature::Keypair;
use solana_sdk::signature::Signature;

View File

@ -4,8 +4,8 @@ use budget_expr::BudgetExpr;
use budget_instruction::Instruction;
use chrono::prelude::{DateTime, Utc};
use payment_plan::Witness;
use program::ProgramError;
use solana_sdk::account::Account;
use solana_sdk::native_program::ProgramError;
use solana_sdk::pubkey::Pubkey;
use solana_sdk::transaction::Transaction;
use std::io;

View File

@ -56,7 +56,6 @@ pub mod payment_plan;
pub mod poh;
pub mod poh_recorder;
pub mod poh_service;
pub mod program;
pub mod recvmmsg;
pub mod replicate_stage;
pub mod replicator;

View File

@ -1,20 +0,0 @@
/// Reasons a program might have rejected an instruction.
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum ProgramError {
/// Contract's transactions resulted in an account with a negative balance
/// The difference from InsufficientFundsForFee is that the transaction was executed by the
/// contract
ResultWithNegativeTokens,
/// The program returned an error
GenericError,
/// Program's instruction token balance does not equal the balance after the instruction
UnbalancedInstruction,
/// Program modified an account's program id
ModifiedProgramId,
/// Program spent the tokens of an account that doesn't belong to it
ExternalAccountTokenSpend,
}

View File

@ -1,7 +1,7 @@
use budget_program;
use native_loader;
use program::ProgramError;
use solana_sdk::account::{create_keyed_accounts, Account, KeyedAccount};
use solana_sdk::native_program::ProgramError;
use solana_sdk::pubkey::Pubkey;
use solana_sdk::transaction::Transaction;
use storage_program;

View File

@ -3,9 +3,9 @@
//! and give reward for good proofs.
use bincode::deserialize;
use program::ProgramError;
use solana_sdk::account::Account;
use solana_sdk::hash::Hash;
use solana_sdk::native_program::ProgramError;
use solana_sdk::pubkey::Pubkey;
use solana_sdk::transaction::Transaction;

View File

@ -1,8 +1,8 @@
//! system program
use bincode::deserialize;
use program::ProgramError;
use solana_sdk::account::Account;
use solana_sdk::native_program::ProgramError;
use solana_sdk::pubkey::Pubkey;
use solana_sdk::system_instruction::{SystemInstruction, SYSTEM_PROGRAM_ID};
use solana_sdk::transaction::Transaction;

View File

@ -3,8 +3,8 @@
use bincode::{deserialize, serialize};
use byteorder::{ByteOrder, LittleEndian};
use program::ProgramError;
use solana_sdk::account::Account;
use solana_sdk::native_program::ProgramError;
use solana_sdk::pubkey::Pubkey;
use solana_sdk::transaction::Transaction;
use std;