Skip to content

Commit

Permalink
UnitTestParams: Remove static address/key pair for testing. It wasn't…
Browse files Browse the repository at this point in the history
… really used by the unit tests.
  • Loading branch information
schildbach committed Dec 5, 2015
1 parent be794e8 commit c0b2e7c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
5 changes: 0 additions & 5 deletions core/src/main/java/org/bitcoinj/params/UnitTestParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ public class UnitTestParams extends AbstractBitcoinNetParams {
public static final int TESTNET_MAJORITY_REJECT_BLOCK_OUTDATED = 6;
public static final int TESTNET_MAJORITY_ENFORCE_BLOCK_UPGRADE = 4;

// A simple static key/address for re-use in unit tests, to speed things up.
public static ECKey TEST_KEY = new ECKey();
public static Address TEST_ADDRESS;

public UnitTestParams() {
super();
id = ID_UNITTESTNET;
Expand Down Expand Up @@ -64,7 +60,6 @@ public UnitTestParams() {
public static synchronized UnitTestParams get() {
if (instance == null) {
instance = new UnitTestParams();
TEST_ADDRESS = TEST_KEY.toAddress(instance);
}
return instance;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import com.google.common.util.concurrent.*;
import org.bitcoinj.core.listeners.AbstractWalletEventListener;
import org.bitcoinj.params.*;
import org.bitcoinj.testing.*;
import org.bitcoinj.utils.*;
import org.junit.*;
Expand Down Expand Up @@ -108,7 +107,7 @@ public void lateProgressCallback() throws Exception {
// immediately with the latest state. This avoids API users writing accidentally racy code when they use
// a convenience method like peerGroup.broadcastTransaction.
InboundMessageQueuer[] channels = { connectPeer(1), connectPeer(2), connectPeer(3), connectPeer(4) };
Transaction tx = FakeTxBuilder.createFakeTx(params, CENT, UnitTestParams.TEST_ADDRESS);
Transaction tx = FakeTxBuilder.createFakeTx(params, CENT, address);
tx.getConfidence().setSource(TransactionConfidence.Source.SELF);
TransactionBroadcast broadcast = peerGroup.broadcastTransaction(tx);
inbound(channels[1], InventoryMessage.with(tx));
Expand Down

0 comments on commit c0b2e7c

Please sign in to comment.