mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-02 05:27:17 +00:00
UnitTestParams: Remove static address/key pair for testing. It wasn't really used by the unit tests.
This commit is contained in:
@@ -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;
|
||||
@@ -64,7 +60,6 @@ public class UnitTestParams extends AbstractBitcoinNetParams {
|
||||
public static synchronized UnitTestParams get() {
|
||||
if (instance == null) {
|
||||
instance = new UnitTestParams();
|
||||
TEST_ADDRESS = TEST_KEY.toAddress(instance);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.bitcoinj.core;
|
||||
|
||||
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.*;
|
||||
@@ -108,7 +107,7 @@ public class TransactionBroadcastTest extends TestWithPeerGroup {
|
||||
// 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));
|
||||
|
||||
Reference in New Issue
Block a user