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