DefaultCoinSelector, AllowUnconfirmedCoinSelector: change return type of get() to CoinSelector

This commit is contained in:
Andreas Schildbach 2023-04-02 00:25:26 +02:00
parent 116194f39e
commit 7879f24164
3 changed files with 4 additions and 4 deletions

View File

@ -28,7 +28,7 @@ public class AllowUnconfirmedCoinSelector extends DefaultCoinSelector {
return true;
}
public static AllowUnconfirmedCoinSelector get() {
public static CoinSelector get() {
return new AllowUnconfirmedCoinSelector();
}
}

View File

@ -104,7 +104,7 @@ public class DefaultCoinSelector implements CoinSelector {
(confidence.numBroadcastPeers() > 0 || tx.getParams().network() == BitcoinNetwork.REGTEST);
}
public static DefaultCoinSelector get() {
public static CoinSelector get() {
return new DefaultCoinSelector();
}
}

View File

@ -88,7 +88,7 @@ public class DefaultCoinSelectorTest extends TestWithWallet {
Transaction t2 = Objects.requireNonNull(sendMoneyToWallet(AbstractBlockChain.NewBlockType.BEST_CHAIN, COIN));
// Check we selected just the oldest one.
DefaultCoinSelector selector = DefaultCoinSelector.get();
CoinSelector selector = DefaultCoinSelector.get();
CoinSelection selection = selector.select(COIN, wallet.calculateAllSpendCandidates());
assertTrue(selection.outputs().contains(t1.getOutputs().get(0)));
assertEquals(COIN, selection.totalValue());
@ -136,7 +136,7 @@ public class DefaultCoinSelectorTest extends TestWithWallet {
);
t.getConfidence().setConfidenceType(TransactionConfidence.ConfidenceType.BUILDING);
DefaultCoinSelector selector = DefaultCoinSelector.get();
CoinSelector selector = DefaultCoinSelector.get();
CoinSelection selection = selector.select(COIN.multiply(2), outputs);
assertTrue(selection.outputs().size() == 4);