[PRIV-41] Refactor PrivacyParameters config to use builder pattern (#1226)

* [PRIV-41] Use metrics system for private state db

- Use PrivacyParametersBuilder to build PrivacyParameters
- refactor PrivacyParameters to expose default options
- refactor test builders to use PrivacyParameters.DEFAULT
- Use URI in Enclave

* Fix: enclave tests from bad merge

* Fix privacy acceptance tests after db configuration changes

* Switch to use nested class for PrivacyParametersBuilder

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
This commit is contained in:
Antony Denyer
2019-04-09 16:28:29 +01:00
committed by Danno Ferrin
parent 0eb5d9676e
commit 0ce2d49aa5
44 changed files with 260 additions and 192 deletions

View File

@@ -15,6 +15,7 @@ package tech.pegasys.orion.testutil;
import static com.google.common.io.Files.readLines;
import java.io.IOException;
import java.net.URI;
import java.nio.file.Path;
import java.util.List;
import java.util.stream.Collectors;
@@ -51,12 +52,6 @@ public class OrionTestHarness {
.collect(Collectors.toList());
}
public List<String> getPrivateKeys() {
return config.privateKeys().stream()
.map(OrionTestHarness::readFile)
.collect(Collectors.toList());
}
private static String readFile(final Path path) {
try {
return readLines(path.toFile(), Charsets.UTF_8).get(0);
@@ -66,13 +61,11 @@ public class OrionTestHarness {
}
}
public String clientUrl() {
return new HttpUrl.Builder()
.scheme("http")
.host(HOST)
.port(orion.clientPort())
.build()
.toString();
public URI clientUrl() {
HttpUrl httpUrl =
new HttpUrl.Builder().scheme("http").host(HOST).port(orion.clientPort()).build();
return URI.create(httpUrl.toString());
}
public String nodeUrl() {