Skip to content

Commit

Permalink
tests: simplify tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HashEngineering committed Nov 26, 2024
1 parent bc9cd5c commit 831bbde
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 21 deletions.
8 changes: 0 additions & 8 deletions core/src/test/java/org/bitcoinj/core/BlockChainTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public class BlockChainTest {
public ExpectedException thrown = ExpectedException.none();

private BlockChain testNetChain;
private DashSystem system;

private Wallet wallet;
private BlockChain chain;
Expand Down Expand Up @@ -98,13 +97,6 @@ public void receiveFromBlock(Transaction tx, StoredBlock block, BlockChain.NewBl
chain = new BlockChain(UNITTEST, wallet, blockStore);

coinbaseTo = Address.fromKey(UNITTEST, wallet.currentReceiveKey());
system = new DashSystem(Context.get());
system.initDash(false, true);
}

@Before
public void tearDown() {
system.remove();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void setUp() throws Exception {

@After
public void tearDown() {
DashSystem.remove(system);
system.remove();
}

public abstract BlockStore createStore(NetworkParameters params, int blockCount) throws BlockStoreException;
Expand Down
2 changes: 0 additions & 2 deletions core/src/test/java/org/bitcoinj/core/ChainSplitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import org.bitcoinj.core.listeners.TransactionConfidenceEventListener;
import org.bitcoinj.core.TransactionConfidence.ConfidenceType;
import org.bitcoinj.manager.DashSystem;
import org.bitcoinj.params.UnitTestParams;
import org.bitcoinj.store.MemoryBlockStore;
import org.bitcoinj.testing.FakeTxBuilder;
Expand Down Expand Up @@ -69,7 +68,6 @@ public void setUp() throws Exception {
coinsTo = Address.fromKey(UNITTEST, key1);
coinsTo2 = Address.fromKey(UNITTEST, key2);
someOtherGuy = Address.fromKey(UNITTEST, new ECKey());
//new DashSystem(Context.get()).initDash(false, true);
}

@Test
Expand Down
7 changes: 0 additions & 7 deletions core/src/test/java/org/bitcoinj/core/SporkMessageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package org.bitcoinj.core;

import org.bitcoinj.manager.DashSystem;
import org.bitcoinj.params.TestNet3Params;
import org.junit.Test;

Expand All @@ -25,12 +24,6 @@

public class SporkMessageTest {
static NetworkParameters PARAMS = TestNet3Params.get();
static Context context = new Context(PARAMS);
static DashSystem system = new DashSystem(context);

static {
system.initDash(true, true);
}

@Test
public void verifySpork() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,12 @@ public static Collection<Object[]> data() {
}

private void initContext() throws BlockStoreException {
//if (context == null || !context.getParams().equals(params))
context = new Context(params);
system = new DashSystem(context);
blockChain = new BlockChain(context, new SPVBlockStore(params, new File(Objects.requireNonNull(SimplifiedMasternodesTest.class.getResource(blockchainFile)).getPath())));

system.initDash(true, true);
peerGroup = new PeerGroup(context.getParams(), blockChain, blockChain);

//context.setPeerGroupAndBlockChain(peerGroup, blockChain, blockChain, true);
}

@Test
Expand Down

0 comments on commit 831bbde

Please sign in to comment.