Removing star and unused imports with checkstyle

This commit is contained in:
napoly 2023-03-14 20:28:47 +01:00 committed by woodser
parent ce05710537
commit 3b8f19c4ce
1206 changed files with 5197 additions and 6620 deletions

View file

@ -17,8 +17,6 @@
package haveno.cli;
import haveno.proto.grpc.OfferInfo;
import haveno.proto.grpc.TradeInfo;
import haveno.cli.opts.ArgumentList;
import haveno.cli.opts.CancelOfferOptionParser;
import haveno.cli.opts.CreateCryptoCurrencyPaymentAcctOptionParser;
@ -31,45 +29,87 @@ import haveno.cli.opts.GetOffersOptionParser;
import haveno.cli.opts.GetPaymentAcctFormOptionParser;
import haveno.cli.opts.GetTradeOptionParser;
import haveno.cli.opts.GetTradesOptionParser;
import haveno.cli.opts.GetTransactionOptionParser;
import haveno.cli.opts.OfferIdOptionParser;
import haveno.cli.opts.RegisterDisputeAgentOptionParser;
import haveno.cli.opts.RemoveWalletPasswordOptionParser;
import haveno.cli.opts.SendBtcOptionParser;
import haveno.cli.opts.SetTxFeeRateOptionParser;
import haveno.cli.opts.SetWalletPasswordOptionParser;
import haveno.cli.opts.SimpleMethodOptionParser;
import haveno.cli.opts.TakeOfferOptionParser;
import haveno.cli.opts.UnlockWalletOptionParser;
import haveno.cli.opts.WithdrawFundsOptionParser;
import haveno.cli.table.builder.TableBuilder;
import haveno.proto.grpc.OfferInfo;
import io.grpc.StatusRuntimeException;
import joptsimple.OptionParser;
import joptsimple.OptionSet;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import lombok.extern.slf4j.Slf4j;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Date;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import static haveno.proto.grpc.GetTradesRequest.Category.CLOSED;
import static haveno.proto.grpc.GetTradesRequest.Category.OPEN;
import static haveno.cli.CurrencyFormat.formatInternalFiatPrice;
import static haveno.cli.CurrencyFormat.toSatoshis;
import static haveno.cli.Method.*;
import static haveno.cli.opts.OptLabel.*;
import static haveno.cli.table.builder.TableType.*;
import static haveno.cli.Method.canceloffer;
import static haveno.cli.Method.closetrade;
import static haveno.cli.Method.confirmpaymentreceived;
import static haveno.cli.Method.confirmpaymentsent;
import static haveno.cli.Method.createcryptopaymentacct;
import static haveno.cli.Method.createoffer;
import static haveno.cli.Method.createpaymentacct;
import static haveno.cli.Method.editoffer;
import static haveno.cli.Method.failtrade;
import static haveno.cli.Method.getaddressbalance;
import static haveno.cli.Method.getbalance;
import static haveno.cli.Method.getbtcprice;
import static haveno.cli.Method.getfundingaddresses;
import static haveno.cli.Method.getmyoffer;
import static haveno.cli.Method.getmyoffers;
import static haveno.cli.Method.getoffer;
import static haveno.cli.Method.getoffers;
import static haveno.cli.Method.getpaymentacctform;
import static haveno.cli.Method.getpaymentaccts;
import static haveno.cli.Method.getpaymentmethods;
import static haveno.cli.Method.gettrade;
import static haveno.cli.Method.gettrades;
import static haveno.cli.Method.gettransaction;
import static haveno.cli.Method.gettxfeerate;
import static haveno.cli.Method.getunusedbsqaddress;
import static haveno.cli.Method.getversion;
import static haveno.cli.Method.lockwallet;
import static haveno.cli.Method.sendbtc;
import static haveno.cli.Method.settxfeerate;
import static haveno.cli.Method.setwalletpassword;
import static haveno.cli.Method.stop;
import static haveno.cli.Method.takeoffer;
import static haveno.cli.Method.unfailtrade;
import static haveno.cli.Method.unlockwallet;
import static haveno.cli.Method.unsettxfeerate;
import static haveno.cli.Method.withdrawfunds;
import static haveno.cli.opts.OptLabel.OPT_AMOUNT;
import static haveno.cli.opts.OptLabel.OPT_HELP;
import static haveno.cli.opts.OptLabel.OPT_HOST;
import static haveno.cli.opts.OptLabel.OPT_PASSWORD;
import static haveno.cli.opts.OptLabel.OPT_PORT;
import static haveno.cli.opts.OptLabel.OPT_TX_FEE_RATE;
import static haveno.cli.table.builder.TableType.ADDRESS_BALANCE_TBL;
import static haveno.cli.table.builder.TableType.BTC_BALANCE_TBL;
import static haveno.cli.table.builder.TableType.CLOSED_TRADES_TBL;
import static haveno.cli.table.builder.TableType.FAILED_TRADES_TBL;
import static haveno.cli.table.builder.TableType.OFFER_TBL;
import static haveno.cli.table.builder.TableType.OPEN_TRADES_TBL;
import static haveno.cli.table.builder.TableType.PAYMENT_ACCOUNT_TBL;
import static haveno.cli.table.builder.TableType.TRADE_DETAIL_TBL;
import static haveno.proto.grpc.GetTradesRequest.Category.CLOSED;
import static haveno.proto.grpc.GetTradesRequest.Category.OPEN;
import static java.lang.String.format;
import static java.lang.System.err;
import static java.lang.System.exit;

