Finish moving 'useDevPrivilegeKeys' option handling to Config

This commit is contained in:
Chris Beams 2019-12-17 19:38:38 +01:00
parent 43fb851514
commit 9ff6dd2c82
No known key found for this signature in database
GPG key ID: 3D214F8F5BC5ED73
3 changed files with 3 additions and 15 deletions

View file

@ -268,12 +268,6 @@ public abstract class BisqExecutable implements GracefulShutDownHandler, BisqSet
protected void customizeOptionParsing(OptionParser parser) {
parser.accepts(Config.USE_DEV_PRIVILEGE_KEYS,
format("If that is true all the privileged features which requires a private key " +
"to enable it are overridden by a dev key pair (This is for developers only!) (default: %s)", "false"))
.withRequiredArg()
.ofType(boolean.class);
parser.accepts(Config.REFERRAL_ID,
"Optional Referral ID (e.g. for API users or pro market makers)")
.withRequiredArg();

View file

@ -77,7 +77,7 @@ public class CoreModule extends AppModule {
bind(NetworkProtoResolver.class).to(CoreNetworkProtoResolver.class);
bind(PersistenceProtoResolver.class).to(CorePersistenceProtoResolver.class);
bind(boolean.class).annotatedWith(named(USE_DEV_PRIVILEGE_KEYS)).toInstance(config.isUseDevPrivilegeKeys());
bindConstant().annotatedWith(named(USE_DEV_PRIVILEGE_KEYS)).to(config.isUseDevPrivilegeKeys());
bind(boolean.class).annotatedWith(named(USE_DEV_MODE)).toInstance(config.isUseDevMode());
bind(String.class).annotatedWith(named(REFERRAL_ID)).toInstance(config.getReferralId());

View file

@ -49,14 +49,10 @@ import bisq.common.proto.persistable.PersistenceProtoResolver;
import org.springframework.core.env.Environment;
import com.google.inject.Singleton;
import com.google.inject.name.Names;
import java.io.File;
import static bisq.common.config.Config.KEY_STORAGE_DIR;
import static bisq.common.config.Config.REFERRAL_ID;
import static bisq.common.config.Config.STORAGE_DIR;
import static bisq.common.config.Config.USE_DEV_MODE;
import static bisq.common.config.Config.*;
import static com.google.inject.name.Names.named;
public class ModuleForAppWithP2p extends AppModule {
@ -85,9 +81,7 @@ public class ModuleForAppWithP2p extends AppModule {
bind(File.class).annotatedWith(named(STORAGE_DIR)).toInstance(config.getStorageDir());
bind(File.class).annotatedWith(named(KEY_STORAGE_DIR)).toInstance(config.getKeyStorageDir());
Boolean useDevPrivilegeKeys = environment.getProperty(Config.USE_DEV_PRIVILEGE_KEYS, Boolean.class, false);
bind(boolean.class).annotatedWith(Names.named(Config.USE_DEV_PRIVILEGE_KEYS)).toInstance(useDevPrivilegeKeys);
bindConstant().annotatedWith(named(USE_DEV_PRIVILEGE_KEYS)).to(config.isUseDevPrivilegeKeys());
bind(boolean.class).annotatedWith(named(USE_DEV_MODE)).toInstance(config.isUseDevMode());
bind(String.class).annotatedWith(named(REFERRAL_ID)).toInstance(config.getReferralId());