From 7d132ec97b4fbd26a2ba6c80409594bc3be58d1b Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 17 Sep 2019 12:08:40 +0200 Subject: [PATCH 1/2] update Cava library to Tuweni Library Cava and Tuweni are the same thing but renamed when moved to Apache foundation Signed-off-by: Nicolas --- acceptance-tests/dsl/build.gradle | 3 +-- .../ethsigner/testutil/EthSignerTestHarnessFactory.java | 2 +- .../besu/tests/acceptance/dsl/node/BesuNode.java | 2 +- acceptance-tests/tests/build.gradle | 2 +- .../tests/web3j/privacy/EnclaveErrorAcceptanceTest.java | 2 +- besu/build.gradle | 2 +- .../hyperledger/besu/cli/custom/RpcAuthFileValidator.java | 2 +- .../besu/cli/util/TomlConfigFileDefaultProvider.java | 6 +++--- .../java/org/hyperledger/besu/cli/BesuCommandTest.java | 4 ++-- build.gradle | 2 ++ ethereum/api/build.gradle | 2 +- .../ethereum/api/jsonrpc/authentication/TomlAuth.java | 6 +++--- ethereum/permissioning/build.gradle | 2 +- .../permissioning/PermissioningConfigurationBuilder.java | 4 ++-- .../besu/ethereum/permissioning/TomlConfigFileParser.java | 6 +++--- .../besu/ethereum/permissioning/WhitelistPersistor.java | 4 ++-- gradle/versions.gradle | 8 +++++++- testutil/build.gradle | 3 +++ .../org/hyperledger/orion/testutil/OrionKeyUtils.java | 2 +- .../orion/testutil/OrionTestHarnessFactory.java | 2 +- 20 files changed, 38 insertions(+), 28 deletions(-) diff --git a/acceptance-tests/dsl/build.gradle b/acceptance-tests/dsl/build.gradle index b15d83d8615..400647d5b3a 100644 --- a/acceptance-tests/dsl/build.gradle +++ b/acceptance-tests/dsl/build.gradle @@ -42,6 +42,5 @@ dependencies { implementation 'tech.pegasys.ethsigner.internal:core' implementation 'tech.pegasys.ethsigner.internal:file-based' implementation 'tech.pegasys.ethsigner.internal:signing-api' - - + implementation 'org.apache.tuweni:tuweni-io' } diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/ethsigner/testutil/EthSignerTestHarnessFactory.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/ethsigner/testutil/EthSignerTestHarnessFactory.java index cc8e6b2ffaf..0957566e277 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/ethsigner/testutil/EthSignerTestHarnessFactory.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/ethsigner/testutil/EthSignerTestHarnessFactory.java @@ -12,7 +12,7 @@ */ package org.hyperledger.besu.tests.acceptance.dsl.ethsigner.testutil; -import static net.consensys.cava.io.file.Files.copyResource; +import static org.apache.tuweni.io.file.Files.copyResource; import java.io.File; import java.io.FileInputStream; diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java index 790044dd92b..5b72d4a2ed6 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java @@ -13,8 +13,8 @@ package org.hyperledger.besu.tests.acceptance.dsl.node; import static java.util.Collections.unmodifiableList; -import static net.consensys.cava.io.file.Files.copyResource; import static org.apache.logging.log4j.LogManager.getLogger; +import static org.apache.tuweni.io.file.Files.copyResource; import org.hyperledger.besu.controller.KeyPairUtil; import org.hyperledger.besu.crypto.SECP256K1.KeyPair; diff --git a/acceptance-tests/tests/build.gradle b/acceptance-tests/tests/build.gradle index 7f3c075e0d8..889ebb17ab8 100644 --- a/acceptance-tests/tests/build.gradle +++ b/acceptance-tests/tests/build.gradle @@ -14,7 +14,7 @@ dependencies { testImplementation 'junit:junit' - testImplementation 'net.consensys:orion' + testImplementation 'org.apache.tuweni:tuweni-crypto' testImplementation 'org.assertj:assertj-core' testImplementation 'org.web3j:abi' testImplementation 'org.web3j:pantheon' diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/EnclaveErrorAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/EnclaveErrorAcceptanceTest.java index fca1610a5ab..a12bc55eb48 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/EnclaveErrorAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/EnclaveErrorAcceptanceTest.java @@ -23,7 +23,7 @@ import java.math.BigInteger; import java.util.Base64; -import net.consensys.cava.crypto.sodium.Box; +import org.apache.tuweni.crypto.sodium.Box; import org.junit.Before; import org.junit.Test; import org.web3j.protocol.eea.response.PrivateTransactionReceipt; diff --git a/besu/build.gradle b/besu/build.gradle index b346867a2dc..bfb852b743d 100644 --- a/besu/build.gradle +++ b/besu/build.gradle @@ -55,7 +55,7 @@ dependencies { implementation 'info.picocli:picocli' implementation 'io.vertx:vertx-core' implementation 'io.vertx:vertx-web' - implementation 'net.consensys.cava:cava-toml' + implementation 'org.apache.tuweni:tuweni-config' implementation 'org.apache.logging.log4j:log4j-api' implementation 'org.springframework.security:spring-security-crypto' diff --git a/besu/src/main/java/org/hyperledger/besu/cli/custom/RpcAuthFileValidator.java b/besu/src/main/java/org/hyperledger/besu/cli/custom/RpcAuthFileValidator.java index 507f7b8013a..9ee0248ed5a 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/custom/RpcAuthFileValidator.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/custom/RpcAuthFileValidator.java @@ -19,7 +19,7 @@ import java.util.stream.Collectors; import com.google.common.base.Strings; -import net.consensys.cava.toml.TomlParseResult; +import org.apache.tuweni.toml.TomlParseResult; import picocli.CommandLine; import picocli.CommandLine.ParameterException; diff --git a/besu/src/main/java/org/hyperledger/besu/cli/util/TomlConfigFileDefaultProvider.java b/besu/src/main/java/org/hyperledger/besu/cli/util/TomlConfigFileDefaultProvider.java index dd49534fefd..6eccec2f8b4 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/util/TomlConfigFileDefaultProvider.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/util/TomlConfigFileDefaultProvider.java @@ -22,9 +22,9 @@ import java.util.Set; import java.util.stream.Collectors; -import net.consensys.cava.toml.Toml; -import net.consensys.cava.toml.TomlParseError; -import net.consensys.cava.toml.TomlParseResult; +import org.apache.tuweni.toml.Toml; +import org.apache.tuweni.toml.TomlParseError; +import org.apache.tuweni.toml.TomlParseResult; import picocli.CommandLine; import picocli.CommandLine.IDefaultValueProvider; import picocli.CommandLine.Model.ArgSpec; diff --git a/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java b/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java index e2b0a2ecec1..f996a1dddb6 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java @@ -78,9 +78,9 @@ import com.google.common.collect.Lists; import com.google.common.io.Resources; import io.vertx.core.json.JsonObject; -import net.consensys.cava.toml.Toml; -import net.consensys.cava.toml.TomlParseResult; import org.apache.commons.text.StringEscapeUtils; +import org.apache.tuweni.toml.Toml; +import org.apache.tuweni.toml.TomlParseResult; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; diff --git a/build.gradle b/build.gradle index e19cd1be847..10557a51561 100644 --- a/build.gradle +++ b/build.gradle @@ -119,11 +119,13 @@ allprojects { if ("$System.env.JENKINS_URL" == 'https://jenkins.pegasys.tech/') { maven { url "https://nexus.int.pegasys.tech/repository/consensys-pegasys/" } maven { url "https://nexus.int.pegasys.tech/repository/jcenter/" } + maven { url "https://dl.bintray.com/tuweni/tuweni/" } } else { jcenter() mavenCentral() mavenLocal() maven { url "https://consensys.bintray.com/pegasys-repo" } + maven { url "https://dl.bintray.com/tuweni/tuweni/" } } } diff --git a/ethereum/api/build.gradle b/ethereum/api/build.gradle index 4ee2840057c..dc96604b656 100644 --- a/ethereum/api/build.gradle +++ b/ethereum/api/build.gradle @@ -41,7 +41,7 @@ dependencies { implementation project(':crypto') implementation 'org.springframework.security:spring-security-crypto' - implementation 'net.consensys.cava:cava-toml' + implementation 'org.apache.tuweni:tuweni-toml' implementation 'com.graphql-java:graphql-java' implementation 'com.google.guava:guava' implementation 'io.vertx:vertx-core' diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/TomlAuth.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/TomlAuth.java index f1cc63fb756..b56e40e8539 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/TomlAuth.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/TomlAuth.java @@ -23,9 +23,9 @@ import io.vertx.core.json.JsonObject; import io.vertx.ext.auth.AuthProvider; import io.vertx.ext.auth.User; -import net.consensys.cava.toml.Toml; -import net.consensys.cava.toml.TomlParseResult; -import net.consensys.cava.toml.TomlTable; +import org.apache.tuweni.toml.Toml; +import org.apache.tuweni.toml.TomlParseResult; +import org.apache.tuweni.toml.TomlTable; import org.springframework.security.crypto.bcrypt.BCrypt; public class TomlAuth implements AuthProvider { diff --git a/ethereum/permissioning/build.gradle b/ethereum/permissioning/build.gradle index 8e5bc89fd0c..84ae4de8378 100644 --- a/ethereum/permissioning/build.gradle +++ b/ethereum/permissioning/build.gradle @@ -33,7 +33,7 @@ dependencies { implementation project(':metrics:core') implementation 'com.google.guava:guava' - implementation 'net.consensys.cava:cava-toml' + implementation 'org.apache.tuweni:tuweni-toml' implementation 'org.apache.logging.log4j:log4j-api' testImplementation project(path: ':ethereum:core', configuration: 'testSupportArtifacts') diff --git a/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/PermissioningConfigurationBuilder.java b/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/PermissioningConfigurationBuilder.java index 19f18ed1525..b8ef87a93db 100644 --- a/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/PermissioningConfigurationBuilder.java +++ b/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/PermissioningConfigurationBuilder.java @@ -19,8 +19,8 @@ import java.util.List; import java.util.stream.Collectors; -import net.consensys.cava.toml.TomlArray; -import net.consensys.cava.toml.TomlParseResult; +import org.apache.tuweni.toml.TomlArray; +import org.apache.tuweni.toml.TomlParseResult; public class PermissioningConfigurationBuilder { diff --git a/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/TomlConfigFileParser.java b/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/TomlConfigFileParser.java index 1feabfd7ff8..c2d7c09d169 100644 --- a/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/TomlConfigFileParser.java +++ b/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/TomlConfigFileParser.java @@ -19,11 +19,11 @@ import java.util.stream.Collectors; import com.google.common.io.Resources; -import net.consensys.cava.toml.Toml; -import net.consensys.cava.toml.TomlParseError; -import net.consensys.cava.toml.TomlParseResult; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.tuweni.toml.Toml; +import org.apache.tuweni.toml.TomlParseError; +import org.apache.tuweni.toml.TomlParseResult; public class TomlConfigFileParser { diff --git a/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/WhitelistPersistor.java b/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/WhitelistPersistor.java index ba654ff130f..e51724afb47 100644 --- a/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/WhitelistPersistor.java +++ b/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/WhitelistPersistor.java @@ -27,8 +27,8 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Charsets; -import net.consensys.cava.toml.Toml; -import net.consensys.cava.toml.TomlParseResult; +import org.apache.tuweni.toml.Toml; +import org.apache.tuweni.toml.TomlParseResult; public class WhitelistPersistor { diff --git a/gradle/versions.gradle b/gradle/versions.gradle index 20178dddf15..24ae7e34e11 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -54,7 +54,13 @@ dependencyManagement { dependency 'junit:junit:4.12' - dependency 'net.consensys.cava:cava-toml:0.5.0' + dependencySet(group: 'org.apache.tuweni', version: '0.9.0-20190709195335') { + entry 'tuweni-bytes' + entry 'tuweni-io' + entry 'tuweni-config' + entry 'tuweni-crypto' + entry 'tuweni-toml' + } dependency 'net.consensys:orion:1.3.2' diff --git a/testutil/build.gradle b/testutil/build.gradle index 69590ab08b1..660adacb3d4 100644 --- a/testutil/build.gradle +++ b/testutil/build.gradle @@ -37,4 +37,7 @@ dependencies { implementation 'org.assertj:assertj-core' implementation 'org.mockito:mockito-core' implementation 'org.web3j:core' + implementation 'org.apache.tuweni:tuweni-toml' + implementation 'org.apache.tuweni:tuweni-bytes' + implementation 'org.apache.tuweni:tuweni-io' } diff --git a/testutil/src/main/java/org/hyperledger/orion/testutil/OrionKeyUtils.java b/testutil/src/main/java/org/hyperledger/orion/testutil/OrionKeyUtils.java index ef3b85b73e5..b99b8227d92 100644 --- a/testutil/src/main/java/org/hyperledger/orion/testutil/OrionKeyUtils.java +++ b/testutil/src/main/java/org/hyperledger/orion/testutil/OrionKeyUtils.java @@ -24,9 +24,9 @@ import java.security.PublicKey; import java.util.Base64; -import net.consensys.cava.bytes.Bytes; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.tuweni.bytes.Bytes; public class OrionKeyUtils { private static final Logger LOG = LogManager.getLogger(); diff --git a/testutil/src/main/java/org/hyperledger/orion/testutil/OrionTestHarnessFactory.java b/testutil/src/main/java/org/hyperledger/orion/testutil/OrionTestHarnessFactory.java index 2579627b8e7..8e3d62ef5ea 100644 --- a/testutil/src/main/java/org/hyperledger/orion/testutil/OrionTestHarnessFactory.java +++ b/testutil/src/main/java/org/hyperledger/orion/testutil/OrionTestHarnessFactory.java @@ -12,7 +12,7 @@ */ package org.hyperledger.orion.testutil; -import static net.consensys.cava.io.file.Files.copyResource; +import static org.apache.tuweni.io.file.Files.copyResource; import java.io.IOException; import java.nio.file.Path; From 66fad2831671519eecd830d20f605db0403756b8 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 17 Sep 2019 12:19:22 +0200 Subject: [PATCH 2/2] keep orion dependency in acceptance tests Vertex is linked from Orion in acceptance tests so removing it makes tests fail Signed-off-by: Nicolas --- acceptance-tests/tests/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/acceptance-tests/tests/build.gradle b/acceptance-tests/tests/build.gradle index 889ebb17ab8..13690596a8b 100644 --- a/acceptance-tests/tests/build.gradle +++ b/acceptance-tests/tests/build.gradle @@ -14,6 +14,7 @@ dependencies { testImplementation 'junit:junit' + testImplementation 'net.consensys:orion' testImplementation 'org.apache.tuweni:tuweni-crypto' testImplementation 'org.assertj:assertj-core' testImplementation 'org.web3j:abi'