View file

@ -19,12 +19,10 @@ package haveno.cli;
import com.google.common.annotations.VisibleForTesting;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.math.BigDecimal;
import java.util.Locale;
import static java.lang.String.format;

View file

@ -17,6 +17,10 @@
package haveno.cli;
import haveno.cli.request.OffersServiceRequest;
import haveno.cli.request.PaymentAccountsServiceRequest;
import haveno.cli.request.TradesServiceRequest;
import haveno.cli.request.WalletsServiceRequest;
import haveno.proto.grpc.AddressBalanceInfo;
import haveno.proto.grpc.BalancesInfo;
import haveno.proto.grpc.BtcBalanceInfo;
@ -27,18 +31,12 @@ import haveno.proto.grpc.OfferInfo;
import haveno.proto.grpc.RegisterDisputeAgentRequest;
import haveno.proto.grpc.StopRequest;
import haveno.proto.grpc.TradeInfo;
import haveno.cli.request.OffersServiceRequest;
import haveno.cli.request.PaymentAccountsServiceRequest;
import haveno.cli.request.TradesServiceRequest;
import haveno.cli.request.WalletsServiceRequest;
import lombok.extern.slf4j.Slf4j;
import protobuf.PaymentAccount;
import protobuf.PaymentAccountForm;
import protobuf.PaymentMethod;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
@SuppressWarnings("ResultOfMethodCallIgnored")
@Slf4j

View file

@ -26,7 +26,6 @@ import haveno.proto.grpc.PriceGrpc;
import haveno.proto.grpc.ShutdownServerGrpc;
import haveno.proto.grpc.TradesGrpc;
import haveno.proto.grpc.WalletsGrpc;
import io.grpc.CallCredentials;
import io.grpc.ManagedChannelBuilder;

View file

@ -21,13 +21,12 @@ import joptsimple.OptionException;
import joptsimple.OptionParser;
import joptsimple.OptionSet;
import joptsimple.OptionSpec;
import lombok.Getter;
import java.util.List;
import java.util.function.Function;
import java.util.function.Predicate;
import lombok.Getter;
import static haveno.cli.opts.OptLabel.OPT_HELP;
import static java.lang.String.format;

View file

