Cleanup TODOs

This commit is contained in:
Manfred Karrer 2017-06-27 21:47:03 +02:00
parent 955a8b12ef
commit 8197be2c8a
23 changed files with 8 additions and 64 deletions

View file

@ -91,9 +91,6 @@ public class Version {
public static final String BSQ_TX_VERSION = "1";
public static int getP2PMessageVersion() {
// TODO investigate why a changed NETWORK_PROTOCOL_VERSION for the serialized objects does not trigger
// reliable a disconnect., but java serialisation should be replaced anyway, so using one existing field
// for the version is fine.
return p2pMessageVersion;
}

View file

@ -178,7 +178,6 @@ public class FileManager<T extends PersistableEnvelope> {
log.trace("Save {} completed in {} msec", storageFile, System.currentTimeMillis() - now);
}
// TODO Sometimes we get a ConcurrentModificationException here
private synchronized void saveToFile(T persistable, File dir, File storageFile) {
File tempFile = null;
FileOutputStream fileOutputStream = null;

View file

@ -1183,7 +1183,7 @@ public class TradeWalletService {
// We don't commit that tx to the wallet as it will be changed later and it's not signed yet.
// So it will not change the wallet balance.
checkNotNull(wallet, "wallet must not be null");
// TODO we got here exceptions with missing funds
// TODO we got here exceptions with missing funds. Not reproducable but leave log for better debugging.
log.info("print tx before wallet.completeTx: " + sendRequest.tx.toString());
wallet.completeTx(sendRequest);
} catch (Throwable t) {

View file

@ -132,7 +132,6 @@ public class WalletConfig extends AbstractIdleService {
public Wallet create(NetworkParameters params, KeyChainGroup keyChainGroup) {
// This is called when we load an existing wallet
// We have already the chain here so we can use this to distinguish.
//TODO refactor, make it more explicit
List<DeterministicKeyChain> deterministicKeyChains = keyChainGroup.getDeterministicKeyChains();
if (!deterministicKeyChains.isEmpty() && deterministicKeyChains.get(0) instanceof BisqDeterministicKeyChain) {
checkArgument(BisqEnvironment.isBaseCurrencySupportingBsq(), "BisqEnvironment.isBaseCurrencySupportingBsq() is false but we get get " +
@ -452,7 +451,6 @@ public class WalletConfig extends AbstractIdleService {
// Make sure we shut down cleanly.
installShutdownHook();
// TODO: Be able to use the provided download listener when doing a blocking startup.
final DownloadProgressTracker listener = new DownloadProgressTracker();
vPeerGroup.startBlockChainDownload(listener);
listener.await();

View file

@ -227,7 +227,6 @@ public class WalletsSetup {
// Initialize methods
///////////////////////////////////////////////////////////////////////////////////////////
// TODO add tests
@VisibleForTesting
private int evaluateMode(String socks5DiscoverModeString) {
String[] socks5DiscoverModes = StringUtils.deleteWhitespace(socks5DiscoverModeString).split(",");

View file

@ -69,7 +69,6 @@ public class DaoPeriodService {
}
public void onAllServicesInitialized() {
// TODO use blockchainService
/* bestChainHeight = btcWalletService.getBestChainHeight();
checkArgument(bestChainHeight >= GENESIS_BLOCK_HEIGHT, "GENESIS_BLOCK_HEIGHT must be in the past");

View file

@ -142,7 +142,6 @@ public abstract class BsqNode {
bsqChainStateListeners.stream().forEach(BsqChainStateListener::onBsqChainStateChanged);
}
//TODO
@SuppressWarnings("WeakerAccess")
protected void startReOrgFromLastSnapshot() {
applySnapshot();

View file

@ -47,7 +47,6 @@ public class ArbitratorTest {
null, null, null);
}
// TODO move to common if used often
public static byte[] getBytes(@SuppressWarnings("SameParameterValue") int count) {
return RandomUtils.nextBytes(count);
}

View file

@ -32,7 +32,7 @@ public class ProtoUtilTest {
//TODO CoreProtobufferResolver is not accessible here
// We should refactor it so that the classes themselves know how to deserialize
// so we don't get dependencies from core objects here
// -> use the base classes or interfaces instead (ProtoResolver, CoreProtoResolver)
@Test
public void testEnum() {
OfferPayload.Direction direction = OfferPayload.Direction.SELL;

View file

@ -148,7 +148,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
daoButton.setManaged(false);
}
// TODO can be removed once DAo is released
// TODO can be removed once DAO is released
UserThread.runAfter(() -> {
root.getScene().addEventHandler(KeyEvent.KEY_RELEASED, keyEvent -> {
if (Utilities.isAltOrCtrlPressed(KeyCode.D, keyEvent)) {

View file

@ -65,7 +65,6 @@ public class DebugView extends InitializableView<GridPane, Void> {
public DebugView() {
}
//TODO not updated yes with new protocol!
@Override
public void initialize() {

View file

@ -69,10 +69,7 @@ class TradesChartsViewModel extends ActivatableViewModel {
WEEK,
DAY,
HOUR,
MINUTE_10,
// TODO Can be removed after version 4.9.7
// Not used anymore but leave it as it might be used in preferences and could cause an exception if not there.
MINUTE
MINUTE_10
}
private final TradeStatisticsManager tradeStatisticsManager;
@ -345,8 +342,6 @@ class TradesChartsViewModel extends ActivatableViewModel {
return TimeUnit.MILLISECONDS.toHours(tradeDateAsTime);
case MINUTE_10:
return TimeUnit.MILLISECONDS.toMinutes(tradeDateAsTime) / 10;
case MINUTE:
return TimeUnit.MILLISECONDS.toMinutes(tradeDateAsTime);
default:
return tradeDateAsTime;
}
@ -366,8 +361,6 @@ class TradesChartsViewModel extends ActivatableViewModel {
return TimeUnit.HOURS.toMillis(tick);
case MINUTE_10:
return TimeUnit.MINUTES.toMillis(tick) * 10;
case MINUTE:
return TimeUnit.MINUTES.toMillis(tick);
default:
return tick;
}

View file

@ -295,8 +295,6 @@ class CreateOfferDataModel extends ActivatableDataModel {
Offer createAndGetOffer() {
final boolean useMarketBasedPriceValue = marketPriceAvailable && useMarketBasedPrice.get();
long priceAsLong = price.get() != null && !useMarketBasedPriceValue ? price.get().getValue() : 0L;
// We use precision 8 in AltcoinPrice but in OfferPayload we use Fiat with precision 4. Will be refactored once in a bigger update....
// TODO use same precision for both in next release
String currencyCode = tradeCurrencyCode.get();
boolean isCryptoCurrency = CurrencyUtil.isCryptoCurrency(currencyCode);
String baseCurrencyCode = isCryptoCurrency ? currencyCode : Res.getBaseCurrencyCode();
@ -351,7 +349,6 @@ class CreateOfferDataModel extends ActivatableDataModel {
checkArgument(buyerSecurityDepositAsCoin.compareTo(Restrictions.getMinBuyerSecurityDeposit()) >= 0,
"securityDeposit must be not be less than " +
Restrictions.getMinBuyerSecurityDeposit().toFriendlyString());
//TODO add createOfferFeeAsBsq
OfferPayload offerPayload = new OfferPayload(offerId,
new Date().getTime(),
p2PService.getAddress(),
@ -580,7 +577,6 @@ class CreateOfferDataModel extends ActivatableDataModel {
!volume.get().isZero() &&
!price.get().isZero()) {
try {
//TODO check for altcoins
amount.set(formatter.reduceTo4Decimals(price.get().getAmountByVolume(volume.get())));
calculateTotalToPay();
} catch (Throwable t) {

View file

@ -696,9 +696,6 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
onShowInfo(isPaymentAccountValidForOffer, hasMatchingArbitrator,
hasSameProtocolVersion, isIgnored, isOfferBanned, isNodeBanned);
});
//TODO
//tableRow.setTooltip(new Tooltip(""));
}
}

View file

@ -79,8 +79,6 @@ import java.util.concurrent.TimeUnit;
import static io.bisq.gui.util.FormBuilder.*;
import static javafx.beans.binding.Bindings.createStringBinding;
// TODO Implement other positioning method in InoutTextField to display it over the field instead of right side
// priceAmountHBox is too large after redesign as to be used as layoutReference.
@FxmlView
public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOfferViewModel> {
private final Navigation navigation;

View file

@ -402,7 +402,6 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
reasonWasScamRadioButton = new RadioButton(Res.get("disputeSummaryWindow.reason.scam"));
reasonWasBankRadioButton = new RadioButton(Res.get("disputeSummaryWindow.reason.bank"));
reasonWasOtherRadioButton = new RadioButton(Res.get("disputeSummaryWindow.reason.other"));
//TODO add banks as reason
HBox feeRadioButtonPane = new HBox();
feeRadioButtonPane.setSpacing(20);

View file

@ -96,10 +96,6 @@ class ClosedTradesViewModel extends ActivatableWithDataModel<ClosedTradesDataMod
if (item.getTradable() instanceof Trade) {
Trade trade = (Trade) item.getTradable();
// TODO
/* if (trade.isFailedState())
return "Failed";
else*/
if (trade.isWithdrawn() || trade.isPayoutPublished()) {
return Res.get("portfolio.closed.completed");
} else if (trade.getDisputeState() == Trade.DisputeState.DISPUTE_CLOSED) {

View file

@ -77,16 +77,6 @@ class FailedTradesViewModel extends ActivatableWithDataModel<FailedTradesDataMod
}
String getState(FailedTradesListItem item) {
if (item != null) {
//Trade trade = item.getTrade();
//TODO
//if (trade.isFailedState())
return Res.get("portfolio.failed.Failed");
/* else {
log.error("Wrong state " + trade.getTradeState());
return trade.getTradeState().toString();
}*/
}
return "";
return item != null ? Res.get("portfolio.failed.Failed") : "";
}
}

View file

@ -319,7 +319,6 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
log.debug("UI tradeState={}, id={}",
tradeState,
trade != null ? trade.getShortId() : "trade is null");
// TODO what is first valid state for trade?
switch (tradeState) {
// #################### Phase PREPARATION

View file

@ -169,8 +169,6 @@ public class BuyerStep4View extends TradeStepView {
String fromAddresses = fromAddressesEntry.getAddressString();
String toAddresses = withdrawAddressTextField.getText();
// TODO at some error situation it can be that the funds are already paid out and we get stuck here
// need handling to remove the trade (planned for next release)
Coin balance = walletService.getBalanceForAddress(fromAddressesEntry.getAddress());
try {
Transaction feeEstimationTransaction = walletService.getFeeEstimationTransaction(fromAddresses, toAddresses, amount, AddressEntry.Context.TRADE_PAYOUT);

View file

@ -54,20 +54,6 @@ public class AltCoinAddressValidatorTest {
assertFalse(validator.validate("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhek#").isValid);
}
// TODO test not successful
/* @Test
public void testXTO() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("XTO");
assertTrue(validator.validate("TddV2k4mbm6tkUYbv3zoEoiB3kDUFBdaRT").isValid);
assertTrue(validator.validate("2USHRW8UcSAAnHxWnPe4yX2BV5K3dbWss9").isValid);
assertFalse(validator.validate("TddV2k4mbm6tkUYbv3zoEoiB3kDUFBdaRTT").isValid);
assertFalse(validator.validate("TddV2k4mbm6tkUYbv3zoEoiB3kDUFBdaTo").isValid);
assertFalse(validator.validate("TddV2k4mbm6tkUYbv3zoEoiB3kDUFBdaRt#").isValid);
}*/
@Test
public void testIOP() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();

View file

@ -71,6 +71,7 @@ public class EncryptionServiceTests {
//TODO CoreProtobufferResolver is not accessible here
// We should refactor it so that the classes themselves know how to deserialize
// so we don't get dependencies from core objects here
// -> use the base classes or interfaces instead (ProtoResolver, CoreProtoResolver)
/*
@Test
public void testDecryptAndVerifyMessage() throws CryptoException {

View file

@ -124,6 +124,7 @@ public class P2PDataStorageTest {
//TODO CoreProtobufferResolver is not accessible here
// We should refactor it so that the classes themselves know how to deserialize
// so we don't get dependencies from core objects here
// -> use the base classes or interfaces instead (ProtoResolver, CoreProtoResolver)
ProtectedStorageEntry protectedStorageEntry = ProtoBufferUtilities.getProtectedStorageEntry(PB.ProtectedStorageEntry.parseFrom(new ByteArrayInputStream(byteOutputStream.toByteArray())));
assertTrue(Arrays.equals(Hash.getHash(data.getStoragePayload()), Hash.getHash(protectedStorageEntry.getStoragePayload())));
@ -134,6 +135,7 @@ public class P2PDataStorageTest {
//TODO CoreProtobufferResolver is not accessible here
// We should refactor it so that the classes themselves know how to deserialize
// so we don't get dependencies from core objects here
// -> use the base classes or interfaces instead (ProtoResolver, CoreProtoResolver)
/* @Test
public void testOfferRoundtrip() throws InvalidProtocolBufferException {
OfferPayload offer = getDummyOffer();