3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-15 19:55:51 +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 {
wallet.completeTx(req);
fail("No exception was thrown trying to sign an encrypted key with the wrong password supplied.");
} catch (KeyCrypterException kce) {
assertEquals("Could not decrypt bytes", kce.getMessage());
} catch (KeyCrypterException.InvalidCipherText e) {
// Expected, either this...
} catch (KeyCrypterException.PublicPrivateMismatch e) {
// ...or this.
}
assertEquals("Wrong number of UNSPENT", 1, wallet.getPoolSize(WalletTransaction.Pool.UNSPENT));