@ -20,7 +20,14 @@ package haveno.cli.opts;
import joptsimple.OptionSpec;
import static haveno.cli.opts.OptLabel.*;
import static haveno.cli.opts.OptLabel.OPT_AMOUNT;
import static haveno.cli.opts.OptLabel.OPT_CURRENCY_CODE;
import static haveno.cli.opts.OptLabel.OPT_DIRECTION;
import static haveno.cli.opts.OptLabel.OPT_FIXED_PRICE;
import static haveno.cli.opts.OptLabel.OPT_MIN_AMOUNT;
import static haveno.cli.opts.OptLabel.OPT_MKT_PRICE_MARGIN;
import static haveno.cli.opts.OptLabel.OPT_PAYMENT_ACCOUNT_ID;
import static haveno.cli.opts.OptLabel.OPT_SECURITY_DEPOSIT;
import static joptsimple.internal.Strings.EMPTY;
public class CreateOfferOptionParser extends AbstractMethodOptionParser implements MethodOpts {

View file

@ -18,10 +18,10 @@
package haveno.cli.opts;
import static haveno.cli.opts.OptLabel.OPT_ADDRESS;
import joptsimple.OptionSpec;
import static haveno.cli.opts.OptLabel.OPT_ADDRESS;
public class GetAddressBalanceOptionParser extends AbstractMethodOptionParser implements MethodOpts {
final OptionSpec<String> addressOpt = parser.accepts(OPT_ADDRESS, "wallet btc address")

View file

@ -18,10 +18,10 @@
package haveno.cli.opts;
import static haveno.cli.opts.OptLabel.OPT_CURRENCY_CODE;
import joptsimple.OptionSpec;
import static haveno.cli.opts.OptLabel.OPT_CURRENCY_CODE;
public class GetBTCMarketPriceOptionParser extends AbstractMethodOptionParser implements MethodOpts {
final OptionSpec<String> currencyCodeOpt = parser.accepts(OPT_CURRENCY_CODE, "currency-code")

View file

@ -18,10 +18,10 @@
package haveno.cli.opts;
import static haveno.cli.opts.OptLabel.OPT_OFFER_ID;
import joptsimple.OptionSpec;
import static haveno.cli.opts.OptLabel.OPT_OFFER_ID;
public class GetOfferOptionParser extends AbstractMethodOptionParser implements MethodOpts {
final OptionSpec<String> offerIdOpt = parser.accepts(OPT_OFFER_ID, "id of offer to get")

View file

@ -18,11 +18,11 @@
package haveno.cli.opts;
import joptsimple.OptionSpec;
import static haveno.cli.opts.OptLabel.OPT_CURRENCY_CODE;
import static haveno.cli.opts.OptLabel.OPT_DIRECTION;
import joptsimple.OptionSpec;
public class GetOffersOptionParser extends AbstractMethodOptionParser implements MethodOpts {
final OptionSpec<String> directionOpt = parser.accepts(OPT_DIRECTION, "offer direction (buy|sell)")

View file

@ -18,10 +18,10 @@
package haveno.cli.opts;
import static haveno.cli.opts.OptLabel.OPT_PAYMENT_METHOD_ID;
import joptsimple.OptionSpec;
import static haveno.cli.opts.OptLabel.OPT_PAYMENT_METHOD_ID;
public class GetPaymentAcctFormOptionParser extends AbstractMethodOptionParser implements MethodOpts {
final OptionSpec<String> paymentMethodIdOpt = parser.accepts(OPT_PAYMENT_METHOD_ID,

View file

@ -18,11 +18,11 @@
package haveno.cli.opts;
import joptsimple.OptionSpec;
import static haveno.cli.opts.OptLabel.OPT_SHOW_CONTRACT;
import static haveno.cli.opts.OptLabel.OPT_TRADE_ID;
import joptsimple.OptionSpec;
public class GetTradeOptionParser extends AbstractMethodOptionParser implements MethodOpts {
final OptionSpec<String> tradeIdOpt = parser.accepts(OPT_TRADE_ID, "id of trade")

View file

@ -19,15 +19,14 @@ package haveno.cli.opts;
import haveno.proto.grpc.GetTradesRequest;
import joptsimple.OptionSpec;
import java.util.function.Predicate;
import static haveno.cli.opts.OptLabel.OPT_CATEGORY;
import static haveno.proto.grpc.GetTradesRequest.Category.CLOSED;
import static haveno.proto.grpc.GetTradesRequest.Category.FAILED;
import static haveno.proto.grpc.GetTradesRequest.Category.OPEN;
import static haveno.cli.opts.OptLabel.OPT_CATEGORY;
import static java.util.Arrays.stream;
public class GetTradesOptionParser extends AbstractMethodOptionParser implements MethodOpts {

View file

@ -18,10 +18,10 @@
package haveno.cli.opts;
import static haveno.cli.opts.OptLabel.OPT_TRANSACTION_ID;
import joptsimple.OptionSpec;
import static haveno.cli.opts.OptLabel.OPT_TRANSACTION_ID;
public class GetTransactionOptionParser extends AbstractMethodOptionParser implements MethodOpts {
final OptionSpec<String> txIdOpt = parser.accepts(OPT_TRANSACTION_ID, "id of transaction")

View file

@ -18,10 +18,10 @@
package haveno.cli.opts;
import static haveno.cli.opts.OptLabel.OPT_OFFER_ID;
import joptsimple.OptionSpec;
import static haveno.cli.opts.OptLabel.OPT_OFFER_ID;
/**
* Superclass for option parsers requiring an offer-id. Avoids a small amount of
* duplicated boilerplate.

View file

@ -18,11 +18,11 @@
package haveno.cli.opts;
import joptsimple.OptionSpec;
import static haveno.cli.opts.OptLabel.OPT_DISPUTE_AGENT_TYPE;
import static haveno.cli.opts.OptLabel.OPT_REGISTRATION_KEY;
import joptsimple.OptionSpec;
public class RegisterDisputeAgentOptionParser extends AbstractMethodOptionParser implements MethodOpts {
final OptionSpec<String> disputeAgentTypeOpt = parser.accepts(OPT_DISPUTE_AGENT_TYPE, "dispute agent type")

View file

@ -18,10 +18,10 @@
package haveno.cli.opts;
import static haveno.cli.opts.OptLabel.OPT_WALLET_PASSWORD;
import joptsimple.OptionSpec;
import static haveno.cli.opts.OptLabel.OPT_WALLET_PASSWORD;
public class RemoveWalletPasswordOptionParser extends AbstractMethodOptionParser implements MethodOpts {
final OptionSpec<String> passwordOpt = parser.accepts(OPT_WALLET_PASSWORD, "haveno wallet password")

View file

@ -18,10 +18,10 @@
package haveno.cli.opts;
import static haveno.cli.opts.OptLabel.OPT_TX_FEE_RATE;
import joptsimple.OptionSpec;
import static haveno.cli.opts.OptLabel.OPT_TX_FEE_RATE;
public class SetTxFeeRateOptionParser extends AbstractMethodOptionParser implements MethodOpts {
final OptionSpec<String> feeRateOpt = parser.accepts(OPT_TX_FEE_RATE,

View file

@ -18,11 +18,10 @@
package haveno.cli.opts;
import static haveno.cli.opts.OptLabel.OPT_FEE_CURRENCY;
import static haveno.cli.opts.OptLabel.OPT_PAYMENT_ACCOUNT_ID;
import joptsimple.OptionSpec;
import static haveno.cli.opts.OptLabel.OPT_PAYMENT_ACCOUNT_ID;
public class TakeOfferOptionParser extends OfferIdOptionParser implements MethodOpts {
final OptionSpec<String> paymentAccountIdOpt = parser.accepts(OPT_PAYMENT_ACCOUNT_ID, "id of payment account used for trade")

View file

@ -18,11 +18,11 @@
package haveno.cli.opts;
import joptsimple.OptionSpec;
import static haveno.cli.opts.OptLabel.OPT_TIMEOUT;
import static haveno.cli.opts.OptLabel.OPT_WALLET_PASSWORD;
import joptsimple.OptionSpec;
public class UnlockWalletOptionParser extends AbstractMethodOptionParser implements MethodOpts {
final OptionSpec<String> passwordOpt = parser.accepts(OPT_WALLET_PASSWORD, "haveno wallet password")

View file

@ -17,14 +17,14 @@
package haveno.cli.request;
import haveno.proto.grpc.CancelOfferRequest;
import haveno.proto.grpc.PostOfferRequest;
import haveno.cli.GrpcStubs;
import haveno.proto.grpc.CancelOfferRequest;
import haveno.proto.grpc.GetMyOfferRequest;
import haveno.proto.grpc.GetMyOffersRequest;
import haveno.proto.grpc.GetOfferRequest;
import haveno.proto.grpc.GetOffersRequest;
import haveno.proto.grpc.OfferInfo;
import haveno.proto.grpc.PostOfferRequest;
import java.util.ArrayList;
import java.util.List;

View file

@ -17,16 +17,14 @@
package haveno.cli.request;
import haveno.cli.GrpcStubs;
import haveno.proto.grpc.CreateCryptoCurrencyPaymentAccountRequest;
import haveno.proto.grpc.CreatePaymentAccountRequest;
import haveno.proto.grpc.GetCryptoCurrencyPaymentMethodsRequest;
import haveno.proto.grpc.GetPaymentAccountFormAsJsonRequest;
import haveno.proto.grpc.GetPaymentAccountFormRequest;
import haveno.proto.grpc.GetPaymentAccountsRequest;
import haveno.proto.grpc.GetPaymentMethodsRequest;
import haveno.cli.GrpcStubs;
import protobuf.PaymentAccount;
import protobuf.PaymentAccountForm;
import protobuf.PaymentMethod;
import java.util.List;

View file

@ -17,6 +17,7 @@
package haveno.cli.request;
import haveno.cli.GrpcStubs;
import haveno.proto.grpc.ConfirmPaymentReceivedRequest;
import haveno.proto.grpc.ConfirmPaymentSentRequest;
import haveno.proto.grpc.GetTradeRequest;
@ -25,7 +26,7 @@ import haveno.proto.grpc.TakeOfferReply;
import haveno.proto.grpc.TakeOfferRequest;
import haveno.proto.grpc.TradeInfo;
import haveno.proto.grpc.WithdrawFundsRequest;
import haveno.cli.GrpcStubs;
import java.util.List;
import static haveno.proto.grpc.GetTradesRequest.Category.CLOSED;

View file

@ -17,6 +17,7 @@
package haveno.cli.request;
import haveno.cli.GrpcStubs;
import haveno.proto.grpc.AddressBalanceInfo;
import haveno.proto.grpc.BalancesInfo;
import haveno.proto.grpc.BtcBalanceInfo;
@ -26,10 +27,9 @@ import haveno.proto.grpc.GetFundingAddressesRequest;
import haveno.proto.grpc.LockWalletRequest;
import haveno.proto.grpc.MarketPriceRequest;
import haveno.proto.grpc.RemoveWalletPasswordRequest;
import haveno.proto.grpc.SendBtcRequest;
import haveno.proto.grpc.SetWalletPasswordRequest;
import haveno.proto.grpc.UnlockWalletRequest;
import haveno.cli.GrpcStubs;
import java.util.List;
public class WalletsServiceRequest {

View file

@ -17,9 +17,10 @@
package haveno.cli.table;
import haveno.cli.table.column.Column;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.stream.IntStream;
import static com.google.common.base.Strings.padStart;
@ -27,8 +28,6 @@ import static haveno.cli.table.column.Column.JUSTIFICATION.RIGHT;
import static java.lang.String.format;
import static java.nio.charset.StandardCharsets.UTF_8;
import haveno.cli.table.column.Column;
/**
* A simple table of formatted data for the CLI's output console. A table must be
* created with at least one populated column, and each column passed to the constructor

View file

@ -17,8 +17,9 @@
package haveno.cli.table.builder;
import haveno.proto.grpc.OfferInfo;
import haveno.cli.table.Table;
import haveno.proto.grpc.OfferInfo;
import java.util.List;
import java.util.function.Predicate;

View file

@ -17,20 +17,19 @@
package haveno.cli.table.builder;
import haveno.proto.grpc.ContractInfo;
import haveno.proto.grpc.TradeInfo;
import haveno.cli.table.column.Column;
import haveno.cli.table.column.MixedTradeFeeColumn;
import java.math.BigDecimal;
import haveno.proto.grpc.ContractInfo;
import haveno.proto.grpc.TradeInfo;
import javax.annotation.Nullable;
import java.math.BigDecimal;
import java.util.List;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import static haveno.cli.CurrencyFormat.formatSatoshis;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_BUYER_DEPOSIT;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_SELLER_DEPOSIT;

View file

@ -17,13 +17,14 @@
package haveno.cli.table.builder;
import haveno.proto.grpc.AddressBalanceInfo;
import haveno.cli.table.Table;
import haveno.cli.table.column.BooleanColumn;
import haveno.cli.table.column.Column;
import haveno.cli.table.column.LongColumn;
import haveno.cli.table.column.SatoshiColumn;
import haveno.cli.table.column.StringColumn;
import haveno.proto.grpc.AddressBalanceInfo;
import java.util.List;
import java.util.stream.Collectors;

View file

@ -17,18 +17,19 @@
package haveno.cli.table.builder;
import haveno.cli.table.Table;
import haveno.cli.table.column.Column;
import haveno.cli.table.column.SatoshiColumn;
import haveno.proto.grpc.BtcBalanceInfo;
import java.util.List;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_AVAILABLE_BALANCE;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_LOCKED_BALANCE;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_RESERVED_BALANCE;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TOTAL_AVAILABLE_BALANCE;
import static haveno.cli.table.builder.TableType.BTC_BALANCE_TBL;
import haveno.proto.grpc.BtcBalanceInfo;
import haveno.cli.table.Table;
import haveno.cli.table.column.Column;
import haveno.cli.table.column.SatoshiColumn;
import java.util.List;
/**
* Builds a {@code haveno.cli.table.Table} from a
* {@code haveno.proto.grpc.BtcBalanceInfo} object.

View file

@ -17,11 +17,12 @@
package haveno.cli.table.builder;
import static haveno.cli.table.builder.TableType.CLOSED_TRADES_TBL;
import haveno.cli.table.Table;
import java.util.List;
import static haveno.cli.table.builder.TableType.CLOSED_TRADES_TBL;
@SuppressWarnings("ConstantConditions")
class ClosedTradeTableBuilder extends AbstractTradeListBuilder {

View file

@ -17,11 +17,12 @@
package haveno.cli.table.builder;
import static haveno.cli.table.builder.TableType.FAILED_TRADES_TBL;
import haveno.cli.table.Table;
import java.util.List;
import static haveno.cli.table.builder.TableType.FAILED_TRADES_TBL;
/**
* Builds a {@code haveno.cli.table.Table} from a list of {@code haveno.proto.grpc.TradeInfo} objects.
*/

View file

@ -17,21 +17,30 @@
package haveno.cli.table.builder;
import haveno.proto.grpc.OfferInfo;
import haveno.cli.table.Table;
import haveno.cli.table.column.Column;
import haveno.cli.table.column.Iso8601DateTimeColumn;
import haveno.cli.table.column.SatoshiColumn;
import haveno.cli.table.column.StringColumn;
import haveno.cli.table.column.ZippedStringColumns;
import haveno.proto.grpc.OfferInfo;
import javax.annotation.Nullable;
import java.util.List;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import static haveno.cli.table.builder.TableBuilderConstants.*;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_AMOUNT_RANGE;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_CREATION_DATE;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_DETAILED_PRICE;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_DETAILED_PRICE_OF_ALTCOIN;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_DIRECTION;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_ENABLED;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_PAYMENT_METHOD;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TRIGGER_PRICE;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_UUID;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_VOLUME_RANGE;
import static haveno.cli.table.builder.TableType.OFFER_TBL;
import static haveno.cli.table.column.Column.JUSTIFICATION.LEFT;
import static haveno.cli.table.column.Column.JUSTIFICATION.NONE;

View file

@ -17,11 +17,12 @@
package haveno.cli.table.builder;
import static haveno.cli.table.builder.TableType.OPEN_TRADES_TBL;
import haveno.cli.table.Table;
import java.util.List;
import static haveno.cli.table.builder.TableType.OPEN_TRADES_TBL;
/**
* Builds a {@code haveno.cli.table.Table} from a list of {@code haveno.proto.grpc.TradeInfo} objects.
*/

View file

@ -17,20 +17,20 @@
package haveno.cli.table.builder;
import haveno.cli.table.Table;
import haveno.cli.table.column.Column;
import haveno.cli.table.column.StringColumn;
import protobuf.PaymentAccount;
import java.util.List;
import java.util.stream.Collectors;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_CURRENCY;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_NAME;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_PAYMENT_METHOD;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_UUID;
import static haveno.cli.table.builder.TableType.PAYMENT_ACCOUNT_TBL;
import haveno.cli.table.Table;
import haveno.cli.table.column.Column;
import haveno.cli.table.column.StringColumn;
import java.util.List;
import java.util.stream.Collectors;
/**
* Builds a {@code haveno.cli.table.Table} from a List of
* {@code protobuf.PaymentAccount} objects.

View file

@ -17,12 +17,12 @@
package haveno.cli.table.builder;
import haveno.cli.table.Table;
import java.util.List;
import static java.util.Collections.singletonList;
import haveno.cli.table.Table;
/**
* Table builder factory. It is not conventionally named TableBuilderFactory because
* it has no static factory methods. The number of static fields and methods in the

View file

@ -17,15 +17,14 @@
package haveno.cli.table.builder;
import haveno.proto.grpc.TradeInfo;
import haveno.cli.table.Table;
import haveno.cli.table.column.Column;
import haveno.proto.grpc.TradeInfo;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
import static haveno.cli.table.builder.TableType.TRADE_DETAIL_TBL;
import static java.lang.String.format;
/**
* Builds a {@code haveno.cli.table.Table} from a {@code haveno.proto.grpc.TradeInfo} object.

View file

@ -17,9 +17,6 @@
package haveno.cli.table.builder;
import haveno.proto.grpc.ContractInfo;
import haveno.proto.grpc.OfferInfo;
import haveno.proto.grpc.TradeInfo;
import haveno.cli.table.column.AltcoinVolumeColumn;
import haveno.cli.table.column.BooleanColumn;
import haveno.cli.table.column.BtcColumn;
@ -28,17 +25,46 @@ import haveno.cli.table.column.Iso8601DateTimeColumn;
import haveno.cli.table.column.MixedTradeFeeColumn;
import haveno.cli.table.column.SatoshiColumn;
import haveno.cli.table.column.StringColumn;
import haveno.proto.grpc.ContractInfo;
import haveno.proto.grpc.OfferInfo;
import haveno.proto.grpc.TradeInfo;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import java.util.List;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import static haveno.cli.table.builder.TableBuilderConstants.*;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_AMOUNT;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_AMOUNT_IN_BTC;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_CURRENCY;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_DATE_TIME;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_DETAILED_AMOUNT;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_DETAILED_PRICE;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_DETAILED_PRICE_OF_ALTCOIN;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_DEVIATION;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_MARKET;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_OFFER_TYPE;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_PAYMENT_METHOD;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_PRICE;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_STATUS;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TRADE_ALTCOIN_BUYER_ADDRESS;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TRADE_BUYER_COST;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TRADE_DEPOSIT_CONFIRMED;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TRADE_DEPOSIT_PUBLISHED;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TRADE_FEE;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TRADE_ID;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TRADE_MAKER_FEE;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TRADE_PAYMENT_RECEIVED;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TRADE_PAYMENT_SENT;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TRADE_PAYOUT_PUBLISHED;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TRADE_ROLE;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TRADE_SHORT_ID;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TRADE_TAKER_FEE;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TRADE_WITHDRAWN;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TX_FEE;
import static haveno.cli.table.builder.TableType.CLOSED_TRADES_TBL;
import static haveno.cli.table.builder.TableType.FAILED_TRADES_TBL;
import static haveno.cli.table.builder.TableType.OPEN_TRADES_TBL;

View file

@ -17,18 +17,23 @@
package haveno.cli.table.builder;
import static haveno.cli.table.builder.TableBuilderConstants.*;
import static haveno.cli.table.builder.TableType.TRANSACTION_TBL;
import haveno.cli.table.Table;
import haveno.cli.table.column.BooleanColumn;
import haveno.cli.table.column.Column;
import haveno.cli.table.column.LongColumn;
import haveno.cli.table.column.SatoshiColumn;
import haveno.cli.table.column.StringColumn;
import java.util.List;
import javax.annotation.Nullable;
import java.util.List;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TX_FEE;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TX_ID;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TX_INPUT_SUM;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TX_IS_CONFIRMED;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TX_OUTPUT_SUM;
import static haveno.cli.table.builder.TableBuilderConstants.COL_HEADER_TX_SIZE;
import static haveno.cli.table.builder.TableType.TRANSACTION_TBL;
/**
* Builds a {@code haveno.cli.table.Table} from a {@code haveno.proto.grpc.TxInfo} object.

View file

@ -17,13 +17,12 @@
package haveno.cli.table.column;
import static haveno.cli.table.column.Column.JUSTIFICATION.RIGHT;
import java.math.BigDecimal;
import java.util.function.BiFunction;
import java.util.stream.IntStream;
import static haveno.cli.table.column.Column.JUSTIFICATION.RIGHT;
/**
* For displaying altcoin volume with appropriate precision.
*/

View file

@ -18,13 +18,13 @@
package haveno.cli.table.column;
import static haveno.cli.table.column.Column.JUSTIFICATION.LEFT;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.IntStream;
import static haveno.cli.table.column.Column.JUSTIFICATION.LEFT;
/**
* For displaying boolean values as YES, NO, or user's choice for 'true' and 'false'.
*/

View file

@ -17,13 +17,13 @@
package haveno.cli.table.column;
import static haveno.cli.table.column.Column.JUSTIFICATION.RIGHT;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.IntStream;
import static haveno.cli.table.column.Column.JUSTIFICATION.RIGHT;
/**
* For displaying Double values.
*/

View file

@ -17,13 +17,13 @@
package haveno.cli.table.column;
import java.util.stream.IntStream;
import static haveno.cli.CurrencyFormat.formatFiatVolume;
import static haveno.cli.CurrencyFormat.formatPrice;
import static haveno.cli.table.column.Column.JUSTIFICATION.RIGHT;
import static haveno.cli.table.column.FiatColumn.DISPLAY_MODE.FIAT_PRICE;
import java.util.stream.IntStream;
/**
* For displaying fiat volume or price with appropriate precision.
*/

View file

@ -17,13 +17,13 @@
package haveno.cli.table.column;
import static haveno.cli.table.column.Column.JUSTIFICATION.RIGHT;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.IntStream;
import static haveno.cli.table.column.Column.JUSTIFICATION.RIGHT;
/**
* For displaying Integer values.
*/

View file

@ -18,7 +18,6 @@
package haveno.cli.table.column;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.stream.IntStream;

View file

@ -17,13 +17,13 @@
package haveno.cli.table.column;
import static haveno.cli.table.column.Column.JUSTIFICATION.RIGHT;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.IntStream;
import static haveno.cli.table.column.Column.JUSTIFICATION.RIGHT;
/**
* For displaying Long values.
*/

View file

@ -18,14 +18,14 @@
package haveno.cli.table.column;
import static haveno.cli.table.column.Column.JUSTIFICATION.LEFT;
import static haveno.cli.table.column.Column.JUSTIFICATION.RIGHT;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.IntStream;
import static haveno.cli.table.column.Column.JUSTIFICATION.LEFT;
import static haveno.cli.table.column.Column.JUSTIFICATION.RIGHT;
/**
* For displaying justified string values.
*/

View file

@ -17,15 +17,15 @@
package haveno.cli.table.column;
import static haveno.cli.table.column.ZippedStringColumns.DUPLICATION_MODE.EXCLUDE_DUPLICATES;
import static haveno.cli.table.column.ZippedStringColumns.DUPLICATION_MODE.INCLUDE_DUPLICATES;
import haveno.cli.table.column.Column.JUSTIFICATION;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.IntStream;
import javax.annotation.Nullable;
import static haveno.cli.table.column.ZippedStringColumns.DUPLICATION_MODE.EXCLUDE_DUPLICATES;
import static haveno.cli.table.column.ZippedStringColumns.DUPLICATION_MODE.INCLUDE_DUPLICATES;
/**
* For zipping multiple StringColumns into a single StringColumn.

View file

@ -1,14 +1,13 @@
package haveno.cli;
import haveno.proto.grpc.OfferInfo;
import haveno.cli.CliMain;
import haveno.cli.GrpcClient;
import haveno.cli.opts.ArgumentList;
import haveno.proto.grpc.OfferInfo;
import joptsimple.OptionParser;
import joptsimple.OptionSet;
import lombok.extern.slf4j.Slf4j;
import org.bitbucket.cowwoc.diffmatchpatch.DiffMatchPatch;
import java.math.BigDecimal;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
@ -18,8 +17,6 @@ import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import lombok.extern.slf4j.Slf4j;
import static haveno.cli.opts.OptLabel.OPT_HOST;
import static haveno.cli.opts.OptLabel.OPT_PASSWORD;
import static haveno.cli.opts.OptLabel.OPT_PORT;
@ -29,8 +26,6 @@ import static java.util.Arrays.stream;
import static org.bitbucket.cowwoc.diffmatchpatch.DiffMatchPatch.Operation.DELETE;
import static org.bitbucket.cowwoc.diffmatchpatch.DiffMatchPatch.Operation.INSERT;
import org.bitbucket.cowwoc.diffmatchpatch.DiffMatchPatch;
/**
* Parent class for CLI smoke tests. Useful for examining the format of the console
* output, and checking for diffs while making changes to console output formatters.

View file

@ -3,8 +3,6 @@ package haveno.cli;
import static java.lang.System.out;
import static java.util.Arrays.stream;
import haveno.cli.CliMain;
/**
Smoke tests for createoffer method. Useful for testing CLI command and examining the
format of its console output.

View file

@ -2,8 +2,6 @@ package haveno.cli;
import static java.lang.System.out;
import haveno.cli.CliMain;
/**
Smoke tests for getoffers method. Useful for examining the format of the console output.

View file

@ -1,12 +1,12 @@
package haveno.cli;
import haveno.proto.grpc.TradeInfo;
import haveno.cli.GrpcClient;
import haveno.cli.table.builder.TableBuilder;
import haveno.proto.grpc.TradeInfo;
import java.util.List;
import static haveno.proto.grpc.GetTradesRequest.Category.CLOSED;
import static haveno.cli.table.builder.TableType.TRADE_DETAIL_TBL;
import static haveno.proto.grpc.GetTradesRequest.Category.CLOSED;
import static java.lang.System.out;
@SuppressWarnings("unused")

View file

@ -6,15 +6,19 @@ import static haveno.cli.Method.canceloffer;
import static haveno.cli.Method.createcryptopaymentacct;
import static haveno.cli.Method.createoffer;
import static haveno.cli.Method.createpaymentacct;
import static haveno.cli.opts.OptLabel.*;
import static haveno.cli.opts.OptLabel.OPT_ACCOUNT_NAME;
import static haveno.cli.opts.OptLabel.OPT_ADDRESS;
import static haveno.cli.opts.OptLabel.OPT_AMOUNT;
import static haveno.cli.opts.OptLabel.OPT_CURRENCY_CODE;
import static haveno.cli.opts.OptLabel.OPT_DIRECTION;
import static haveno.cli.opts.OptLabel.OPT_MKT_PRICE_MARGIN;
import static haveno.cli.opts.OptLabel.OPT_OFFER_ID;
import static haveno.cli.opts.OptLabel.OPT_PASSWORD;
import static haveno.cli.opts.OptLabel.OPT_PAYMENT_ACCOUNT_FORM;
import static haveno.cli.opts.OptLabel.OPT_PAYMENT_ACCOUNT_ID;
import static haveno.cli.opts.OptLabel.OPT_SECURITY_DEPOSIT;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import haveno.cli.opts.CancelOfferOptionParser;
import haveno.cli.opts.CreateCryptoCurrencyPaymentAcctOptionParser;
import haveno.cli.opts.CreateOfferOptionParser;
import haveno.cli.opts.CreatePaymentAcctOptionParser;
public class OptionParsersTest {

View file

@ -1,8 +1,9 @@
package haveno.cli.table;
import haveno.proto.grpc.AddressBalanceInfo;
import haveno.cli.AbstractCliTest;
import haveno.cli.table.builder.TableBuilder;
import haveno.proto.grpc.AddressBalanceInfo;
import java.util.List;
import static haveno.cli.table.builder.TableType.ADDRESS_BALANCE_TBL;

View file

@ -1,10 +1,10 @@
package haveno.cli.table;
import static haveno.cli.table.builder.TableType.BTC_BALANCE_TBL;
import haveno.cli.AbstractCliTest;
import haveno.cli.table.builder.TableBuilder;
import static haveno.cli.table.builder.TableType.BTC_BALANCE_TBL;
@SuppressWarnings("unused")
public class GetBalanceCliOutputDiffTest extends AbstractCliTest {

View file

@ -1,12 +1,12 @@
package haveno.cli.table;
import haveno.proto.grpc.OfferInfo;
import haveno.cli.AbstractCliTest;
import haveno.cli.table.builder.TableBuilder;
import java.util.List;
import haveno.proto.grpc.OfferInfo;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
import static haveno.cli.table.builder.TableType.OFFER_TBL;
import static protobuf.OfferDirection.BUY;
import static protobuf.OfferDirection.SELL;

View file

@ -1,13 +1,12 @@
package haveno.cli.table;
import lombok.extern.slf4j.Slf4j;
import static haveno.cli.table.builder.TableType.TRADE_DETAIL_TBL;
import static java.lang.System.out;
import haveno.cli.AbstractCliTest;
import haveno.cli.GrpcClient;
import haveno.cli.table.builder.TableBuilder;
import lombok.extern.slf4j.Slf4j;
import static haveno.cli.table.builder.TableType.TRADE_DETAIL_TBL;
import static java.lang.System.out;
@SuppressWarnings("unused")
@Slf4j

View file

@ -1,11 +1,7 @@
package haveno.cli.table;
import lombok.extern.slf4j.Slf4j;
import static haveno.cli.table.builder.TableType.TRANSACTION_TBL;
import haveno.cli.AbstractCliTest;
import haveno.cli.table.builder.TableBuilder;
import lombok.extern.slf4j.Slf4j;
@SuppressWarnings("unused")
@Slf4j

View file

@ -1,11 +1,10 @@
package haveno.cli.table;
import lombok.extern.slf4j.Slf4j;
import static haveno.cli.table.builder.TableType.PAYMENT_ACCOUNT_TBL;
import haveno.cli.AbstractCliTest;
import haveno.cli.table.builder.TableBuilder;
import lombok.extern.slf4j.Slf4j;
import static haveno.cli.table.builder.TableType.PAYMENT_ACCOUNT_TBL;
@SuppressWarnings("unused")
@Slf4j