mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-14 03:17:19 +00:00
WalletTest: Split feeSolverAndCoinSelectionTest() into three.
This commit is contained in:
@@ -2271,9 +2271,7 @@ public class WalletTest extends TestWithWallet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void feeSolverAndCoinSelectionTest() throws Exception {
|
public void feeSolverAndCoinSelectionTest_dustySendRequested() throws Exception {
|
||||||
// Tests basic fee solving works
|
|
||||||
|
|
||||||
// Make sure TestWithWallet isnt doing anything crazy.
|
// Make sure TestWithWallet isnt doing anything crazy.
|
||||||
assertEquals(0, wallet.getTransactions(true).size());
|
assertEquals(0, wallet.getTransactions(true).size());
|
||||||
|
|
||||||
@@ -2300,9 +2298,14 @@ public class WalletTest extends TestWithWallet {
|
|||||||
SendRequest req = SendRequest.to(OTHER_ADDRESS, SATOSHI.multiply(12));
|
SendRequest req = SendRequest.to(OTHER_ADDRESS, SATOSHI.multiply(12));
|
||||||
assertNotNull(wallet.sendCoinsOffline(req));
|
assertNotNull(wallet.sendCoinsOffline(req));
|
||||||
assertEquals(ZERO, wallet.getBalance());
|
assertEquals(ZERO, wallet.getBalance());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void feeSolverAndCoinSelectionTests1() throws Exception {
|
||||||
|
// Tests basic fee solving works
|
||||||
|
|
||||||
// Add some reasonable-sized outputs
|
// Add some reasonable-sized outputs
|
||||||
block = new StoredBlock(makeSolvedTestBlock(blockStore, OTHER_ADDRESS), BigInteger.ONE, 1);
|
StoredBlock block = new StoredBlock(makeSolvedTestBlock(blockStore, OTHER_ADDRESS), BigInteger.ONE, 1);
|
||||||
Transaction tx4 = createFakeTx(PARAMS, Coin.COIN, myAddress);
|
Transaction tx4 = createFakeTx(PARAMS, Coin.COIN, myAddress);
|
||||||
wallet.receiveFromBlock(tx4, block, AbstractBlockChain.NewBlockType.BEST_CHAIN, 0);
|
wallet.receiveFromBlock(tx4, block, AbstractBlockChain.NewBlockType.BEST_CHAIN, 0);
|
||||||
|
|
||||||
@@ -2432,7 +2435,12 @@ public class WalletTest extends TestWithWallet {
|
|||||||
|
|
||||||
// Remove the coin from our wallet
|
// Remove the coin from our wallet
|
||||||
wallet.commitTx(spend11);
|
wallet.commitTx(spend11);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void feeSolverAndCoinSelectionTests2() throws Exception {
|
||||||
Transaction tx5 = createFakeTx(PARAMS, CENT, myAddress);
|
Transaction tx5 = createFakeTx(PARAMS, CENT, myAddress);
|
||||||
|
StoredBlock block = new StoredBlock(makeSolvedTestBlock(blockStore, OTHER_ADDRESS), BigInteger.ONE, 1);
|
||||||
wallet.receiveFromBlock(tx5, block, AbstractBlockChain.NewBlockType.BEST_CHAIN, 0);
|
wallet.receiveFromBlock(tx5, block, AbstractBlockChain.NewBlockType.BEST_CHAIN, 0);
|
||||||
assertEquals(CENT, wallet.getBalance());
|
assertEquals(CENT, wallet.getBalance());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user