mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-18 21:32:35 +01:00
WalletTest: Extract empty sig constant.
This commit is contained in:
parent
3cb1f6c6c5
commit
ce32f2a5ba
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user