v1.1 backport custom error rename (#9826)
* Add program_error conversions (#9203) * Rename CustomError to Custom (#9207) * More custom error rename (#9227) automerge * Remove librapay conflicts * Fix rebase Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
@@ -24,7 +24,7 @@ pub enum MyError {
|
||||
}
|
||||
impl From<MyError> for ProgramError {
|
||||
fn from(e: MyError) -> Self {
|
||||
ProgramError::CustomError(e as u32)
|
||||
ProgramError::Custom(e as u32)
|
||||
}
|
||||
}
|
||||
impl<T> DecodeError<T> for MyError {
|
||||
|
@@ -249,14 +249,14 @@ mod bpf {
|
||||
let result = bank_client.send_instruction(&mint_keypair, instruction);
|
||||
assert_eq!(
|
||||
result.unwrap_err().unwrap(),
|
||||
TransactionError::InstructionError(0, InstructionError::CustomError(0))
|
||||
TransactionError::InstructionError(0, InstructionError::Custom(0))
|
||||
);
|
||||
|
||||
let instruction = Instruction::new(program_id, &4u8, account_metas.clone());
|
||||
let result = bank_client.send_instruction(&mint_keypair, instruction);
|
||||
assert_eq!(
|
||||
result.unwrap_err().unwrap(),
|
||||
TransactionError::InstructionError(0, InstructionError::CustomError(42))
|
||||
TransactionError::InstructionError(0, InstructionError::Custom(42))
|
||||
);
|
||||
|
||||
let instruction = Instruction::new(program_id, &5u8, account_metas.clone());
|
||||
|
Reference in New Issue
Block a user