[PAN-2576] Allow whitespace in path (#1327)

* [PAN-2576] Allow whitespace in path

- handle whitespace in path
- handle parentheses in path

fixes PAN-2576

* Update SECP256K1Test.java

* Update GenesisConfigFile.java

* Revert "Update GenesisConfigFile.java"

This reverts commit 08bedbf53a764b34f66230315c1139e7bb66fee8.

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Abdelhamid Bakhta 6 years ago committed by GitHub
parent d931e37903
commit b5c5fb9e2a
  1. 9
      crypto/src/test/java/tech/pegasys/pantheon/crypto/SECP256K1Test.java

@ -25,12 +25,10 @@ import tech.pegasys.pantheon.util.bytes.BytesValue;
import java.io.File;
import java.math.BigInteger;
import java.net.URL;
import java.nio.file.Files;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.google.common.io.Resources;
import org.junit.BeforeClass;
import org.junit.Test;
@ -247,8 +245,11 @@ public class SECP256K1Test {
@Test
public void fileContainsValidPrivateKey() throws Exception {
final URL url = Resources.getResource("tech/pegasys/pantheon/crypto/validPrivateKey.txt");
final File file = new File(url.getFile());
final File file =
new File(
this.getClass()
.getResource("/tech/pegasys/pantheon/crypto/validPrivateKey.txt")
.toURI());
final SECP256K1.PrivateKey privateKey = SECP256K1.PrivateKey.load(file);
assertEquals(
BytesValue.fromHexString(

Loading…
Cancel
Save