2019-03-22 14:30:18 -06:00
|
|
|
pub mod storage_instruction;
|
2019-03-22 06:47:05 -06:00
|
|
|
pub mod storage_processor;
|
2019-03-22 14:30:18 -06:00
|
|
|
pub mod storage_state;
|
|
|
|
pub mod storage_transaction;
|
2019-03-22 06:47:05 -06:00
|
|
|
|
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)
|
|
|
|
}
|