-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* simplify a conditional * remove old allow() * replace some asserts with proper errors * add more error logging * use sysvar cache for clock in load_program * check that the test in the README compiles * combine some errors into LiteSVMError * move errors to error.rs * add test_nonexistent_program * update changelog
- Loading branch information
1 parent
c2eda9e
commit 7973d9b
Showing
7 changed files
with
192 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use solana_sdk::instruction::InstructionError; | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Debug)] | ||
pub enum InvalidSysvarDataError { | ||
#[error("Invalid Clock sysvar data.")] | ||
Clock, | ||
#[error("Invalid EpochRewards sysvar data.")] | ||
EpochRewards, | ||
#[error("Invalid EpochSchedule sysvar data.")] | ||
EpochSchedule, | ||
#[error("Invalid Fees sysvar data.")] | ||
Fees, | ||
#[error("Invalid LastRestartSlot sysvar data.")] | ||
LastRestartSlot, | ||
#[error("Invalid RecentBlockhashes sysvar data.")] | ||
RecentBlockhashes, | ||
#[error("Invalid Rent sysvar data.")] | ||
Rent, | ||
#[error("Invalid SlotHashes sysvar data.")] | ||
SlotHashes, | ||
#[error("Invalid StakeHistory sysvar data.")] | ||
StakeHistory, | ||
} | ||
|
||
#[derive(Error, Debug)] | ||
pub enum LiteSVMError { | ||
#[error("{0}")] | ||
InvalidSysvarData(#[from] InvalidSysvarDataError), | ||
#[error("{0}")] | ||
Instruction(#[from] InstructionError), | ||
} |
Oops, something went wrong.