bonfida_test_utils/
error.rs

1use solana_program::program_error::ProgramError;
2use solana_program_test::{BanksClientError, ProgramTestError};
3
4#[derive(Debug)]
5pub enum TestError {
6    BanksClientError(BanksClientError),
7    ProgramError(ProgramError),
8    ProgramTestError(ProgramTestError),
9    AccountDoesNotExist,
10    InvalidTokenAccount,
11    InvalidTimestampForWarp,
12}
13
14impl From<BanksClientError> for TestError {
15    fn from(e: BanksClientError) -> Self {
16        Self::BanksClientError(e)
17    }
18}
19
20impl From<ProgramError> for TestError {
21    fn from(e: ProgramError) -> Self {
22        Self::ProgramError(e)
23    }
24}
25
26impl From<ProgramTestError> for TestError {
27    fn from(e: ProgramTestError) -> Self {
28        Self::ProgramTestError(e)
29    }
30}