mirror of
https://github.com/vacp2p/linea-besu.git
synced 2026-01-09 21:17:54 -05:00
Refactored OrionTestHarness to use in memory storage. (#1676)
Signed-off-by: Mark Terry <mark.terry@consensys.net> Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
This commit is contained in:
@@ -25,19 +25,22 @@ public class OrionConfiguration {
|
||||
private final Path tempDir;
|
||||
private final List<String> otherNodes = new ArrayList<>();
|
||||
private final boolean clearKnownNodes;
|
||||
private final String storage;
|
||||
|
||||
public OrionConfiguration(
|
||||
final Path[] publicKeys,
|
||||
final Path[] privateKeys,
|
||||
final Path tempDir,
|
||||
final List<String> otherNodes,
|
||||
final boolean clearKnownNodes) {
|
||||
final boolean clearKnownNodes,
|
||||
final String storage) {
|
||||
|
||||
this.publicKeys = publicKeys;
|
||||
this.privateKeys = privateKeys;
|
||||
this.tempDir = tempDir;
|
||||
this.otherNodes.addAll(otherNodes);
|
||||
this.clearKnownNodes = clearKnownNodes;
|
||||
this.storage = storage;
|
||||
}
|
||||
|
||||
public Path[] getPublicKeys() {
|
||||
@@ -63,4 +66,8 @@ public class OrionConfiguration {
|
||||
public boolean isClearKnownNodes() {
|
||||
return clearKnownNodes;
|
||||
}
|
||||
|
||||
public String getStorage() {
|
||||
return storage;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,9 @@ public class OrionTestHarness {
|
||||
+ "clientnetworkinterface = \""
|
||||
+ HOST
|
||||
+ "\"\n"
|
||||
+ "storage = \"leveldb:database/orion_node\"\n"
|
||||
+ "storage = \""
|
||||
+ orionConfiguration.getStorage()
|
||||
+ "\"\n"
|
||||
+ "publickeys = ["
|
||||
+ joinPathsAsTomlListEntry(orionConfiguration.getPublicKeys())
|
||||
+ "]\n"
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class OrionTestHarnessFactory {
|
||||
private static final String storage = "memory";
|
||||
|
||||
public static OrionTestHarness create(
|
||||
final Path tempDir, final OrionKeyConfiguration orionConfig) {
|
||||
@@ -69,8 +70,7 @@ public class OrionTestHarnessFactory {
|
||||
final Path[] key1pubs,
|
||||
final Path[] key1keys,
|
||||
final List<String> othernodes) {
|
||||
|
||||
return new OrionTestHarness(
|
||||
new OrionConfiguration(key1pubs, key1keys, tempDir, othernodes, false));
|
||||
new OrionConfiguration(key1pubs, key1keys, tempDir, othernodes, false, storage));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user