WalletTest: Extract empty sig constant.

This commit is contained in:
Andreas Schildbach 2016-01-17 18:06:30 +01:00 committed by Andreas Schildbach
parent 3cb1f6c6c5
commit ce32f2a5ba

View File

@ -3087,6 +3087,8 @@ public class WalletTest extends TestWithWallet {
assertEquals(200, tx.getInputs().size());
}
private static final byte[] EMPTY_SIG = {};
@Test
public void completeTxPartiallySignedWithDummySigs() throws Exception {
byte[] dummySig = TransactionSignature.dummy().encodeToBitcoin();
@ -3095,8 +3097,7 @@ public class WalletTest extends TestWithWallet {
@Test
public void completeTxPartiallySignedWithEmptySig() throws Exception {
byte[] emptySig = {};
completeTxPartiallySigned(Wallet.MissingSigsMode.USE_OP_ZERO, emptySig);
completeTxPartiallySigned(Wallet.MissingSigsMode.USE_OP_ZERO, EMPTY_SIG);
}
@Test (expected = ECKey.MissingPrivateKeyException.class)
@ -3119,14 +3120,12 @@ public class WalletTest extends TestWithWallet {
@Test
public void completeTxPartiallySignedMarriedWithEmptySig() throws Exception {
byte[] emptySig = {};
completeTxPartiallySignedMarried(Wallet.MissingSigsMode.USE_OP_ZERO, emptySig);
completeTxPartiallySignedMarried(Wallet.MissingSigsMode.USE_OP_ZERO, EMPTY_SIG);
}
@Test (expected = TransactionSigner.MissingSignatureException.class)
public void completeTxPartiallySignedMarriedThrows() throws Exception {
byte[] emptySig = {};
completeTxPartiallySignedMarried(Wallet.MissingSigsMode.THROW, emptySig);
completeTxPartiallySignedMarried(Wallet.MissingSigsMode.THROW, EMPTY_SIG);
}
@Test (expected = TransactionSigner.MissingSignatureException.class)