Move ProgramError into sdk/
This commit is contained in:
@ -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,
|
||||||
|
}
|
||||||
|
@ -19,12 +19,12 @@ use native_loader;
|
|||||||
use payment_plan::Payment;
|
use payment_plan::Payment;
|
||||||
use poh_recorder::PohRecorder;
|
use poh_recorder::PohRecorder;
|
||||||
use poh_service::NUM_TICKS_PER_SECOND;
|
use poh_service::NUM_TICKS_PER_SECOND;
|
||||||
use program::ProgramError;
|
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use rpc::RpcSignatureStatus;
|
use rpc::RpcSignatureStatus;
|
||||||
use runtime::{self, RuntimeError};
|
use runtime::{self, RuntimeError};
|
||||||
use solana_sdk::account::Account;
|
use solana_sdk::account::Account;
|
||||||
use solana_sdk::hash::{hash, Hash};
|
use solana_sdk::hash::{hash, Hash};
|
||||||
|
use solana_sdk::native_program::ProgramError;
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
use solana_sdk::signature::Keypair;
|
use solana_sdk::signature::Keypair;
|
||||||
use solana_sdk::signature::Signature;
|
use solana_sdk::signature::Signature;
|
||||||
|
@ -4,8 +4,8 @@ use budget_expr::BudgetExpr;
|
|||||||
use budget_instruction::Instruction;
|
use budget_instruction::Instruction;
|
||||||
use chrono::prelude::{DateTime, Utc};
|
use chrono::prelude::{DateTime, Utc};
|
||||||
use payment_plan::Witness;
|
use payment_plan::Witness;
|
||||||
use program::ProgramError;
|
|
||||||
use solana_sdk::account::Account;
|
use solana_sdk::account::Account;
|
||||||
|
use solana_sdk::native_program::ProgramError;
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
use solana_sdk::transaction::Transaction;
|
use solana_sdk::transaction::Transaction;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
@ -56,7 +56,6 @@ pub mod payment_plan;
|
|||||||
pub mod poh;
|
pub mod poh;
|
||||||
pub mod poh_recorder;
|
pub mod poh_recorder;
|
||||||
pub mod poh_service;
|
pub mod poh_service;
|
||||||
pub mod program;
|
|
||||||
pub mod recvmmsg;
|
pub mod recvmmsg;
|
||||||
pub mod replicate_stage;
|
pub mod replicate_stage;
|
||||||
pub mod replicator;
|
pub mod replicator;
|
||||||
|
@ -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,
|
|
||||||
}
|
|
@ -1,7 +1,7 @@
|
|||||||
use budget_program;
|
use budget_program;
|
||||||
use native_loader;
|
use native_loader;
|
||||||
use program::ProgramError;
|
|
||||||
use solana_sdk::account::{create_keyed_accounts, Account, KeyedAccount};
|
use solana_sdk::account::{create_keyed_accounts, Account, KeyedAccount};
|
||||||
|
use solana_sdk::native_program::ProgramError;
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
use solana_sdk::transaction::Transaction;
|
use solana_sdk::transaction::Transaction;
|
||||||
use storage_program;
|
use storage_program;
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
//! and give reward for good proofs.
|
//! and give reward for good proofs.
|
||||||
|
|
||||||
use bincode::deserialize;
|
use bincode::deserialize;
|
||||||
use program::ProgramError;
|
|
||||||
use solana_sdk::account::Account;
|
use solana_sdk::account::Account;
|
||||||
use solana_sdk::hash::Hash;
|
use solana_sdk::hash::Hash;
|
||||||
|
use solana_sdk::native_program::ProgramError;
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
use solana_sdk::transaction::Transaction;
|
use solana_sdk::transaction::Transaction;
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
//! system program
|
//! system program
|
||||||
|
|
||||||
use bincode::deserialize;
|
use bincode::deserialize;
|
||||||
use program::ProgramError;
|
|
||||||
use solana_sdk::account::Account;
|
use solana_sdk::account::Account;
|
||||||
|
use solana_sdk::native_program::ProgramError;
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
use solana_sdk::system_instruction::{SystemInstruction, SYSTEM_PROGRAM_ID};
|
use solana_sdk::system_instruction::{SystemInstruction, SYSTEM_PROGRAM_ID};
|
||||||
use solana_sdk::transaction::Transaction;
|
use solana_sdk::transaction::Transaction;
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
use bincode::{deserialize, serialize};
|
use bincode::{deserialize, serialize};
|
||||||
use byteorder::{ByteOrder, LittleEndian};
|
use byteorder::{ByteOrder, LittleEndian};
|
||||||
use program::ProgramError;
|
|
||||||
use solana_sdk::account::Account;
|
use solana_sdk::account::Account;
|
||||||
|
use solana_sdk::native_program::ProgramError;
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
use solana_sdk::transaction::Transaction;
|
use solana_sdk::transaction::Transaction;
|
||||||
use std;
|
use std;
|
||||||
|
Reference in New Issue
Block a user