Move fn to sdk

This commit is contained in:
Tyera Eulberg
2021-02-16 10:26:02 -07:00
committed by Michael Vines
parent f929301c60
commit 7e17a0d3bb
2 changed files with 8 additions and 8 deletions

View File

@ -209,6 +209,13 @@ impl Instruction {
}
}
pub fn checked_add(a: u64, b: u64) -> Result<u64, InstructionError> {
match a.checked_add(b) {
Some(sum) => Ok(sum),
None => Err(InstructionError::InsufficientFunds),
}
}
/// Account metadata used to define Instructions
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
pub struct AccountMeta {