Allow for fixed error mappings (#1541)

This commit is contained in:
Jack May 2021-03-30 17:30:44 -07:00 committed by GitHub
parent 936ecef809
commit f390e12311
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 24 deletions

View File

@ -545,18 +545,15 @@ async fn test_initialize_stake_pool_with_not_rent_exempt_pool() {
],
recent_blockhash,
);
assert_eq!(
banks_client
.process_transaction(transaction)
.await
.unwrap_err()
.unwrap(),
TransactionError::InstructionError(
2,
InstructionError::InvalidError,
// should be InstructionError::AccountNotRentExempt, but the mapping
// is wrong
)
let result = banks_client
.process_transaction(transaction)
.await
.unwrap_err()
.unwrap();
assert!(
result == TransactionError::InstructionError(2, InstructionError::InvalidError,)
|| result
== TransactionError::InstructionError(2, InstructionError::AccountNotRentExempt,)
);
}
@ -621,18 +618,16 @@ async fn test_initialize_stake_pool_with_not_rent_exempt_validator_list() {
recent_blockhash,
);
assert_eq!(
banks_client
.process_transaction(transaction)
.await
.unwrap_err()
.unwrap(),
TransactionError::InstructionError(
2,
InstructionError::InvalidError,
// should be InstructionError::AccountNotRentExempt, but the mapping
// is wrong
)
let result = banks_client
.process_transaction(transaction)
.await
.unwrap_err()
.unwrap();
assert!(
result == TransactionError::InstructionError(2, InstructionError::InvalidError,)
|| result
== TransactionError::InstructionError(2, InstructionError::AccountNotRentExempt,)
);
}