Skip to content

Commit

Permalink
Merge pull request #1119 from alvasw/add_tor_testNetwork_option_to_ty…
Browse files Browse the repository at this point in the history
…pesafe_config

Add Tor testNetwork option to typesafe config
  • Loading branch information
alvasw authored Aug 10, 2023
2 parents ff42248 + 7080d40 commit cbaaba1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions desktop_app/src/main/resources/desktop.conf
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ application {
socketTimeout = 120
}
tor {
testNetwork = false
directoryAuthorities = []
torrcOverrides = {}
socketTimeout = 120
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class TorTransport implements Transport {
public static final class Config implements Transport.Config {
public static Config from(String baseDir, com.typesafe.config.Config config) {
return new Config(
config.getBoolean("testNetwork"),
baseDir,
(int) TimeUnit.SECONDS.toMillis(config.getInt("socketTimeout")),
parseDirectoryAuthorities(config.getList("directoryAuthorities")),
Expand Down Expand Up @@ -78,12 +79,18 @@ private static String getStringFromConfigValue(ConfigValue configValue, String k
.unwrapped();
}

private final boolean isTestNetwork;
private final int socketTimeout;
private final String baseDir;
private final Set<DirectoryAuthority> directoryAuthorities;
private final Map<String, String> torrcOverrides;

public Config(String baseDir, int socketTimeout, Set<DirectoryAuthority> directoryAuthorities, Map<String, String> torrcOverrides) {
public Config(boolean isTestNetwork,
String baseDir,
int socketTimeout,
Set<DirectoryAuthority> directoryAuthorities,
Map<String, String> torrcOverrides) {
this.isTestNetwork = isTestNetwork;
this.baseDir = baseDir;
this.socketTimeout = socketTimeout;
this.directoryAuthorities = directoryAuthorities;
Expand Down
1 change: 1 addition & 0 deletions oracle_node_app/src/main/resources/oracle_node.conf
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ application {
socketTimeout = 120
}
tor {
testNetwork = false
directoryAuthorities = []
torrcOverrides = {}
socketTimeout = 120
Expand Down
1 change: 1 addition & 0 deletions rest_api_app/src/main/resources/rest_api.conf
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ application {
socketTimeout = 120
}
tor {
testNetwork = false
torrcOverrides = {}
socketTimeout = 120
}
Expand Down
1 change: 1 addition & 0 deletions seed_node_app/src/main/resources/seed_node.conf
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ application {
socketTimeout = 120
}
tor {
testNetwork = false
directoryAuthorities = []
torrcOverrides = {}
socketTimeout = 120
Expand Down

0 comments on commit cbaaba1

Please sign in to comment.