Add sdk native_loader.rs
This commit is contained in:
parent
bf2658cee0
commit
63a758508a
|
@ -1,6 +1,7 @@
|
|||
pub mod account;
|
||||
pub mod hash;
|
||||
pub mod loader_instruction;
|
||||
pub mod native_loader;
|
||||
pub mod native_program;
|
||||
pub mod packet;
|
||||
pub mod pubkey;
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
use pubkey::Pubkey;
|
||||
|
||||
pub const NATIVE_LOADER_PROGRAM_ID: [u8; 32] = [
|
||||
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
];
|
||||
|
||||
pub fn id() -> Pubkey {
|
||||
Pubkey::new(&NATIVE_LOADER_PROGRAM_ID)
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
//! BPF loader
|
||||
use native_loader;
|
||||
use solana_sdk::account::Account;
|
||||
use solana_sdk::native_loader;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
|
||||
const BPF_LOADER_NAME: &str = "solana_bpf_loader";
|
||||
|
|
|
@ -7,6 +7,7 @@ use libloading::os::unix::*;
|
|||
use libloading::os::windows::*;
|
||||
use solana_sdk::account::KeyedAccount;
|
||||
use solana_sdk::loader_instruction::LoaderInstruction;
|
||||
pub use solana_sdk::native_loader::*;
|
||||
use solana_sdk::native_program;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use std::env;
|
||||
|
@ -41,18 +42,10 @@ fn create_path(name: &str) -> PathBuf {
|
|||
)
|
||||
}
|
||||
|
||||
const NATIVE_LOADER_PROGRAM_ID: [u8; 32] = [
|
||||
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
];
|
||||
|
||||
pub fn check_id(program_id: &Pubkey) -> bool {
|
||||
program_id.as_ref() == NATIVE_LOADER_PROGRAM_ID
|
||||
}
|
||||
|
||||
pub fn id() -> Pubkey {
|
||||
Pubkey::new(&NATIVE_LOADER_PROGRAM_ID)
|
||||
}
|
||||
|
||||
pub fn process_instruction(
|
||||
program_id: &Pubkey,
|
||||
keyed_accounts: &mut [KeyedAccount],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! ERC20-like Token program
|
||||
use native_loader;
|
||||
use solana_sdk::account::Account;
|
||||
use solana_sdk::native_loader;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
|
||||
const ERC20_NAME: &str = "solana_erc20";
|
||||
|
|
Loading…
Reference in New Issue