atlas_program/
instruction.rs1pub use atlas_instruction::{
2 error::InstructionError, AccountMeta, Instruction, ProcessedSiblingInstruction,
3 TRANSACTION_LEVEL_STACK_HEIGHT,
4};
5
6pub fn get_processed_sibling_instruction(index: usize) -> Option<Instruction> {
19 #[cfg(target_os = "atlas")]
20 {
21 atlas_instruction::syscalls::get_processed_sibling_instruction(index)
22 }
23
24 #[cfg(not(target_os = "atlas"))]
25 {
26 crate::program_stubs::atlas_get_processed_sibling_instruction(index)
27 }
28}
29
30pub fn get_stack_height() -> usize {
34 #[cfg(target_os = "atlas")]
35 {
36 atlas_instruction::syscalls::get_stack_height()
37 }
38
39 #[cfg(not(target_os = "atlas"))]
40 {
41 crate::program_stubs::atlas_get_stack_height() as usize
42 }
43}
44
45#[doc(hidden)]
50pub fn checked_add(a: u64, b: u64) -> Result<u64, InstructionError> {
51 a.checked_add(b).ok_or(InstructionError::InsufficientFunds)
52}