Files
solana/programs/storage_api/src/lib.rs

26 lines
605 B
Rust
Raw Normal View History

pub mod storage_instruction;
pub mod storage_processor;
pub mod storage_state;
pub mod storage_transaction;
2019-03-04 20:45:26 -07:00
use solana_sdk::pubkey::Pubkey;
2018-12-04 08:20:41 -08:00
2019-01-17 14:41:48 -08:00
pub const ENTRIES_PER_SEGMENT: u64 = 16;
pub fn get_segment_from_entry(entry_height: u64) -> usize {
(entry_height / ENTRIES_PER_SEGMENT) as usize
}
2019-03-02 18:17:17 -07:00
const STORAGE_PROGRAM_ID: [u8; 32] = [
2018-12-04 08:20:41 -08:00
130, 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() == STORAGE_PROGRAM_ID
}
pub fn id() -> Pubkey {
Pubkey::new(&STORAGE_PROGRAM_ID)
}