Wallet: remove the output shuffling override for unit-tests

Only one unit-test was dependent on it. That test has been changed to manually disable the shuffling.
This commit is contained in:
Andreas Schildbach 2022-07-31 17:28:54 +02:00
parent d95e825112
commit 9da6616d5a
2 changed files with 4 additions and 3 deletions

View File

@ -3972,8 +3972,6 @@ public class Wallet extends BaseTaggableObject
public Transaction createSend(Address address, Coin value, boolean allowUnconfirmed)
throws InsufficientMoneyException, BadWalletEncryptionKeyException {
SendRequest req = SendRequest.to(address, value);
if (params.getId().equals(BitcoinNetwork.ID_UNITTESTNET))
req.shuffleOutputs = false;
if (allowUnconfirmed)
req.allowUnconfirmed();
completeTx(req);

View File

@ -803,7 +803,10 @@ public class WalletTest extends TestWithWallet {
Coin coinHalf = valueOf(0, 50);
assertEquals(1, wallet.getPoolSize(WalletTransaction.Pool.UNSPENT));
assertEquals(1, wallet.getTransactions(true).size());
Transaction outbound1 = wallet.createSend(OTHER_ADDRESS, coinHalf);
SendRequest req = SendRequest.to(OTHER_ADDRESS, coinHalf);
req.shuffleOutputs = false;
wallet.completeTx(req);
Transaction outbound1 = req.tx;
wallet.commitTx(outbound1);
sendMoneyToWallet(AbstractBlockChain.NewBlockType.BEST_CHAIN, outbound1);
assertTrue(outbound1.getWalletOutputs(wallet).size() <= 1); //the change address at most