v1.1 backport custom error rename (bp #9826) (#9838)

automerge
This commit is contained in:
mergify[bot]
2020-05-01 01:58:15 -07:00
committed by GitHub
parent 5bc57ea004
commit 2deebe4d73
22 changed files with 116 additions and 79 deletions

View File

@@ -25,7 +25,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 {

View File

@@ -189,7 +189,7 @@ mod bpf {
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, &4u8, account_metas.clone());
@@ -398,14 +398,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, &6u8, account_metas.clone());