Moving and renaming (#1524)

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
CJ Hare 6 years ago committed by GitHub
parent 458e3bfb00
commit 757650f308
  1. 55
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/AcceptanceTestBase.java
  2. 44
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/admin/AdminConditions.java
  3. 34
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/admin/ExpectPeerAdded.java
  4. 15
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/clique/CliqueConditions.java
  5. 9
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/eea/EeaConditions.java
  6. 4
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/eea/ExpectNoPrivateContractDeployedReceipt.java
  7. 3
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/eea/ExpectNoValidPrivateContractEventsEmitted.java
  8. 3
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/eea/ExpectNoValidPrivateContractValuesReturned.java
  9. 3
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/eea/ExpectValidPrivateContractDeployedReceipt.java
  10. 3
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/eea/ExpectValidPrivateContractEventsEmitted.java
  11. 3
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/eea/ExpectValidPrivateContractValuesReturned.java
  12. 4
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/eea/ExpectValidPrivateTransactionReceipt.java
  13. 5
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/eea/GetValidPrivateTransactionReceipt.java
  14. 12
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/eth/EthConditions.java
  15. 9
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/ibft2/Ibft2Conditions.java
  16. 7
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/login/LoginConditions.java
  17. 15
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/net/NetConditions.java
  18. 13
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/perm/PermissioningConditions.java
  19. 7
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/web3/Web3Conditions.java
  20. 52
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/jsonrpc/Admin.java
  21. 10
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/cluster/Cluster.java
  22. 6
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/privacy/PrivacyAcceptanceTestBase.java
  23. 6
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/privacy/PrivateTransactionVerifier.java
  24. 44
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/admin/AddPeerTransaction.java
  25. 22
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/admin/AdminTransactions.java
  26. 6
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/web3j/privacy/EventEmitterHarness.java

@ -14,19 +14,20 @@ package tech.pegasys.pantheon.tests.acceptance.dsl;
import tech.pegasys.pantheon.tests.acceptance.dsl.account.Accounts;
import tech.pegasys.pantheon.tests.acceptance.dsl.blockchain.Blockchain;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.admin.AdminConditions;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.clique.CliqueConditions;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eth.EthConditions;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.ibft2.Ibft2Conditions;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.login.LoginConditions;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.net.NetConditions;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.perm.PermissioningConditions;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.web3.Web3Conditions;
import tech.pegasys.pantheon.tests.acceptance.dsl.contract.ContractVerifier;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Admin;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Clique;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Eth;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Ibft2;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Login;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Net;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Perm;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Web3;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.cluster.Cluster;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.configuration.PantheonNodeFactory;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.configuration.permissioning.PermissionedNodeBuilder;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.account.AccountTransactions;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.admin.AdminTransactions;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.clique.CliqueTransactions;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.contract.ContractTransactions;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eth.EthTransactions;
@ -41,44 +42,46 @@ public class AcceptanceTestBase {
protected final Accounts accounts;
protected final AccountTransactions accountTransactions;
protected final Admin admin;
protected final AdminConditions admin;
protected final AdminTransactions adminTransactions;
protected final Blockchain blockchain;
protected final Clique clique;
protected final CliqueConditions clique;
protected final CliqueTransactions cliqueTransactions;
protected final Cluster cluster;
protected final ContractVerifier contractVerifier;
protected final Eth eth;
protected final ContractTransactions contractTransactions;
protected final EthConditions eth;
protected final EthTransactions ethTransactions;
protected final Ibft2Transactions ibftTwoTransactions;
protected final Ibft2 ibftTwo;
protected final Login login;
protected final Net net;
protected final Ibft2Conditions ibftTwo;
protected final LoginConditions login;
protected final NetConditions net;
protected final PantheonNodeFactory pantheon;
protected final Perm perm;
protected final PermissioningConditions perm;
protected final PermissionedNodeBuilder permissionedNodeBuilder;
protected final PermissioningTransactions permissioningTransactions;
protected final ContractTransactions contractTransactions;
protected final Web3 web3;
protected final Web3Conditions web3;
protected AcceptanceTestBase() {
ethTransactions = new EthTransactions();
accounts = new Accounts(ethTransactions);
blockchain = new Blockchain(ethTransactions);
eth = new Eth(ethTransactions);
adminTransactions = new AdminTransactions();
cliqueTransactions = new CliqueTransactions();
ibftTwoTransactions = new Ibft2Transactions();
accountTransactions = new AccountTransactions(accounts);
permissioningTransactions = new PermissioningTransactions();
contractTransactions = new ContractTransactions();
clique = new Clique(ethTransactions, cliqueTransactions);
ibftTwo = new Ibft2(ibftTwoTransactions);
login = new Login();
net = new Net(new NetTransactions());
blockchain = new Blockchain(ethTransactions);
clique = new CliqueConditions(ethTransactions, cliqueTransactions);
eth = new EthConditions(ethTransactions);
ibftTwo = new Ibft2Conditions(ibftTwoTransactions);
login = new LoginConditions();
net = new NetConditions(new NetTransactions());
cluster = new Cluster(net);
perm = new Perm(permissioningTransactions);
admin = new Admin();
web3 = new Web3(new Web3Transactions());
perm = new PermissioningConditions(permissioningTransactions);
admin = new AdminConditions(adminTransactions);
web3 = new Web3Conditions(new Web3Transactions());
pantheon = new PantheonNodeFactory();
contractVerifier = new ContractVerifier(accounts.getPrimaryBenefactor());
permissionedNodeBuilder = new PermissionedNodeBuilder();

@ -0,0 +1,44 @@
/*
* Copyright 2019 ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.dsl.condition.admin;
import static org.assertj.core.api.Assertions.fail;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.RunnableNode;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.admin.AdminTransactions;
import java.net.URI;
public class AdminConditions {
private final AdminTransactions admin;
public AdminConditions(final AdminTransactions admin) {
this.admin = admin;
}
public Condition addPeer(final Node addingPeer) {
return new ExpectPeerAdded(admin.addPeer(enodeUrl(addingPeer)));
}
private URI enodeUrl(final Node node) {
if (!(node instanceof RunnableNode)) {
fail("A RunnableNode instance is required");
}
return ((RunnableNode) node).enodeUrl();
}
}

@ -0,0 +1,34 @@
/*
* Copyright 2019 ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.dsl.condition.admin;
import static org.assertj.core.api.Assertions.assertThat;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.admin.AddPeerTransaction;
public class ExpectPeerAdded implements Condition {
private final AddPeerTransaction transaction;
public ExpectPeerAdded(final AddPeerTransaction transaction) {
this.transaction = transaction;
}
@Override
public void verify(final Node node) {
final Boolean result = node.execute(transaction);
assertThat(result).isTrue();
}
}

@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc;
package tech.pegasys.pantheon.tests.acceptance.dsl.condition.clique;
import static java.util.Collections.emptyList;
import static tech.pegasys.pantheon.ethereum.core.Hash.fromHexString;
@ -21,14 +21,7 @@ import tech.pegasys.pantheon.config.GenesisConfigFile;
import tech.pegasys.pantheon.ethereum.core.Address;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.blockchain.ExpectBlockNotCreated;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.clique.AwaitSignerSetChange;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.clique.ExpectNonceVote;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.clique.ExpectNonceVote.CLIQUE_NONCE_VOTE;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.clique.ExpectProposals;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.clique.ExpectValidators;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.clique.ExpectValidatorsAtBlock;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.clique.ExpectValidatorsAtBlockHash;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.clique.ExpectedBlockHasProposer;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.clique.CliqueTransactions;
@ -44,11 +37,12 @@ import java.util.stream.Collectors;
import com.google.common.collect.ImmutableMap;
import org.web3j.protocol.core.DefaultBlockParameter;
public class Clique {
public class CliqueConditions {
private final EthTransactions eth;
private final CliqueTransactions clique;
public Clique(final EthTransactions eth, final CliqueTransactions clique) {
public CliqueConditions(final EthTransactions eth, final CliqueTransactions clique) {
this.eth = eth;
this.clique = clique;
}
@ -110,6 +104,7 @@ public class Clique {
}
public static class ProposalsConfig {
private final Map<PantheonNode, Boolean> proposals = new HashMap<>();
private final CliqueTransactions clique;

@ -10,17 +10,16 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc;
package tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea.ExpectSuccessfulEeaGetTransactionReceipt;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaTransactions;
public class Eea {
public class EeaConditions {
EeaTransactions transactions;
private final EeaTransactions transactions;
public Eea(final EeaTransactions transactions) {
public EeaConditions(final EeaTransactions transactions) {
this.transactions = transactions;
}

@ -14,14 +14,14 @@ package tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea;
import static org.junit.Assert.assertNull;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Eea;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaRequestFactory.PrivateTransactionReceipt;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaTransactions;
public class ExpectNoPrivateContractDeployedReceipt extends GetValidPrivateTransactionReceipt {
public ExpectNoPrivateContractDeployedReceipt(final Eea eea, final EeaTransactions transactions) {
public ExpectNoPrivateContractDeployedReceipt(
final EeaConditions eea, final EeaTransactions transactions) {
super(eea, transactions);
}

@ -14,7 +14,6 @@ package tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea;
import static junit.framework.TestCase.assertTrue;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Eea;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaRequestFactory.PrivateTransactionReceipt;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaTransactions;
@ -22,7 +21,7 @@ import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaTransaction
public class ExpectNoValidPrivateContractEventsEmitted extends GetValidPrivateTransactionReceipt {
public ExpectNoValidPrivateContractEventsEmitted(
final Eea eea, final EeaTransactions transactions) {
final EeaConditions eea, final EeaTransactions transactions) {
super(eea, transactions);
}

@ -14,7 +14,6 @@ package tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea;
import static org.junit.Assert.assertEquals;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Eea;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaRequestFactory.PrivateTransactionReceipt;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaTransactions;
@ -22,7 +21,7 @@ import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaTransaction
public class ExpectNoValidPrivateContractValuesReturned extends GetValidPrivateTransactionReceipt {
public ExpectNoValidPrivateContractValuesReturned(
final Eea eea, final EeaTransactions transactions) {
final EeaConditions eea, final EeaTransactions transactions) {
super(eea, transactions);
}

@ -15,7 +15,6 @@ package tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Eea;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaRequestFactory.PrivateTransactionReceipt;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaTransactions;
@ -25,7 +24,7 @@ public class ExpectValidPrivateContractDeployedReceipt extends GetValidPrivateTr
private final String contractAddress;
public ExpectValidPrivateContractDeployedReceipt(
final String contractAddress, final Eea eea, final EeaTransactions transactions) {
final String contractAddress, final EeaConditions eea, final EeaTransactions transactions) {
super(eea, transactions);
this.contractAddress = contractAddress;
}

@ -14,7 +14,6 @@ package tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea;
import static org.junit.Assert.assertEquals;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Eea;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaRequestFactory.PrivateTransactionReceipt;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaTransactions;
@ -28,7 +27,7 @@ public class ExpectValidPrivateContractEventsEmitted extends GetValidPrivateTran
private final String eventValue;
public ExpectValidPrivateContractEventsEmitted(
final String eventValue, final Eea eea, final EeaTransactions transactions) {
final String eventValue, final EeaConditions eea, final EeaTransactions transactions) {
super(eea, transactions);
this.eventValue = eventValue;
}

@ -14,7 +14,6 @@ package tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea;
import static org.junit.Assert.assertEquals;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Eea;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaRequestFactory.PrivateTransactionReceipt;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaTransactions;
@ -29,7 +28,7 @@ public class ExpectValidPrivateContractValuesReturned extends GetValidPrivateTra
private final String returnValue;
public ExpectValidPrivateContractValuesReturned(
final String returnValue, final Eea eea, final EeaTransactions transactions) {
final String returnValue, final EeaConditions eea, final EeaTransactions transactions) {
super(eea, transactions);
this.returnValue = returnValue;
}

@ -15,14 +15,14 @@ package tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertNotNull;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Eea;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaRequestFactory.PrivateTransactionReceipt;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaTransactions;
public class ExpectValidPrivateTransactionReceipt extends GetValidPrivateTransactionReceipt {
public ExpectValidPrivateTransactionReceipt(final Eea eea, final EeaTransactions transactions) {
public ExpectValidPrivateTransactionReceipt(
final EeaConditions eea, final EeaTransactions transactions) {
super(eea, transactions);
}

@ -14,17 +14,16 @@ package tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea;
import static tech.pegasys.pantheon.tests.acceptance.dsl.WaitUtils.waitFor;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Eea;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaRequestFactory.PrivateTransactionReceipt;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaTransactions;
public abstract class GetValidPrivateTransactionReceipt implements EeaCondition {
private Eea eea;
private EeaConditions eea;
private EeaTransactions transactions;
GetValidPrivateTransactionReceipt(final Eea eea, final EeaTransactions transactions) {
GetValidPrivateTransactionReceipt(final EeaConditions eea, final EeaTransactions transactions) {
this.eea = eea;
this.transactions = transactions;
}

@ -10,22 +10,16 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc;
package tech.pegasys.pantheon.tests.acceptance.dsl.condition.eth;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eth.ExpectEthAccountsException;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eth.ExpectEthGetTransactionReceiptIsAbsent;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eth.ExpectEthGetWorkException;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eth.ExpectEthSendRawTransactionException;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eth.ExpectSuccessfulEthGetTransactionReceipt;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eth.SanityCheckEthGetWorkValues;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eth.EthTransactions;
public class Eth {
public class EthConditions {
private final EthTransactions transactions;
public Eth(final EthTransactions transactions) {
public EthConditions(final EthTransactions transactions) {
this.transactions = transactions;
}

@ -10,15 +10,12 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc;
package tech.pegasys.pantheon.tests.acceptance.dsl.condition.ibft2;
import static tech.pegasys.pantheon.tests.acceptance.dsl.transaction.clique.CliqueTransactions.LATEST;
import tech.pegasys.pantheon.ethereum.core.Address;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.ibft2.AwaitValidatorSetChange;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.ibft2.ExpectProposals;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.ibft2.ExpectValidators;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.ibft2.Ibft2Transactions;
@ -33,11 +30,11 @@ import java.util.stream.Collectors;
import com.google.common.collect.ImmutableMap;
public class Ibft2 {
public class Ibft2Conditions {
private final Ibft2Transactions ibftTwo;
public Ibft2(final Ibft2Transactions ibftTwo) {
public Ibft2Conditions(final Ibft2Transactions ibftTwo) {
this.ibftTwo = ibftTwo;
}

@ -10,15 +10,12 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc;
package tech.pegasys.pantheon.tests.acceptance.dsl.condition.login;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.login.AwaitLoginResponse;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.login.ExpectLoginSuccess;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.login.ExpectLoginUnauthorized;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.login.LoginTransaction;
public class Login {
public class LoginConditions {
public Condition success(final String username, final String password) {
return new ExpectLoginSuccess(username, password);

@ -10,27 +10,18 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc;
package tech.pegasys.pantheon.tests.acceptance.dsl.condition.net;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.net.AwaitNetPeerCount;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.net.AwaitNetPeerCountException;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.net.ExpectNetServicesReturnsAllServicesAsActive;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.net.ExpectNetServicesReturnsOnlyJsonRpcActive;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.net.ExpectNetVersionConnectionException;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.net.ExpectNetVersionConnectionExceptionWithCause;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.net.ExpectNetVersionIsNotBlank;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.net.ExpectNetVersionPermissionException;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.net.ExpectNetVersionPermissionJsonRpcUnauthorizedResponse;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.net.NetTransactions;
import java.math.BigInteger;
public class Net {
public class NetConditions {
private final NetTransactions transactions;
public Net(final NetTransactions transactions) {
public NetConditions(final NetTransactions transactions) {
this.transactions = transactions;
}

@ -10,20 +10,13 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc;
package tech.pegasys.pantheon.tests.acceptance.dsl.condition.perm;
import static java.util.Arrays.asList;
import static java.util.stream.Collectors.toList;
import tech.pegasys.pantheon.ethereum.permissioning.WhitelistPersistor.WHITELIST_TYPE;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.perm.AddAccountsToWhitelistSuccessfully;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.perm.AddNodeSuccess;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.perm.GetExpectedAccountsWhitelist;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.perm.GetNodesWhitelistPopulated;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.perm.RemoveAccountsFromWhitelistSuccessfully;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.perm.RemoveNodeSuccess;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.perm.WhiteListContainsKeyAndValue;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.RunnableNode;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.perm.PermissioningTransactions;
@ -33,9 +26,9 @@ import java.nio.file.Path;
import java.util.List;
import java.util.stream.Stream;
public class Perm {
public class PermissioningConditions {
public Perm(final PermissioningTransactions transactions) {
public PermissioningConditions(final PermissioningTransactions transactions) {
this.transactions = transactions;
}

@ -10,17 +10,16 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc;
package tech.pegasys.pantheon.tests.acceptance.dsl.condition.web3;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.web3.ExpectWeb3Sha3Equals;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.web3.Web3Transactions;
public class Web3 {
public class Web3Conditions {
private final Web3Transactions transactions;
public Web3(final Web3Transactions transactions) {
public Web3Conditions(final Web3Transactions transactions) {
this.transactions = transactions;
}

@ -1,52 +0,0 @@
/*
* Copyright 2019 ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.RunnableNode;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.Transaction;
import java.io.IOException;
import java.net.URI;
import org.web3j.protocol.core.Response;
public class Admin {
private Transaction<Boolean> addPeerTransaction(final URI enode) {
return (n) -> {
try {
final Response<Boolean> resp = n.admin().adminAddPeer(enode).send();
assertThat(resp).isNotNull();
assertThat(resp.hasError()).isFalse();
return resp.getResult();
} catch (final IOException e) {
throw new RuntimeException(e);
}
};
}
public Condition addPeer(final Node node) {
if (!(node instanceof RunnableNode)) {
fail("Admin.addPeer() needs a RunnableNode instance");
}
return (n) -> {
final Boolean result = n.execute(addPeerTransaction(((RunnableNode) node).enodeUrl()));
assertThat(result).isTrue();
};
}
}

@ -18,7 +18,7 @@ import static java.util.stream.Collectors.toList;
import static org.assertj.core.api.Assertions.assertThat;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Net;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.net.NetConditions;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNodeRunner;
@ -39,22 +39,22 @@ public class Cluster implements AutoCloseable {
private final Map<String, RunnableNode> nodes = new HashMap<>();
private final PantheonNodeRunner pantheonNodeRunner;
private final Net net;
private final NetConditions net;
private final ClusterConfiguration clusterConfiguration;
private List<? extends RunnableNode> originalNodes = emptyList();
private List<URI> bootnodes = emptyList();
public Cluster(final Net net) {
public Cluster(final NetConditions net) {
this(new ClusterConfigurationBuilder().build(), net, PantheonNodeRunner.instance());
}
public Cluster(final ClusterConfiguration clusterConfiguration, final Net net) {
public Cluster(final ClusterConfiguration clusterConfiguration, final NetConditions net) {
this(clusterConfiguration, net, PantheonNodeRunner.instance());
}
public Cluster(
final ClusterConfiguration clusterConfiguration,
final Net net,
final NetConditions net,
final PantheonNodeRunner pantheonNodeRunner) {
this.clusterConfiguration = clusterConfiguration;
this.net = net;

@ -13,7 +13,7 @@
package tech.pegasys.pantheon.tests.acceptance.dsl.privacy;
import tech.pegasys.pantheon.tests.acceptance.dsl.AcceptanceTestBase;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Eea;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea.EeaConditions;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.configuration.privacy.PrivacyPantheonNodeFactory;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaTransactions;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.PrivateTransactionBuilder;
@ -24,7 +24,7 @@ import org.junit.rules.TemporaryFolder;
public class PrivacyAcceptanceTestBase extends AcceptanceTestBase {
@ClassRule public static final TemporaryFolder privacy = new TemporaryFolder();
protected final Eea eea;
protected final EeaConditions eea;
protected final PrivateTransactions privateTransactions;
protected final PrivateTransactionBuilder.Builder privateTransactionBuilder;
protected final PrivateTransactionVerifier privateTransactionVerifier;
@ -34,7 +34,7 @@ public class PrivacyAcceptanceTestBase extends AcceptanceTestBase {
final EeaTransactions eeaTransactions = new EeaTransactions();
privateTransactions = new PrivateTransactions();
eea = new Eea(eeaTransactions);
eea = new EeaConditions(eeaTransactions);
privateTransactionBuilder = PrivateTransactionBuilder.builder();
privateTransactionVerifier = new PrivateTransactionVerifier(eea, eeaTransactions);
privacyPantheon = new PrivacyPantheonNodeFactory();

@ -12,6 +12,7 @@
*/
package tech.pegasys.pantheon.tests.acceptance.dsl.privacy;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea.EeaConditions;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea.ExpectNoPrivateContractDeployedReceipt;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea.ExpectNoValidPrivateContractEventsEmitted;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea.ExpectNoValidPrivateContractValuesReturned;
@ -19,15 +20,14 @@ import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea.ExpectValidPriva
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea.ExpectValidPrivateContractEventsEmitted;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea.ExpectValidPrivateContractValuesReturned;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea.ExpectValidPrivateTransactionReceipt;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Eea;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaTransactions;
public class PrivateTransactionVerifier {
private final EeaTransactions transactions;
private final Eea eea;
private final EeaConditions eea;
public PrivateTransactionVerifier(final Eea eea, final EeaTransactions transactions) {
public PrivateTransactionVerifier(final EeaConditions eea, final EeaTransactions transactions) {
this.eea = eea;
this.transactions = transactions;
}

@ -0,0 +1,44 @@
/*
* Copyright 2019 ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.dsl.transaction.admin;
import static org.assertj.core.api.Assertions.assertThat;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.NodeRequests;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.Transaction;
import java.io.IOException;
import java.net.URI;
import org.web3j.protocol.core.Response;
public class AddPeerTransaction implements Transaction<Boolean> {
private final URI peer;
public AddPeerTransaction(final URI peer) {
this.peer = peer;
}
@Override
public Boolean execute(final NodeRequests node) {
try {
final Response<Boolean> resp = node.admin().adminAddPeer(peer).send();
assertThat(resp).isNotNull();
assertThat(resp.hasError()).isFalse();
return resp.getResult();
} catch (final IOException e) {
throw new RuntimeException(e);
}
}
}

@ -0,0 +1,22 @@
/*
* Copyright 2019 ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.dsl.transaction.admin;
import java.net.URI;
public class AdminTransactions {
public AddPeerTransaction addPeer(final URI peer) {
return new AddPeerTransaction(peer);
}
}

@ -17,7 +17,7 @@ import static tech.pegasys.pantheon.tests.acceptance.dsl.WaitUtils.waitFor;
import tech.pegasys.pantheon.ethereum.core.Address;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea.EeaCondition;
import tech.pegasys.pantheon.tests.acceptance.dsl.jsonrpc.Eea;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.eea.EeaConditions;
import tech.pegasys.pantheon.tests.acceptance.dsl.privacy.PrivacyNet;
import tech.pegasys.pantheon.tests.acceptance.dsl.privacy.PrivateTransactionVerifier;
import tech.pegasys.pantheon.tests.acceptance.dsl.privacy.PrivateTransactions;
@ -46,7 +46,7 @@ public class EventEmitterHarness {
private PrivacyNet privacyNet;
private PrivateTransactions privateTransactions;
private PrivateTransactionVerifier privateTransactionVerifier;
private Eea eea;
private EeaConditions eea;
private Map<String, String> contracts;
@ -55,7 +55,7 @@ public class EventEmitterHarness {
final PrivacyNet privacyNet,
final PrivateTransactions privateTransactions,
final PrivateTransactionVerifier privateTransactionVerifier,
final Eea eea) {
final EeaConditions eea) {
this.privateTransactionBuilder = privateTransactionBuilder;
this.privacyNet = privacyNet;

Loading…
Cancel
Save