Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update Cava library to Tuweni Library #18

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions acceptance-tests/dsl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions acceptance-tests/tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion besu/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,14 @@ 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/" }
maven { url artifactRepoUrl }
} else {
jcenter()
mavenCentral()
mavenLocal()
maven { url "https://consensys.bintray.com/pegasys-repo" }
maven { url "https://dl.bintray.com/tuweni/tuweni/" }
maven { url artifactRepoUrl }
}
}
Expand Down
2 changes: 1 addition & 1 deletion ethereum/api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion ethereum/permissioning/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
8 changes: 7 additions & 1 deletion gradle/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a full release or a snapshot? The -201907... bit has me worried.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This to me indicates a non-production release. And being an apache project it may not have had its release approved. This makes me nervous.

Is there a particular reason we need to go to the tuweni library?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Cava project is archived, I think this forces us to go to where the project lives now. I would prefer an incubating version over an archived one.
Binaries are all named after this scheme : https://bintray.com/tuweni/tuweni/tuweni
Also Besu is in the same incubation status at Hyperledger, it doesn't make it a project people can't use, does it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incubation isn't the issue, the question is whether this is a stable release or a -SNAPSHOT. We'd much prefer a stable release of an archived project to a -SNAPSHOT release.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notably, the latest release on Tuweni's GitHub is 0.8.1: https://github.com/apache/incubator-tuweni/releases

entry 'tuweni-bytes'
entry 'tuweni-io'
entry 'tuweni-config'
entry 'tuweni-crypto'
entry 'tuweni-toml'
}

dependency 'net.consensys:orion:1.3.2'

Expand Down
3 changes: 3 additions & 0 deletions testutil/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down