mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-24 06:44:19 -04:00
Polish formatting
This commit is contained in:
parent
99dcea4001
commit
75b7482bf1
13 changed files with 23 additions and 17 deletions
|
@ -29,7 +29,7 @@ run {
|
||||||
processResources {
|
processResources {
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
include '**/*.properties'
|
include '**/*.properties'
|
||||||
filter(ReplaceTokens, tokens: [ 'app.version': project.version ])
|
filter(ReplaceTokens, tokens: ['app.version': project.version])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,8 @@ public class BitsquareAppMain extends BitsquareExecutable {
|
||||||
protected void customizeOptionParsing(OptionParser parser) {
|
protected void customizeOptionParsing(OptionParser parser) {
|
||||||
parser.accepts(USER_DATA_DIR_KEY, "User data directory").withRequiredArg().defaultsTo(DEFAULT_USER_DATA_DIR);
|
parser.accepts(USER_DATA_DIR_KEY, "User data directory").withRequiredArg().defaultsTo(DEFAULT_USER_DATA_DIR);
|
||||||
parser.accepts(APP_NAME_KEY, "Application name").withRequiredArg().defaultsTo(DEFAULT_APP_NAME);
|
parser.accepts(APP_NAME_KEY, "Application name").withRequiredArg().defaultsTo(DEFAULT_APP_NAME);
|
||||||
parser.accepts(APP_DATA_DIR_KEY, "Application data directory").withRequiredArg().defaultsTo(DEFAULT_APP_DATA_DIR);
|
parser.accepts(APP_DATA_DIR_KEY, "Application data directory").withRequiredArg()
|
||||||
|
.defaultsTo(DEFAULT_APP_DATA_DIR);
|
||||||
parser.accepts(NAME_KEY, "Name of this node").withRequiredArg();
|
parser.accepts(NAME_KEY, "Name of this node").withRequiredArg();
|
||||||
parser.accepts(PORT_KEY, "Port to listen on").withRequiredArg().defaultsTo(String.valueOf(Node.DEFAULT_PORT));
|
parser.accepts(PORT_KEY, "Port to listen on").withRequiredArg().defaultsTo(String.valueOf(Node.DEFAULT_PORT));
|
||||||
parser.accepts(BITCOIN_NETWORK_KEY).withRequiredArg().defaultsTo(BitcoinModule.DEFAULT_BITCOIN_NETWORK);
|
parser.accepts(BITCOIN_NETWORK_KEY).withRequiredArg().defaultsTo(BitcoinModule.DEFAULT_BITCOIN_NETWORK);
|
||||||
|
|
|
@ -52,7 +52,8 @@ public class BitcoinModule extends BitsquareModule {
|
||||||
|
|
||||||
File walletDir = new File(env.getRequiredProperty(WalletService.DIR_KEY));
|
File walletDir = new File(env.getRequiredProperty(WalletService.DIR_KEY));
|
||||||
bind(File.class).annotatedWith(named(WalletService.DIR_KEY)).toInstance(walletDir);
|
bind(File.class).annotatedWith(named(WalletService.DIR_KEY)).toInstance(walletDir);
|
||||||
bindConstant().annotatedWith(named(WalletService.PREFIX_KEY)).to(env.getRequiredProperty(WalletService.PREFIX_KEY));
|
bindConstant().annotatedWith(named(WalletService.PREFIX_KEY)).to(
|
||||||
|
env.getRequiredProperty(WalletService.PREFIX_KEY));
|
||||||
bind(WalletService.class).asEagerSingleton();
|
bind(WalletService.class).asEagerSingleton();
|
||||||
|
|
||||||
bind(BlockChainService.class).asEagerSingleton();
|
bind(BlockChainService.class).asEagerSingleton();
|
||||||
|
|
|
@ -124,8 +124,8 @@ public class WalletService {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public WalletService(NetworkParameters params, FeePolicy feePolicy, SignatureService signatureService,
|
public WalletService(NetworkParameters params, FeePolicy feePolicy, SignatureService signatureService,
|
||||||
Persistence persistence, UserAgent userAgent,
|
Persistence persistence, UserAgent userAgent,
|
||||||
@Named(DIR_KEY) File walletDir, @Named(PREFIX_KEY) String walletPrefix) {
|
@Named(DIR_KEY) File walletDir, @Named(PREFIX_KEY) String walletPrefix) {
|
||||||
this.params = params;
|
this.params = params;
|
||||||
this.feePolicy = feePolicy;
|
this.feePolicy = feePolicy;
|
||||||
this.signatureService = signatureService;
|
this.signatureService = signatureService;
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class ArbitratorBrowserViewCB extends CachedViewCB implements ArbitratorL
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ArbitratorBrowserViewCB(AccountSettings accountSettings, Persistence persistence,
|
public ArbitratorBrowserViewCB(AccountSettings accountSettings, Persistence persistence,
|
||||||
MessageService messageService) {
|
MessageService messageService) {
|
||||||
this.accountSettings = accountSettings;
|
this.accountSettings = accountSettings;
|
||||||
this.persistence = persistence;
|
this.persistence = persistence;
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class ArbitratorProfileViewCB extends CachedViewCB {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ArbitratorProfileViewCB(ApplicationPreferences applicationPreferences, Persistence persistence,
|
public ArbitratorProfileViewCB(ApplicationPreferences applicationPreferences, Persistence persistence,
|
||||||
BSFormatter formatter) {
|
BSFormatter formatter) {
|
||||||
this.applicationPreferences = applicationPreferences;
|
this.applicationPreferences = applicationPreferences;
|
||||||
this.persistence = persistence;
|
this.persistence = persistence;
|
||||||
|
|
|
@ -78,7 +78,8 @@ class IrcAccountModel extends UIModel {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
IrcAccountModel(User user, Persistence persistence, AccountSettings accountSettings, MessageService messageService) {
|
IrcAccountModel(User user, Persistence persistence, AccountSettings accountSettings,
|
||||||
|
MessageService messageService) {
|
||||||
this.persistence = persistence;
|
this.persistence = persistence;
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.accountSettings = accountSettings;
|
this.accountSettings = accountSettings;
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
<TitledGroupBg text="General application preferences" GridPane.rowSpan="8"/>
|
<TitledGroupBg text="General application preferences" GridPane.rowSpan="8"/>
|
||||||
|
|
||||||
<Label text="Bitcoin denomination:" GridPane.rowIndex="0">
|
<Label text="Bitcoin denomination:" GridPane.rowIndex="0">
|
||||||
<GridPane.margin>
|
<GridPane.margin>
|
||||||
<Insets top="10"/>
|
<Insets top="10"/>
|
||||||
</GridPane.margin>
|
</GridPane.margin>
|
||||||
</Label>
|
</Label>
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class NetworkPreferencesPM extends PresentationModel<NetworkPreferencesMo
|
||||||
String bootstrapAddress() {
|
String bootstrapAddress() {
|
||||||
return model.bootstrapAddress;
|
return model.bootstrapAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Private
|
// Private
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -83,8 +83,8 @@ class TakeOfferModel extends UIModel {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
TakeOfferModel(TradeManager tradeManager, WalletService walletService, ApplicationPreferences applicationPreferences,
|
TakeOfferModel(TradeManager tradeManager, WalletService walletService,
|
||||||
Persistence persistence) {
|
ApplicationPreferences applicationPreferences, Persistence persistence) {
|
||||||
this.tradeManager = tradeManager;
|
this.tradeManager = tradeManager;
|
||||||
this.walletService = walletService;
|
this.walletService = walletService;
|
||||||
this.applicationPreferences = applicationPreferences;
|
this.applicationPreferences = applicationPreferences;
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
|
|
||||||
package io.bitsquare.msg.tomp2p;
|
package io.bitsquare.msg.tomp2p;
|
||||||
|
|
||||||
import io.bitsquare.msg.MessageService;
|
|
||||||
import io.bitsquare.msg.MessageModule;
|
import io.bitsquare.msg.MessageModule;
|
||||||
|
import io.bitsquare.msg.MessageService;
|
||||||
import io.bitsquare.network.BootstrapNodes;
|
import io.bitsquare.network.BootstrapNodes;
|
||||||
import io.bitsquare.network.Node;
|
import io.bitsquare.network.Node;
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ public class TomP2PMessageModule extends MessageModule {
|
||||||
@Override
|
@Override
|
||||||
protected void doConfigure() {
|
protected void doConfigure() {
|
||||||
bind(int.class).annotatedWith(Names.named(Node.PORT_KEY)).toInstance(
|
bind(int.class).annotatedWith(Names.named(Node.PORT_KEY)).toInstance(
|
||||||
env.getProperty(Node.PORT_KEY, Integer.class, Node.DEFAULT_PORT));
|
env.getProperty(Node.PORT_KEY, Integer.class, Node.DEFAULT_PORT));
|
||||||
bind(TomP2PNode.class).asEagerSingleton();
|
bind(TomP2PNode.class).asEagerSingleton();
|
||||||
|
|
||||||
bind(Node.class).annotatedWith(Names.named(BOOTSTRAP_NODE_KEY)).toInstance(
|
bind(Node.class).annotatedWith(Names.named(BOOTSTRAP_NODE_KEY)).toInstance(
|
||||||
|
|
|
@ -46,12 +46,15 @@ public class BitsquareEnvironmentTests {
|
||||||
.withProperty("key.y", "y.env");
|
.withProperty("key.y", "y.env");
|
||||||
|
|
||||||
ConfigurableEnvironment env = new BitsquareEnvironment(commandlineProps) {
|
ConfigurableEnvironment env = new BitsquareEnvironment(commandlineProps) {
|
||||||
@Override PropertySource<?> filesystemProperties() { return filesystemProps; }
|
@Override
|
||||||
|
PropertySource<?> filesystemProperties() {
|
||||||
|
return filesystemProps;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
MutablePropertySources propertySources = env.getPropertySources();
|
MutablePropertySources propertySources = env.getPropertySources();
|
||||||
|
|
||||||
assertThat(propertySources.precedenceOf(named(BITSQUARE_COMMANDLINE_PROPERTY_SOURCE_NAME)), equalTo(0));
|
assertThat(propertySources.precedenceOf(named(BITSQUARE_COMMANDLINE_PROPERTY_SOURCE_NAME)), equalTo(0));
|
||||||
assertThat(propertySources.precedenceOf(named(SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)), equalTo(1));
|
assertThat(propertySources.precedenceOf(named(SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)), equalTo(1));
|
||||||
assertThat(propertySources.precedenceOf(named(SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)), equalTo(2));
|
assertThat(propertySources.precedenceOf(named(SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)), equalTo(2));
|
||||||
assertThat(propertySources.precedenceOf(named(BITSQUARE_FILESYSTEM_PROPERTY_SOURCE_NAME)), equalTo(3));
|
assertThat(propertySources.precedenceOf(named(BITSQUARE_FILESYSTEM_PROPERTY_SOURCE_NAME)), equalTo(3));
|
||||||
assertThat(propertySources.precedenceOf(named(BITSQUARE_CLASSPATH_PROPERTY_SOURCE_NAME)), equalTo(4));
|
assertThat(propertySources.precedenceOf(named(BITSQUARE_CLASSPATH_PROPERTY_SOURCE_NAME)), equalTo(4));
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class ViewLoaderTests {
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
OptionParser parser = new OptionParser();
|
OptionParser parser = new OptionParser();
|
||||||
BitsquareEnvironment env = new BitsquareEnvironment(parser.parse(new String[] {}));
|
BitsquareEnvironment env = new BitsquareEnvironment(parser.parse(new String[]{}));
|
||||||
Injector injector = Guice.createInjector(new BitsquareAppModule(env, TestApp.primaryStage));
|
Injector injector = Guice.createInjector(new BitsquareAppModule(env, TestApp.primaryStage));
|
||||||
ViewLoader.setInjector(injector);
|
ViewLoader.setInjector(injector);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue