3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-19 13:45:48 +00:00

WalletTest: Be more specific about the expected exception in basicSpendingCommon() when supplying a wrong password.

This commit is contained in:
Andreas Schildbach 2019-03-31 13:43:06 +02:00
parent f1e67faa0b
commit 57d0eef454

View File

@ -367,8 +367,10 @@ public class WalletTest extends TestWithWallet {
try { try {
wallet.completeTx(req); wallet.completeTx(req);
fail("No exception was thrown trying to sign an encrypted key with the wrong password supplied."); fail("No exception was thrown trying to sign an encrypted key with the wrong password supplied.");
} catch (KeyCrypterException kce) { } catch (KeyCrypterException.InvalidCipherText e) {
assertEquals("Could not decrypt bytes", kce.getMessage()); // Expected, either this...
} catch (KeyCrypterException.PublicPrivateMismatch e) {
// ...or this.
} }
assertEquals("Wrong number of UNSPENT", 1, wallet.getPoolSize(WalletTransaction.Pool.UNSPENT)); assertEquals("Wrong number of UNSPENT", 1, wallet.getPoolSize(WalletTransaction.Pool.UNSPENT));