mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-13 02:35:52 +00:00
WalletTest: Remove paranoid test preconditions.
This commit is contained in:
parent
a3db2229c1
commit
98bee183b6
@ -80,8 +80,7 @@ public class WalletTest extends TestWithWallet {
|
||||
|
||||
private SecureRandom secureRandom = new SecureRandom();
|
||||
|
||||
private final ECKey OTHER_KEY = new ECKey();
|
||||
private final Address OTHER_ADDRESS = OTHER_KEY.toAddress(PARAMS);
|
||||
private final Address OTHER_ADDRESS = new ECKey().toAddress(PARAMS);
|
||||
|
||||
@Before
|
||||
@Override
|
||||
@ -2272,9 +2271,6 @@ public class WalletTest extends TestWithWallet {
|
||||
|
||||
@Test
|
||||
public void feeSolverAndCoinSelectionTest_dustySendRequested() throws Exception {
|
||||
// Make sure TestWithWallet isnt doing anything crazy.
|
||||
assertEquals(0, wallet.getTransactions(true).size());
|
||||
|
||||
// Generate a few outputs to us that are far too small to spend reasonably
|
||||
StoredBlock block = new StoredBlock(makeSolvedTestBlock(blockStore, OTHER_ADDRESS), BigInteger.ONE, 1);
|
||||
Transaction tx1 = createFakeTx(PARAMS, SATOSHI, myAddress);
|
||||
@ -2700,8 +2696,6 @@ public class WalletTest extends TestWithWallet {
|
||||
@Test
|
||||
public void basicCategoryStepTest() throws Exception {
|
||||
// Creates spends that step through the possible fee solver categories
|
||||
// Make sure TestWithWallet isnt doing anything crazy.
|
||||
assertEquals(0, wallet.getTransactions(true).size());
|
||||
|
||||
// Generate a ton of small outputs
|
||||
StoredBlock block = new StoredBlock(makeSolvedTestBlock(blockStore, OTHER_ADDRESS), BigInteger.ONE, 1);
|
||||
@ -2785,9 +2779,6 @@ public class WalletTest extends TestWithWallet {
|
||||
public void testCategory2WithChange() throws Exception {
|
||||
// Specifically target case 2 with significant change
|
||||
|
||||
// Make sure TestWithWallet isnt doing anything crazy.
|
||||
assertEquals(0, wallet.getTransactions(true).size());
|
||||
|
||||
// Generate a ton of small outputs
|
||||
StoredBlock block = new StoredBlock(makeSolvedTestBlock(blockStore, OTHER_ADDRESS), BigInteger.ONE, 1);
|
||||
int i = 0;
|
||||
@ -2861,9 +2852,6 @@ public class WalletTest extends TestWithWallet {
|
||||
public void feePerKbCategoryJumpTest() throws Exception {
|
||||
// Simple test of boundary condition on fee per kb in category fee solver
|
||||
|
||||
// Make sure TestWithWallet isnt doing anything crazy.
|
||||
assertEquals(0, wallet.getTransactions(true).size());
|
||||
|
||||
// Generate a ton of small outputs
|
||||
StoredBlock block = new StoredBlock(makeSolvedTestBlock(blockStore, OTHER_ADDRESS), BigInteger.ONE, 1);
|
||||
Transaction tx = createFakeTx(PARAMS, COIN, myAddress);
|
||||
@ -2908,8 +2896,6 @@ public class WalletTest extends TestWithWallet {
|
||||
@Test
|
||||
public void testCompleteTxWithExistingInputs() throws Exception {
|
||||
// Tests calling completeTx with a SendRequest that already has a few inputs in it
|
||||
// Make sure TestWithWallet isnt doing anything crazy.
|
||||
assertEquals(0, wallet.getTransactions(true).size());
|
||||
|
||||
// Generate a few outputs to us
|
||||
StoredBlock block = new StoredBlock(makeSolvedTestBlock(blockStore, OTHER_ADDRESS), BigInteger.ONE, 1);
|
||||
|
@ -30,12 +30,10 @@ import static org.bitcoinj.testing.FakeTxBuilder.createFakeTx;
|
||||
// TODO: This needs to be somewhat rewritten - the "sendMoneyToWallet" methods aren't sending via the block chain object
|
||||
|
||||
/**
|
||||
* A utility class that you can derive from in your unit tests. TestWithWallet sets up a wallet with a key,
|
||||
* an in memory block store and a block chain object. It also provides helper methods for filling the wallet
|
||||
* A utility class that you can derive from in your unit tests. TestWithWallet sets up an empty wallet,
|
||||
* an in-memory block store and a block chain object. It also provides helper methods for filling the wallet
|
||||
* with money in whatever ways you wish. Note that for simplicity with amounts, this class sets the default
|
||||
* fee per kilobyte to zero in setUp and back to normal in tearDown. If you are wanting to test your behaviour
|
||||
* with fees (a good idea!) make sure you set the {@link Wallet.SendRequest#DEFAULT_FEE_PER_KB} value to
|
||||
* {@link Transaction#REFERENCE_DEFAULT_MIN_TX_FEE} before doing so.
|
||||
* fee per kilobyte to zero in setUp.
|
||||
*/
|
||||
public class TestWithWallet {
|
||||
protected static final NetworkParameters PARAMS = UnitTestParams.get();
|
||||
|
Loading…
x
Reference in New Issue
Block a user