solana-stake-program 5.0.0

Solana BPF Stake Program
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use {solana_instruction_error::InstructionError, solana_program_error::ProgramError};

pub(crate) mod delegate;
pub(crate) use delegate::*;

pub(crate) mod merge;
pub(crate) use merge::*;

pub(crate) fn checked_add(a: u64, b: u64) -> Result<u64, ProgramError> {
    a.checked_add(b).ok_or(ProgramError::InsufficientFunds)
}

pub(crate) fn to_program_error(e: InstructionError) -> ProgramError {
    ProgramError::try_from(e).unwrap_or(ProgramError::InvalidAccountData)
}