Rename: OnChain -> onchain (#2806)

* onChain -> onchain
* OnChain -> Onchain

Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
pull/2815/head
Sally MacFarlane 3 years ago committed by GitHub
parent f23e88715a
commit 84f58a9aa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeFactory.java
  2. 4
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/privacy/PrivacyNodeFactory.java
  3. 12
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/ExpectValidOnchainPrivacyGroupCreated.java
  4. 14
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/PrivateTransactionVerifier.java
  5. 4
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/contract/CallOnchainPermissioningPrivateSmartContractFunction.java
  6. 4
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/contract/PrivateContractTransactions.java
  7. 4
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/transaction/AddToOnchainPrivacyGroupTransaction.java
  8. 4
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/transaction/CreateOnchainPrivacyGroupTransaction.java
  9. 10
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/transaction/FindOnchainPrivacyGroupTransaction.java
  10. 4
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/transaction/LockOnchainPrivacyGroupTransaction.java
  11. 28
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/transaction/PrivacyTransactions.java
  12. 4
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/transaction/RemoveFromOnchainPrivacyGroupTransaction.java
  13. 4
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/transaction/UnlockOnchainPrivacyGroupTransaction.java
  14. 24
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/transaction/privacy/PrivacyRequestFactory.java
  15. 14
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/AccountLocalAndOnchainPermissioningAcceptanceTest.java
  16. 14
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeLocalAndOnchainPermissioningAcceptanceTest.java
  17. 2
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningAcceptanceTest.java
  18. 2
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2AcceptanceTest.java
  19. 14
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/PrivDebugGetStateRootOnchainGroupAcceptanceTest.java
  20. 32
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/multitenancy/OnchainMultiTenancyAcceptanceTest.java
  21. 68
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/OnchainPrivacyAcceptanceTest.java
  22. 30
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/OnchainPrivacyAcceptanceTestBase.java
  23. 6
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/contracts/PrivacyGroupTest.java
  24. 68
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/contracts/PrivacyProxyTest.java
  25. 6
      besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java
  26. 6
      besu/src/test/java/org/hyperledger/besu/PrivacyTest.java
  27. 4
      besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java
  28. 2
      consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/BaseBftProtocolSchedule.java
  29. 4
      consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/BftBlockHashing.java
  30. 4
      consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/BftBlockHeaderFunctions.java
  31. 2
      consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/BftHelpers.java
  32. 2
      consensus/common/src/test/java/org/hyperledger/besu/consensus/common/bft/queries/BftQueryServiceImplTest.java
  33. 2
      consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/TestContextBuilder.java
  34. 6
      consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/BftBlockHashingTest.java
  35. 2
      consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/IbftBlockHashing.java
  36. 2
      consensus/ibftlegacy/src/main/java/org/hyperledger/besu/consensus/ibftlegacy/LegacyIbftBlockHeaderFunctions.java
  37. 4
      consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/TestContextBuilder.java
  38. 4
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/eea/RestrictedOffchainEeaSendRawTransaction.java
  39. 4
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/eea/RestrictedOnchainEeaSendRawTransaction.java
  40. 6
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/privx/PrivxFindOnchainPrivacyGroup.java
  41. 8
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/EeaJsonRpcMethods.java
  42. 4
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/PrivxJsonRpcMethods.java
  43. 4
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/eea/EeaSendRawTransactionTest.java
  44. 6
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/eea/RestrictedOffchainEeaSendRawTransactionTest.java
  45. 18
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/eea/RestrictedOnchainEeaSendRawTransactionTest.java
  46. 26
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/privx/PrivxFindOnchainPrivacyGroupTest.java
  47. 4
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/PrivxJsonRpcMethodsTest.java
  48. 4
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetPrecompiledContractRegistries.java
  49. 4
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivacyBlockProcessor.java
  50. 8
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSpecBuilder.java
  51. 18
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/precompiles/privacy/OnchainPrivacyPrecompiledContract.java
  52. 6
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/OnchainPrivacyGroupContract.java
  53. 4
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PluginPrivacyController.java
  54. 4
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivacyController.java
  55. 2
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivacyGroupUtil.java
  56. 6
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/PrivateStateGenesisAllocator.java
  57. 20
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/RestrictedDefaultPrivacyController.java
  58. 8
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/RestrictedMultiTenancyPrivacyController.java
  59. 2
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/group/OnchainGroupManagement.java
  60. 4
      ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/PrivateTransactionDataFixture.java
  61. 4
      ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetPrecompiledContractRegistriesTest.java
  62. 6
      ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PrivacyBlockProcessorTest.java
  63. 26
      ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/precompiles/privacy/OnchainPrivacyPrecompiledContractTest.java
  64. 12
      ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/PrivateStateGenesisAllocatorTest.java
  65. 8
      ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/PrivateTransactionLocatorTest.java
  66. 4
      ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/RestrictedDefaultPrivacyControllerTest.java
  67. 4
      ethereum/core/src/test/java/org/hyperledger/besu/ethereum/vm/BlockHashLookupTest.java
  68. 2
      ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolTest.java
  69. 2
      ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/IBFTGenesisFileModule.java
  70. 4
      ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/account/AccountPermissioningController.java
  71. 2
      evm/src/main/java/org/hyperledger/besu/evm/processor/MessageCallProcessor.java
  72. 42
      privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/DefaultOnchainPrivacyGroupManagementContract.java
  73. 42
      privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/OnchainPrivacyGroupManagementInterface.java
  74. 42
      privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/OnchainPrivacyGroupManagementProxy.java

@ -212,14 +212,14 @@ public class BesuNodeFactory {
final String enclaveUrl, final String enclaveUrl,
final String authFile, final String authFile,
final String privTransactionSigningKey, final String privTransactionSigningKey,
final boolean enableOnChainPrivacy) final boolean enableOnchainPrivacy)
throws IOException, URISyntaxException { throws IOException, URISyntaxException {
final PrivacyParameters.Builder privacyParametersBuilder = new PrivacyParameters.Builder(); final PrivacyParameters.Builder privacyParametersBuilder = new PrivacyParameters.Builder();
final PrivacyParameters privacyParameters = final PrivacyParameters privacyParameters =
privacyParametersBuilder privacyParametersBuilder
.setMultiTenancyEnabled(true) .setMultiTenancyEnabled(true)
.setEnabled(true) .setEnabled(true)
.setOnchainPrivacyGroupsEnabled(enableOnChainPrivacy) .setOnchainPrivacyGroupsEnabled(enableOnchainPrivacy)
.setStorageProvider(new InMemoryPrivacyStorageProvider()) .setStorageProvider(new InMemoryPrivacyStorageProvider())
.setEnclaveFactory(new EnclaveFactory(Vertx.vertx())) .setEnclaveFactory(new EnclaveFactory(Vertx.vertx()))
.setEnclaveUrl(URI.create(enclaveUrl)) .setEnclaveUrl(URI.create(enclaveUrl))

@ -244,7 +244,7 @@ public class PrivacyNodeFactory {
containerNetwork); containerNetwork);
} }
public PrivacyNode createOnChainPrivacyGroupEnabledMinerNode( public PrivacyNode createOnchainPrivacyGroupEnabledMinerNode(
final String name, final String name,
final PrivacyAccount privacyAccount, final PrivacyAccount privacyAccount,
final boolean multiTenancyEnabled, final boolean multiTenancyEnabled,
@ -278,7 +278,7 @@ public class PrivacyNodeFactory {
containerNetwork); containerNetwork);
} }
public PrivacyNode createOnChainPrivacyGroupEnabledNode( public PrivacyNode createOnchainPrivacyGroupEnabledNode(
final String name, final String name,
final PrivacyAccount privacyAccount, final PrivacyAccount privacyAccount,
final boolean multiTenancyEnabled, final boolean multiTenancyEnabled,

@ -25,14 +25,14 @@ import java.util.List;
import org.awaitility.Awaitility; import org.awaitility.Awaitility;
import org.web3j.utils.Base64String; import org.web3j.utils.Base64String;
public class ExpectValidOnChainPrivacyGroupCreated implements PrivateCondition { public class ExpectValidOnchainPrivacyGroupCreated implements PrivateCondition {
private final PrivacyTransactions transactions; private final PrivacyTransactions transactions;
private final PrivacyRequestFactory.OnChainPrivacyGroup expected; private final PrivacyRequestFactory.OnchainPrivacyGroup expected;
public ExpectValidOnChainPrivacyGroupCreated( public ExpectValidOnchainPrivacyGroupCreated(
final PrivacyTransactions transactions, final PrivacyTransactions transactions,
final PrivacyRequestFactory.OnChainPrivacyGroup expected) { final PrivacyRequestFactory.OnchainPrivacyGroup expected) {
this.transactions = transactions; this.transactions = transactions;
this.expected = expected; this.expected = expected;
} }
@ -42,9 +42,9 @@ public class ExpectValidOnChainPrivacyGroupCreated implements PrivateCondition {
Awaitility.await() Awaitility.await()
.untilAsserted( .untilAsserted(
() -> { () -> {
final List<PrivacyRequestFactory.OnChainPrivacyGroup> groups = final List<PrivacyRequestFactory.OnchainPrivacyGroup> groups =
node.execute( node.execute(
transactions.findOnChainPrivacyGroup( transactions.findOnchainPrivacyGroup(
Base64String.unwrapList(expected.getMembers()))); Base64String.unwrapList(expected.getMembers())));
assertThat(groups).contains(expected); assertThat(groups).contains(expected);
}); });

@ -16,7 +16,7 @@ package org.hyperledger.besu.tests.acceptance.dsl.privacy.condition;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode; import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.transaction.PrivacyTransactions; import org.hyperledger.besu.tests.acceptance.dsl.privacy.transaction.PrivacyTransactions;
import org.hyperledger.besu.tests.acceptance.dsl.transaction.privacy.PrivacyRequestFactory.OnChainPrivacyGroup; import org.hyperledger.besu.tests.acceptance.dsl.transaction.privacy.PrivacyRequestFactory.OnchainPrivacyGroup;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -53,7 +53,7 @@ public class PrivateTransactionVerifier {
return new ExpectValidPrivacyGroupCreated(transactions, expected); return new ExpectValidPrivacyGroupCreated(transactions, expected);
} }
public ExpectValidOnChainPrivacyGroupCreated onChainPrivacyGroupExists( public ExpectValidOnchainPrivacyGroupCreated onchainPrivacyGroupExists(
final String privacyGroupId, final PrivacyNode... members) { final String privacyGroupId, final PrivacyNode... members) {
final List<Base64String> membersEnclaveKeys = final List<Base64String> membersEnclaveKeys =
@ -61,16 +61,16 @@ public class PrivateTransactionVerifier {
.map(PrivacyNode::getEnclaveKey) .map(PrivacyNode::getEnclaveKey)
.map(Base64String::wrap) .map(Base64String::wrap)
.collect(Collectors.toList()); .collect(Collectors.toList());
return onChainPrivacyGroupExists(privacyGroupId, membersEnclaveKeys); return onchainPrivacyGroupExists(privacyGroupId, membersEnclaveKeys);
} }
public ExpectValidOnChainPrivacyGroupCreated onChainPrivacyGroupExists( public ExpectValidOnchainPrivacyGroupCreated onchainPrivacyGroupExists(
final String privacyGroupId, final List<Base64String> membersEnclaveKeys) { final String privacyGroupId, final List<Base64String> membersEnclaveKeys) {
final OnChainPrivacyGroup expectedGroup = final OnchainPrivacyGroup expectedGroup =
new OnChainPrivacyGroup(privacyGroupId, membersEnclaveKeys); new OnchainPrivacyGroup(privacyGroupId, membersEnclaveKeys);
return new ExpectValidOnChainPrivacyGroupCreated(transactions, expectedGroup); return new ExpectValidOnchainPrivacyGroupCreated(transactions, expectedGroup);
} }
public ExpectInternalErrorPrivateTransactionReceipt internalErrorPrivateTransactionReceipt( public ExpectInternalErrorPrivateTransactionReceipt internalErrorPrivateTransactionReceipt(

@ -26,7 +26,7 @@ import org.web3j.tx.gas.BesuPrivacyGasProvider;
import org.web3j.utils.Base64String; import org.web3j.utils.Base64String;
import org.web3j.utils.Restriction; import org.web3j.utils.Restriction;
public class CallOnChainPermissioningPrivateSmartContractFunction implements Transaction<String> { public class CallOnchainPermissioningPrivateSmartContractFunction implements Transaction<String> {
private static final BesuPrivacyGasProvider GAS_PROVIDER = private static final BesuPrivacyGasProvider GAS_PROVIDER =
new BesuPrivacyGasProvider(BigInteger.valueOf(1000)); new BesuPrivacyGasProvider(BigInteger.valueOf(1000));
@ -36,7 +36,7 @@ public class CallOnChainPermissioningPrivateSmartContractFunction implements Tra
private final Base64String privateFrom; private final Base64String privateFrom;
private final Base64String privacyGroupId; private final Base64String privacyGroupId;
public CallOnChainPermissioningPrivateSmartContractFunction( public CallOnchainPermissioningPrivateSmartContractFunction(
final String contractAddress, final String contractAddress,
final String encodedFunction, final String encodedFunction,
final String transactionSigningKey, final String transactionSigningKey,

@ -142,13 +142,13 @@ public class PrivateContractTransactions {
contractAddress, clazz, transactionSigningKey, privateFrom, privacyGroupId); contractAddress, clazz, transactionSigningKey, privateFrom, privacyGroupId);
} }
public CallOnChainPermissioningPrivateSmartContractFunction callOnChainPermissioningSmartContract( public CallOnchainPermissioningPrivateSmartContractFunction callOnchainPermissioningSmartContract(
final String contractAddress, final String contractAddress,
final String encodedFunction, final String encodedFunction,
final String transactionSigningKey, final String transactionSigningKey,
final String privateFrom, final String privateFrom,
final String privacyGroupId) { final String privacyGroupId) {
return new CallOnChainPermissioningPrivateSmartContractFunction( return new CallOnchainPermissioningPrivateSmartContractFunction(
contractAddress, encodedFunction, transactionSigningKey, privateFrom, privacyGroupId); contractAddress, encodedFunction, transactionSigningKey, privateFrom, privacyGroupId);
} }
} }

@ -26,13 +26,13 @@ import java.util.stream.Collectors;
import org.web3j.crypto.Credentials; import org.web3j.crypto.Credentials;
import org.web3j.utils.Base64String; import org.web3j.utils.Base64String;
public class AddToOnChainPrivacyGroupTransaction implements Transaction<String> { public class AddToOnchainPrivacyGroupTransaction implements Transaction<String> {
private final Base64String privacyGroupId; private final Base64String privacyGroupId;
private final PrivacyNode adder; private final PrivacyNode adder;
private final List<String> addresses; private final List<String> addresses;
private final Credentials signer; private final Credentials signer;
public AddToOnChainPrivacyGroupTransaction( public AddToOnchainPrivacyGroupTransaction(
final String privacyGroupId, final String privacyGroupId,
final PrivacyNode adder, final PrivacyNode adder,
final Credentials signer, final Credentials signer,

@ -22,13 +22,13 @@ import org.hyperledger.besu.tests.acceptance.dsl.transaction.privacy.PrivacyRequ
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
public class CreateOnChainPrivacyGroupTransaction public class CreateOnchainPrivacyGroupTransaction
implements Transaction<PrivxCreatePrivacyGroupResponse> { implements Transaction<PrivxCreatePrivacyGroupResponse> {
private final PrivacyNode creator; private final PrivacyNode creator;
private final List<String> addresses; private final List<String> addresses;
private final String privateFrom; private final String privateFrom;
CreateOnChainPrivacyGroupTransaction( CreateOnchainPrivacyGroupTransaction(
final PrivacyNode creator, final String privateFrom, final List<String> addresses) { final PrivacyNode creator, final String privateFrom, final List<String> addresses) {
this.creator = creator; this.creator = creator;
this.addresses = addresses; this.addresses = addresses;

@ -27,19 +27,19 @@ import java.util.stream.Collectors;
import org.web3j.utils.Base64String; import org.web3j.utils.Base64String;
public class FindOnChainPrivacyGroupTransaction public class FindOnchainPrivacyGroupTransaction
implements Transaction<List<PrivacyRequestFactory.OnChainPrivacyGroup>> { implements Transaction<List<PrivacyRequestFactory.OnchainPrivacyGroup>> {
private final List<Base64String> nodes; private final List<Base64String> nodes;
public FindOnChainPrivacyGroupTransaction(final List<String> nodeEnclaveKeys) { public FindOnchainPrivacyGroupTransaction(final List<String> nodeEnclaveKeys) {
this.nodes = nodeEnclaveKeys.stream().map(Base64String::wrap).collect(Collectors.toList()); this.nodes = nodeEnclaveKeys.stream().map(Base64String::wrap).collect(Collectors.toList());
} }
@Override @Override
public List<PrivacyRequestFactory.OnChainPrivacyGroup> execute(final NodeRequests node) { public List<PrivacyRequestFactory.OnchainPrivacyGroup> execute(final NodeRequests node) {
try { try {
PrivxFindPrivacyGroupResponse result = PrivxFindPrivacyGroupResponse result =
node.privacy().privxFindOnChainPrivacyGroup(nodes).send(); node.privacy().privxFindOnchainPrivacyGroup(nodes).send();
assertThat(result).isNotNull(); assertThat(result).isNotNull();
if (result.hasError()) { if (result.hasError()) {
throw new RuntimeException(result.getError().getMessage()); throw new RuntimeException(result.getError().getMessage());

@ -24,12 +24,12 @@ import org.web3j.crypto.Credentials;
import org.web3j.protocol.exceptions.TransactionException; import org.web3j.protocol.exceptions.TransactionException;
import org.web3j.utils.Base64String; import org.web3j.utils.Base64String;
public class LockOnChainPrivacyGroupTransaction implements Transaction<String> { public class LockOnchainPrivacyGroupTransaction implements Transaction<String> {
private final Base64String privacyGroupId; private final Base64String privacyGroupId;
private final PrivacyNode locker; private final PrivacyNode locker;
private final Credentials signer; private final Credentials signer;
public LockOnChainPrivacyGroupTransaction( public LockOnchainPrivacyGroupTransaction(
final String privacyGroupId, final PrivacyNode locker, final Credentials signer) { final String privacyGroupId, final PrivacyNode locker, final Credentials signer) {
this.privacyGroupId = Base64String.wrap(privacyGroupId); this.privacyGroupId = Base64String.wrap(privacyGroupId);
this.locker = locker; this.locker = locker;

@ -51,44 +51,44 @@ public class PrivacyTransactions {
return new RestrictedCreatePrivacyGroupTransaction(name, description, nodes); return new RestrictedCreatePrivacyGroupTransaction(name, description, nodes);
} }
public CreateOnChainPrivacyGroupTransaction createOnChainPrivacyGroup( public CreateOnchainPrivacyGroupTransaction createOnchainPrivacyGroup(
final PrivacyNode creator, final PrivacyNode creator,
final String privateFrom, final String privateFrom,
final List<String> addresses, final List<String> addresses,
final String token) { final String token) {
creator.getBesu().useAuthenticationTokenInHeaderForJsonRpc(token); creator.getBesu().useAuthenticationTokenInHeaderForJsonRpc(token);
return new CreateOnChainPrivacyGroupTransaction(creator, privateFrom, addresses); return new CreateOnchainPrivacyGroupTransaction(creator, privateFrom, addresses);
} }
public CreateOnChainPrivacyGroupTransaction createOnChainPrivacyGroup( public CreateOnchainPrivacyGroupTransaction createOnchainPrivacyGroup(
final PrivacyNode creator, final String privateFrom, final List<String> addresses) { final PrivacyNode creator, final String privateFrom, final List<String> addresses) {
return new CreateOnChainPrivacyGroupTransaction(creator, privateFrom, addresses); return new CreateOnchainPrivacyGroupTransaction(creator, privateFrom, addresses);
} }
public AddToOnChainPrivacyGroupTransaction addToPrivacyGroup( public AddToOnchainPrivacyGroupTransaction addToPrivacyGroup(
final String privacyGroupId, final String privacyGroupId,
final PrivacyNode adder, final PrivacyNode adder,
final Credentials signer, final Credentials signer,
final PrivacyNode... nodes) { final PrivacyNode... nodes) {
return new AddToOnChainPrivacyGroupTransaction(privacyGroupId, adder, signer, nodes); return new AddToOnchainPrivacyGroupTransaction(privacyGroupId, adder, signer, nodes);
} }
public LockOnChainPrivacyGroupTransaction privxLockPrivacyGroupAndCheck( public LockOnchainPrivacyGroupTransaction privxLockPrivacyGroupAndCheck(
final String privacyGroupId, final PrivacyNode locker, final Credentials signer) { final String privacyGroupId, final PrivacyNode locker, final Credentials signer) {
return new LockOnChainPrivacyGroupTransaction(privacyGroupId, locker, signer); return new LockOnchainPrivacyGroupTransaction(privacyGroupId, locker, signer);
} }
public UnlockOnChainPrivacyGroupTransaction privxUnlockPrivacyGroupAndCheck( public UnlockOnchainPrivacyGroupTransaction privxUnlockPrivacyGroupAndCheck(
final String privacyGroupId, final PrivacyNode locker, final Credentials signer) { final String privacyGroupId, final PrivacyNode locker, final Credentials signer) {
return new UnlockOnChainPrivacyGroupTransaction(privacyGroupId, locker, signer); return new UnlockOnchainPrivacyGroupTransaction(privacyGroupId, locker, signer);
} }
public FindPrivacyGroupTransaction findPrivacyGroup(final List<String> nodes) { public FindPrivacyGroupTransaction findPrivacyGroup(final List<String> nodes) {
return new FindPrivacyGroupTransaction(nodes); return new FindPrivacyGroupTransaction(nodes);
} }
public FindOnChainPrivacyGroupTransaction findOnChainPrivacyGroup(final List<String> nodes) { public FindOnchainPrivacyGroupTransaction findOnchainPrivacyGroup(final List<String> nodes) {
return new FindOnChainPrivacyGroupTransaction(nodes); return new FindOnchainPrivacyGroupTransaction(nodes);
} }
public PrivDistributeTransactionTransaction privDistributeTransaction( public PrivDistributeTransactionTransaction privDistributeTransaction(
@ -115,12 +115,12 @@ public class PrivacyTransactions {
return new PrivGetLogsTransaction(privacyGroupId, filterParameter); return new PrivGetLogsTransaction(privacyGroupId, filterParameter);
} }
public RemoveFromOnChainPrivacyGroupTransaction removeFromPrivacyGroup( public RemoveFromOnchainPrivacyGroupTransaction removeFromPrivacyGroup(
final String privacyGroupId, final String privacyGroupId,
final String remover, final String remover,
final Credentials signer, final Credentials signer,
final String memberToRemove) { final String memberToRemove) {
return new RemoveFromOnChainPrivacyGroupTransaction( return new RemoveFromOnchainPrivacyGroupTransaction(
privacyGroupId, remover, signer, memberToRemove); privacyGroupId, remover, signer, memberToRemove);
} }

@ -22,13 +22,13 @@ import java.io.IOException;
import org.web3j.crypto.Credentials; import org.web3j.crypto.Credentials;
import org.web3j.utils.Base64String; import org.web3j.utils.Base64String;
public class RemoveFromOnChainPrivacyGroupTransaction implements Transaction<String> { public class RemoveFromOnchainPrivacyGroupTransaction implements Transaction<String> {
private final Base64String privacyGroupId; private final Base64String privacyGroupId;
private final String remover; private final String remover;
private final String toRemove; private final String toRemove;
private final Credentials signer; private final Credentials signer;
public RemoveFromOnChainPrivacyGroupTransaction( public RemoveFromOnchainPrivacyGroupTransaction(
final String privacyGroupId, final String privacyGroupId,
final String remover, final String remover,
final Credentials signer, final Credentials signer,

@ -24,12 +24,12 @@ import org.web3j.crypto.Credentials;
import org.web3j.protocol.exceptions.TransactionException; import org.web3j.protocol.exceptions.TransactionException;
import org.web3j.utils.Base64String; import org.web3j.utils.Base64String;
public class UnlockOnChainPrivacyGroupTransaction implements Transaction<String> { public class UnlockOnchainPrivacyGroupTransaction implements Transaction<String> {
private final Base64String privacyGroupId; private final Base64String privacyGroupId;
private final PrivacyNode locker; private final PrivacyNode locker;
private final Credentials signer; private final Credentials signer;
public UnlockOnChainPrivacyGroupTransaction( public UnlockOnchainPrivacyGroupTransaction(
final String privacyGroupId, final PrivacyNode locker, final Credentials signer) { final String privacyGroupId, final PrivacyNode locker, final Credentials signer) {
this.privacyGroupId = Base64String.wrap(privacyGroupId); this.privacyGroupId = Base64String.wrap(privacyGroupId);
this.locker = locker; this.locker = locker;

@ -24,7 +24,7 @@ import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.enclave.types.PrivacyGroup; import org.hyperledger.besu.enclave.types.PrivacyGroup;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.parameters.CreatePrivacyGroupParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.parameters.CreatePrivacyGroupParameter;
import org.hyperledger.besu.ethereum.privacy.group.OnChainGroupManagement; import org.hyperledger.besu.ethereum.privacy.group.OnchainGroupManagement;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode; import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivateTransactionGroupResponse; import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivateTransactionGroupResponse;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.util.LogFilterJsonParameter; import org.hyperledger.besu.tests.acceptance.dsl.privacy.util.LogFilterJsonParameter;
@ -232,7 +232,7 @@ public class PrivacyRequestFactory {
} }
private Bytes encodeRemoveFromGroupFunctionCall(final Bytes toRemove) { private Bytes encodeRemoveFromGroupFunctionCall(final Bytes toRemove) {
return Bytes.concatenate(OnChainGroupManagement.REMOVE_PARTICIPANT_METHOD_SIGNATURE, toRemove); return Bytes.concatenate(OnchainGroupManagement.REMOVE_PARTICIPANT_METHOD_SIGNATURE, toRemove);
} }
public String privxLockPrivacyGroup( public String privxLockPrivacyGroup(
@ -242,7 +242,7 @@ public class PrivacyRequestFactory {
locker, locker,
privacyGroupId, privacyGroupId,
signer, signer,
OnChainGroupManagement.LOCK_GROUP_METHOD_SIGNATURE.toHexString()); OnchainGroupManagement.LOCK_GROUP_METHOD_SIGNATURE.toHexString());
} }
public String privxUnlockPrivacyGroup( public String privxUnlockPrivacyGroup(
@ -252,7 +252,7 @@ public class PrivacyRequestFactory {
locker, locker,
privacyGroupId, privacyGroupId,
signer, signer,
OnChainGroupManagement.UNLOCK_GROUP_METHOD_SIGNATURE.toHexString()); OnchainGroupManagement.UNLOCK_GROUP_METHOD_SIGNATURE.toHexString());
} }
private String privxLockOrUnlockPrivacyGroup( private String privxLockOrUnlockPrivacyGroup(
@ -327,7 +327,7 @@ public class PrivacyRequestFactory {
return new PrivxCreatePrivacyGroupResponse(privacyGroupId.toBase64String(), transactionHash); return new PrivxCreatePrivacyGroupResponse(privacyGroupId.toBase64String(), transactionHash);
} }
public Request<?, PrivxFindPrivacyGroupResponse> privxFindOnChainPrivacyGroup( public Request<?, PrivxFindPrivacyGroupResponse> privxFindOnchainPrivacyGroup(
final List<Base64String> nodes) { final List<Base64String> nodes) {
return new Request<>( return new Request<>(
"privx_findOnChainPrivacyGroup", "privx_findOnChainPrivacyGroup",
@ -487,14 +487,14 @@ public class PrivacyRequestFactory {
DebugGetStateRoot.class); DebugGetStateRoot.class);
} }
public static class PrivxFindPrivacyGroupResponse extends Response<List<OnChainPrivacyGroup>> { public static class PrivxFindPrivacyGroupResponse extends Response<List<OnchainPrivacyGroup>> {
public List<OnChainPrivacyGroup> getGroups() { public List<OnchainPrivacyGroup> getGroups() {
return getResult(); return getResult();
} }
} }
public static class OnChainPrivacyGroup { public static class OnchainPrivacyGroup {
private final Base64String privacyGroupId; private final Base64String privacyGroupId;
private final List<Base64String> members; private final List<Base64String> members;
@ -506,7 +506,7 @@ public class PrivacyRequestFactory {
} }
@JsonCreator @JsonCreator
public OnChainPrivacyGroup( public OnchainPrivacyGroup(
@JsonProperty(value = "privacyGroupId") final String privacyGroupId, @JsonProperty(value = "privacyGroupId") final String privacyGroupId,
@JsonProperty(value = "type") final Type type, @JsonProperty(value = "type") final Type type,
@JsonProperty(value = "name") final String name, @JsonProperty(value = "name") final String name,
@ -515,7 +515,7 @@ public class PrivacyRequestFactory {
this(privacyGroupId, members); this(privacyGroupId, members);
} }
public OnChainPrivacyGroup(final String privacyGroupId, final List<Base64String> members) { public OnchainPrivacyGroup(final String privacyGroupId, final List<Base64String> members) {
this.privacyGroupId = Base64String.wrap(privacyGroupId); this.privacyGroupId = Base64String.wrap(privacyGroupId);
this.name = ""; this.name = "";
this.description = ""; this.description = "";
@ -550,7 +550,7 @@ public class PrivacyRequestFactory {
if (o == null || getClass() != o.getClass()) { if (o == null || getClass() != o.getClass()) {
return false; return false;
} }
final OnChainPrivacyGroup that = (OnChainPrivacyGroup) o; final OnchainPrivacyGroup that = (OnchainPrivacyGroup) o;
return getPrivacyGroupId().equals(that.getPrivacyGroupId()) return getPrivacyGroupId().equals(that.getPrivacyGroupId())
&& getName().equals(that.getName()) && getName().equals(that.getName())
&& getDescription().equals(that.getDescription()) && getDescription().equals(that.getDescription())
@ -589,7 +589,7 @@ public class PrivacyRequestFactory {
private Bytes encodeAddToGroupFunctionCall(final List<Bytes> participants) { private Bytes encodeAddToGroupFunctionCall(final List<Bytes> participants) {
return Bytes.concatenate( return Bytes.concatenate(
OnChainGroupManagement.ADD_PARTICIPANTS_METHOD_SIGNATURE, encodeList(participants)); OnchainGroupManagement.ADD_PARTICIPANTS_METHOD_SIGNATURE, encodeList(participants));
} }
private Bytes encodeList(final List<Bytes> participants) { private Bytes encodeList(final List<Bytes> participants) {

@ -24,7 +24,7 @@ import java.util.Arrays;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
public class AccountLocalAndOnChainPermissioningAcceptanceTest public class AccountLocalAndOnchainPermissioningAcceptanceTest
extends AccountSmartContractPermissioningAcceptanceTestBase { extends AccountSmartContractPermissioningAcceptanceTestBase {
private Account senderC; private Account senderC;
@ -36,7 +36,7 @@ public class AccountLocalAndOnChainPermissioningAcceptanceTest
@Test @Test
public void testAccountCannotSendTxWhenNotOnLocalAllowList() { public void testAccountCannotSendTxWhenNotOnLocalAllowList() {
// OnChain allowlist: Primary, Secondary, C // Onchain allowlist: Primary, Secondary, C
// Local allowlist: Primary, Secondary // Local allowlist: Primary, Secondary
final Node node = final Node node =
@ -51,7 +51,7 @@ public class AccountLocalAndOnChainPermissioningAcceptanceTest
node.execute(accountTransactions.createTransfer(senderC, 10)); node.execute(accountTransactions.createTransfer(senderC, 10));
node.verify(senderC.balanceEquals(10)); node.verify(senderC.balanceEquals(10));
// add accounts to onChain allowlist // add accounts to onchain allowlist
node.execute(allowAccount(accounts.getPrimaryBenefactor())); node.execute(allowAccount(accounts.getPrimaryBenefactor()));
node.verify(accountIsAllowed(accounts.getPrimaryBenefactor())); node.verify(accountIsAllowed(accounts.getPrimaryBenefactor()));
@ -66,8 +66,8 @@ public class AccountLocalAndOnChainPermissioningAcceptanceTest
} }
@Test @Test
public void testAccountCannotSendTxWhenNotOnOnChainAllowList() { public void testAccountCannotSendTxWhenNotOnOnchainAllowList() {
// OnChain allowlist: Primary, Secondary, Receiver // Onchain allowlist: Primary, Secondary, Receiver
// Local allowlist: Primary, Secondary, C, Receiver // Local allowlist: Primary, Secondary, C, Receiver
final Account receiverAccount = accounts.createAccount("Rec-A"); final Account receiverAccount = accounts.createAccount("Rec-A");
@ -86,7 +86,7 @@ public class AccountLocalAndOnChainPermissioningAcceptanceTest
node.execute(accountTransactions.createTransfer(senderC, 10)); node.execute(accountTransactions.createTransfer(senderC, 10));
node.verify(senderC.balanceEquals(10)); node.verify(senderC.balanceEquals(10));
// add accounts to onChain allowlist // add accounts to onchain allowlist
node.execute(allowAccount(accounts.getPrimaryBenefactor())); node.execute(allowAccount(accounts.getPrimaryBenefactor()));
node.verify(accountIsAllowed(accounts.getPrimaryBenefactor())); node.verify(accountIsAllowed(accounts.getPrimaryBenefactor()));
@ -96,7 +96,7 @@ public class AccountLocalAndOnChainPermissioningAcceptanceTest
node.execute(allowAccount(receiverAccount)); node.execute(allowAccount(receiverAccount));
node.verify(accountIsAllowed(receiverAccount)); node.verify(accountIsAllowed(receiverAccount));
// verify senderC is forbidden because it is not on OnChain allowlist // verify senderC is forbidden because it is not on Onchain allowlist
node.verify(accountIsForbidden(senderC)); node.verify(accountIsForbidden(senderC));
// sender C should not be able to send Tx // sender C should not be able to send Tx

@ -19,7 +19,7 @@ import org.hyperledger.besu.tests.acceptance.dsl.node.Node;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
public class NodeLocalAndOnChainPermissioningAcceptanceTest public class NodeLocalAndOnchainPermissioningAcceptanceTest
extends NodeSmartContractPermissioningAcceptanceTestBase { extends NodeSmartContractPermissioningAcceptanceTestBase {
private Node bootnode; private Node bootnode;
@ -37,13 +37,13 @@ public class NodeLocalAndOnChainPermissioningAcceptanceTest
} }
@Test @Test
public void testNodeCannotConnectWhenAllowedOnChainButNotLocally() { public void testNodeCannotConnectWhenAllowedOnchainButNotLocally() {
// add permissioned node after cluster start because we need enode URI for local config // add permissioned node after cluster start because we need enode URI for local config
permissionedNode = permissionedNode("permissioned-node", bootnode, allowedNode); permissionedNode = permissionedNode("permissioned-node", bootnode, allowedNode);
permissionedCluster.addNode(permissionedNode); permissionedCluster.addNode(permissionedNode);
// update OnChain smart contract with allowed nodes // update Onchain smart contract with allowed nodes
permissionedNode.execute(allowNode(bootnode)); permissionedNode.execute(allowNode(bootnode));
permissionedNode.verify(nodeIsAllowed(bootnode)); permissionedNode.verify(nodeIsAllowed(bootnode));
@ -60,7 +60,7 @@ public class NodeLocalAndOnChainPermissioningAcceptanceTest
} }
@Test @Test
public void testNodeCannotConnectWhenAllowedLocallyButNotOnChain() { public void testNodeCannotConnectWhenAllowedLocallyButNotOnchain() {
// onchain allowlist: A, B // onchain allowlist: A, B
// local allowlist: A, B, C // local allowlist: A, B, C
@ -68,7 +68,7 @@ public class NodeLocalAndOnChainPermissioningAcceptanceTest
permissionedNode = permissionedNode("permissioned-node", bootnode, allowedNode, forbiddenNode); permissionedNode = permissionedNode("permissioned-node", bootnode, allowedNode, forbiddenNode);
permissionedCluster.addNode(permissionedNode); permissionedCluster.addNode(permissionedNode);
// update OnChain smart contract with allowed nodes // update Onchain smart contract with allowed nodes
permissionedNode.execute(allowNode(bootnode)); permissionedNode.execute(allowNode(bootnode));
permissionedNode.verify(nodeIsAllowed(bootnode)); permissionedNode.verify(nodeIsAllowed(bootnode));
@ -82,12 +82,12 @@ public class NodeLocalAndOnChainPermissioningAcceptanceTest
} }
@Test @Test
public void testNodesCanConnectWhenAllowedBothOnChainAndLocally() { public void testNodesCanConnectWhenAllowedBothOnchainAndLocally() {
// add permissioned node after cluster start because we need enode URI for local config // add permissioned node after cluster start because we need enode URI for local config
permissionedNode = permissionedNode("permissioned-node", bootnode, allowedNode, forbiddenNode); permissionedNode = permissionedNode("permissioned-node", bootnode, allowedNode, forbiddenNode);
permissionedCluster.addNode(permissionedNode); permissionedCluster.addNode(permissionedNode);
// update OnChain smart contract with allowed nodes // update Onchain smart contract with allowed nodes
permissionedNode.execute(allowNode(bootnode)); permissionedNode.execute(allowNode(bootnode));
permissionedNode.verify(nodeIsAllowed(bootnode)); permissionedNode.verify(nodeIsAllowed(bootnode));

@ -80,7 +80,7 @@ public class NodeSmartContractPermissioningAcceptanceTest
} }
@Test @Test
public void onChainPermissioningAllowlistShouldPersistAcrossRestarts() { public void onchainPermissioningAllowlistShouldPersistAcrossRestarts() {
permissionedCluster.stop(); permissionedCluster.stop();
permissionedCluster.start(bootnode, forbiddenNode, allowedNode, permissionedNode); permissionedCluster.start(bootnode, forbiddenNode, allowedNode, permissionedNode);

@ -97,7 +97,7 @@ public class NodeSmartContractPermissioningV2AcceptanceTest
} }
@Test @Test
public void onChainPermissioningAllowlistShouldPersistAcrossRestarts() { public void onchainPermissioningAllowlistShouldPersistAcrossRestarts() {
permissionedCluster.stop(); permissionedCluster.stop();
permissionedCluster.start(bootnode, forbiddenNode, allowedNode, permissionedNode); permissionedCluster.start(bootnode, forbiddenNode, allowedNode, permissionedNode);

@ -21,7 +21,7 @@ import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.account.PrivacyAccountResolver; import org.hyperledger.besu.tests.acceptance.dsl.privacy.account.PrivacyAccountResolver;
import org.hyperledger.besu.tests.acceptance.dsl.transaction.privacy.PrivacyRequestFactory; import org.hyperledger.besu.tests.acceptance.dsl.transaction.privacy.PrivacyRequestFactory;
import org.hyperledger.besu.tests.web3j.generated.EventEmitter; import org.hyperledger.besu.tests.web3j.generated.EventEmitter;
import org.hyperledger.besu.tests.web3j.privacy.OnChainPrivacyAcceptanceTestBase; import org.hyperledger.besu.tests.web3j.privacy.OnchainPrivacyAcceptanceTestBase;
import org.hyperledger.enclave.testutil.EnclaveType; import org.hyperledger.enclave.testutil.EnclaveType;
import java.io.IOException; import java.io.IOException;
@ -42,7 +42,7 @@ import org.testcontainers.containers.Network;
@RunWith(Parameterized.class) @RunWith(Parameterized.class)
public class PrivDebugGetStateRootOnchainGroupAcceptanceTest public class PrivDebugGetStateRootOnchainGroupAcceptanceTest
extends OnChainPrivacyAcceptanceTestBase { extends OnchainPrivacyAcceptanceTestBase {
private final EnclaveType enclaveType; private final EnclaveType enclaveType;
@ -65,14 +65,14 @@ public class PrivDebugGetStateRootOnchainGroupAcceptanceTest
final Network containerNetwork = Network.newNetwork(); final Network containerNetwork = Network.newNetwork();
aliceNode = aliceNode =
privacyBesu.createOnChainPrivacyGroupEnabledMinerNode( privacyBesu.createOnchainPrivacyGroupEnabledMinerNode(
"alice-node", "alice-node",
PrivacyAccountResolver.ALICE, PrivacyAccountResolver.ALICE,
false, false,
enclaveType, enclaveType,
Optional.of(containerNetwork)); Optional.of(containerNetwork));
bobNode = bobNode =
privacyBesu.createOnChainPrivacyGroupEnabledNode( privacyBesu.createOnchainPrivacyGroupEnabledNode(
"bob-node", "bob-node",
PrivacyAccountResolver.BOB, PrivacyAccountResolver.BOB,
false, false,
@ -84,7 +84,7 @@ public class PrivDebugGetStateRootOnchainGroupAcceptanceTest
@Test @Test
public void nodesInGroupShouldHaveSameStateRoot() { public void nodesInGroupShouldHaveSameStateRoot() {
final String privacyGroupId = createOnChainPrivacyGroup(aliceNode, bobNode); final String privacyGroupId = createOnchainPrivacyGroup(aliceNode, bobNode);
final Hash aliceStateRootId = final Hash aliceStateRootId =
aliceNode aliceNode
@ -117,7 +117,7 @@ public class PrivDebugGetStateRootOnchainGroupAcceptanceTest
waitForBlockHeight(aliceNode, 2); waitForBlockHeight(aliceNode, 2);
waitForBlockHeight(bobNode, 2); waitForBlockHeight(bobNode, 2);
final String privacyGroupId = createOnChainPrivacyGroup(aliceNode, bobNode); final String privacyGroupId = createOnchainPrivacyGroup(aliceNode, bobNode);
waitForBlockHeight(aliceNode, 10); waitForBlockHeight(aliceNode, 10);
waitForBlockHeight(bobNode, 10); waitForBlockHeight(bobNode, 10);
@ -145,7 +145,7 @@ public class PrivDebugGetStateRootOnchainGroupAcceptanceTest
@Test @Test
public void canInteractWithPrivateGenesisPreCompile() throws Exception { public void canInteractWithPrivateGenesisPreCompile() throws Exception {
final String privacyGroupId = createOnChainPrivacyGroup(aliceNode, bobNode); final String privacyGroupId = createOnchainPrivacyGroup(aliceNode, bobNode);
final EventEmitter eventEmitter = final EventEmitter eventEmitter =
aliceNode.execute( aliceNode.execute(

@ -22,12 +22,12 @@ import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode; import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.account.PrivacyAccountResolver; import org.hyperledger.besu.tests.acceptance.dsl.privacy.account.PrivacyAccountResolver;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.contract.CallPrivateSmartContractFunction; import org.hyperledger.besu.tests.acceptance.dsl.privacy.contract.CallPrivateSmartContractFunction;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.transaction.CreateOnChainPrivacyGroupTransaction; import org.hyperledger.besu.tests.acceptance.dsl.privacy.transaction.CreateOnchainPrivacyGroupTransaction;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.util.LogFilterJsonParameter; import org.hyperledger.besu.tests.acceptance.dsl.privacy.util.LogFilterJsonParameter;
import org.hyperledger.besu.tests.acceptance.dsl.transaction.perm.PermissioningTransactions; import org.hyperledger.besu.tests.acceptance.dsl.transaction.perm.PermissioningTransactions;
import org.hyperledger.besu.tests.acceptance.dsl.transaction.privacy.PrivacyRequestFactory; import org.hyperledger.besu.tests.acceptance.dsl.transaction.privacy.PrivacyRequestFactory;
import org.hyperledger.besu.tests.web3j.generated.EventEmitter; import org.hyperledger.besu.tests.web3j.generated.EventEmitter;
import org.hyperledger.besu.tests.web3j.privacy.OnChainPrivacyAcceptanceTestBase; import org.hyperledger.besu.tests.web3j.privacy.OnchainPrivacyAcceptanceTestBase;
import org.hyperledger.enclave.testutil.EnclaveType; import org.hyperledger.enclave.testutil.EnclaveType;
import java.math.BigInteger; import java.math.BigInteger;
@ -50,11 +50,11 @@ import org.web3j.utils.Base64String;
import org.web3j.utils.Restriction; import org.web3j.utils.Restriction;
@RunWith(Parameterized.class) @RunWith(Parameterized.class)
public class OnChainMultiTenancyAcceptanceTest extends OnChainPrivacyAcceptanceTestBase { public class OnchainMultiTenancyAcceptanceTest extends OnchainPrivacyAcceptanceTestBase {
private final EnclaveType enclaveType; private final EnclaveType enclaveType;
public OnChainMultiTenancyAcceptanceTest(final EnclaveType enclaveType) { public OnchainMultiTenancyAcceptanceTest(final EnclaveType enclaveType) {
this.enclaveType = enclaveType; this.enclaveType = enclaveType;
} }
@ -78,7 +78,7 @@ public class OnChainMultiTenancyAcceptanceTest extends OnChainPrivacyAcceptanceT
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
alice = alice =
privacyBesu.createOnChainPrivacyGroupEnabledMinerNode( privacyBesu.createOnchainPrivacyGroupEnabledMinerNode(
"node1", PrivacyAccountResolver.MULTI_TENANCY, true, enclaveType, Optional.empty()); "node1", PrivacyAccountResolver.MULTI_TENANCY, true, enclaveType, Optional.empty());
final BesuNode aliceBesu = alice.getBesu(); final BesuNode aliceBesu = alice.getBesu();
privacyCluster.startNodes(alice); privacyCluster.startNodes(alice);
@ -109,7 +109,7 @@ public class OnChainMultiTenancyAcceptanceTest extends OnChainPrivacyAcceptanceT
@Test @Test
public void createPrivacyGroup() { public void createPrivacyGroup() {
createOnChainPrivacyGroup(alice); createOnchainPrivacyGroup(alice);
} }
@Test @Test
@ -117,7 +117,7 @@ public class OnChainMultiTenancyAcceptanceTest extends OnChainPrivacyAcceptanceT
final MultiTenancyPrivacyGroup privacyGroup = new MultiTenancyPrivacyGroup(); final MultiTenancyPrivacyGroup privacyGroup = new MultiTenancyPrivacyGroup();
privacyGroup.addNodeWithTenants( privacyGroup.addNodeWithTenants(
aliceMultiTenancyPrivacyNode, aliceMultiTenancyPrivacyNode.getTenants()); aliceMultiTenancyPrivacyNode, aliceMultiTenancyPrivacyNode.getTenants());
createOnChainPrivacyGroup(privacyGroup); createOnchainPrivacyGroup(privacyGroup);
} }
@Test @Test
@ -126,7 +126,7 @@ public class OnChainMultiTenancyAcceptanceTest extends OnChainPrivacyAcceptanceT
final List<String> tenants = aliceMultiTenancyPrivacyNode.getTenants(); final List<String> tenants = aliceMultiTenancyPrivacyNode.getTenants();
final String removedTenant = tenants.remove(tenants.size() - 1); final String removedTenant = tenants.remove(tenants.size() - 1);
twoTenantsFromAlice.addNodeWithTenants(aliceMultiTenancyPrivacyNode, tenants); twoTenantsFromAlice.addNodeWithTenants(aliceMultiTenancyPrivacyNode, tenants);
final String privacyGroupId = createOnChainPrivacyGroup(twoTenantsFromAlice); final String privacyGroupId = createOnchainPrivacyGroup(twoTenantsFromAlice);
final MultiTenancyPrivacyNode multiTenancyPrivacyNode = final MultiTenancyPrivacyNode multiTenancyPrivacyNode =
twoTenantsFromAlice.getPrivacyNodes().get(0); twoTenantsFromAlice.getPrivacyNodes().get(0);
@ -256,9 +256,9 @@ public class OnChainMultiTenancyAcceptanceTest extends OnChainPrivacyAcceptanceT
.getBesu() .getBesu()
.useAuthenticationTokenInHeaderForJsonRpc( .useAuthenticationTokenInHeaderForJsonRpc(
multiTenancyPrivacyNode.getTokenForTenant(tenant)); multiTenancyPrivacyNode.getTokenForTenant(tenant));
final List<PrivacyRequestFactory.OnChainPrivacyGroup> group = final List<PrivacyRequestFactory.OnchainPrivacyGroup> group =
privacyNode.execute( privacyNode.execute(
privacyTransactions.findOnChainPrivacyGroup(Base64String.unwrapList(base64StringList))); privacyTransactions.findOnchainPrivacyGroup(Base64String.unwrapList(base64StringList)));
assertThat(group.size()).isEqualTo(1); assertThat(group.size()).isEqualTo(1);
assertThat(group.get(0).getMembers()).containsAll(base64StringList).hasSize(2); assertThat(group.get(0).getMembers()).containsAll(base64StringList).hasSize(2);
@ -270,7 +270,7 @@ public class OnChainMultiTenancyAcceptanceTest extends OnChainPrivacyAcceptanceT
assertThatThrownBy( assertThatThrownBy(
() -> () ->
privacyNode.execute( privacyNode.execute(
privacyTransactions.findOnChainPrivacyGroup( privacyTransactions.findOnchainPrivacyGroup(
Base64String.unwrapList(base64StringList)))) Base64String.unwrapList(base64StringList))))
.hasMessageContaining("Error finding onchain privacy group"); .hasMessageContaining("Error finding onchain privacy group");
@ -324,7 +324,7 @@ public class OnChainMultiTenancyAcceptanceTest extends OnChainPrivacyAcceptanceT
final MultiTenancyPrivacyGroup allTenantsFromAlice = new MultiTenancyPrivacyGroup(); final MultiTenancyPrivacyGroup allTenantsFromAlice = new MultiTenancyPrivacyGroup();
final List<String> tenants = aliceMultiTenancyPrivacyNode.getTenants(); final List<String> tenants = aliceMultiTenancyPrivacyNode.getTenants();
allTenantsFromAlice.addNodeWithTenants(aliceMultiTenancyPrivacyNode, tenants); allTenantsFromAlice.addNodeWithTenants(aliceMultiTenancyPrivacyNode, tenants);
final String privacyGroupId = createOnChainPrivacyGroup(allTenantsFromAlice); final String privacyGroupId = createOnchainPrivacyGroup(allTenantsFromAlice);
final MultiTenancyPrivacyNode multiTenancyPrivacyNode = final MultiTenancyPrivacyNode multiTenancyPrivacyNode =
allTenantsFromAlice.getPrivacyNodes().get(0); allTenantsFromAlice.getPrivacyNodes().get(0);
final String groupCreatingTenant = allTenantsFromAlice.getGroupCreatingTenant(); final String groupCreatingTenant = allTenantsFromAlice.getGroupCreatingTenant();
@ -413,7 +413,7 @@ public class OnChainMultiTenancyAcceptanceTest extends OnChainPrivacyAcceptanceT
.hasMessageContaining("Unauthorized"); .hasMessageContaining("Unauthorized");
} }
private String createOnChainPrivacyGroup(final MultiTenancyPrivacyGroup group) { private String createOnchainPrivacyGroup(final MultiTenancyPrivacyGroup group) {
final List<MultiTenancyPrivacyNode> multiTenancyPrivacyNodes = group.getPrivacyNodes(); final List<MultiTenancyPrivacyNode> multiTenancyPrivacyNodes = group.getPrivacyNodes();
final MultiTenancyPrivacyNode groupCreatorMultiTenancyPrivacyNode = final MultiTenancyPrivacyNode groupCreatorMultiTenancyPrivacyNode =
multiTenancyPrivacyNodes.get(0); multiTenancyPrivacyNodes.get(0);
@ -421,8 +421,8 @@ public class OnChainMultiTenancyAcceptanceTest extends OnChainPrivacyAcceptanceT
final String groupCreatorTenant = group.getGroupCreatingTenant(); final String groupCreatorTenant = group.getGroupCreatingTenant();
final List<String> members = group.getTenants(); final List<String> members = group.getTenants();
final String token = groupCreatorMultiTenancyPrivacyNode.getTokenForTenant(groupCreatorTenant); final String token = groupCreatorMultiTenancyPrivacyNode.getTokenForTenant(groupCreatorTenant);
final CreateOnChainPrivacyGroupTransaction createTx = final CreateOnchainPrivacyGroupTransaction createTx =
privacyTransactions.createOnChainPrivacyGroup( privacyTransactions.createOnchainPrivacyGroup(
groupCreatorNode, groupCreatorTenant, members, token); groupCreatorNode, groupCreatorTenant, members, token);
final PrivacyRequestFactory.PrivxCreatePrivacyGroupResponse createResponse = final PrivacyRequestFactory.PrivxCreatePrivacyGroupResponse createResponse =
@ -438,7 +438,7 @@ public class OnChainMultiTenancyAcceptanceTest extends OnChainPrivacyAcceptanceT
privacyNode privacyNode
.getBesu() .getBesu()
.useAuthenticationTokenInHeaderForJsonRpc(mtpn.getTokenForTenant(tenant)); .useAuthenticationTokenInHeaderForJsonRpc(mtpn.getTokenForTenant(tenant));
privacyNode.verify(onChainPrivacyGroupExists(privacyGroupId, base64StringList)); privacyNode.verify(onchainPrivacyGroupExists(privacyGroupId, base64StringList));
} }
} }
} }

@ -49,11 +49,11 @@ import org.web3j.protocol.core.methods.response.TransactionReceipt;
import org.web3j.tx.Contract; import org.web3j.tx.Contract;
@RunWith(Parameterized.class) @RunWith(Parameterized.class)
public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBase { public class OnchainPrivacyAcceptanceTest extends OnchainPrivacyAcceptanceTestBase {
private final EnclaveType enclaveType; private final EnclaveType enclaveType;
public OnChainPrivacyAcceptanceTest(final EnclaveType enclaveType) { public OnchainPrivacyAcceptanceTest(final EnclaveType enclaveType) {
this.enclaveType = enclaveType; this.enclaveType = enclaveType;
} }
@ -81,21 +81,21 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
final Network containerNetwork = Network.newNetwork(); final Network containerNetwork = Network.newNetwork();
alice = alice =
privacyBesu.createOnChainPrivacyGroupEnabledMinerNode( privacyBesu.createOnchainPrivacyGroupEnabledMinerNode(
"node1", "node1",
privacyAccountResolver.resolve(0), privacyAccountResolver.resolve(0),
false, false,
enclaveType, enclaveType,
Optional.of(containerNetwork)); Optional.of(containerNetwork));
bob = bob =
privacyBesu.createOnChainPrivacyGroupEnabledNode( privacyBesu.createOnchainPrivacyGroupEnabledNode(
"node2", "node2",
privacyAccountResolver.resolve(1), privacyAccountResolver.resolve(1),
false, false,
enclaveType, enclaveType,
Optional.of(containerNetwork)); Optional.of(containerNetwork));
charlie = charlie =
privacyBesu.createOnChainPrivacyGroupEnabledNode( privacyBesu.createOnchainPrivacyGroupEnabledNode(
"node3", "node3",
privacyAccountResolver.resolve(2), privacyAccountResolver.resolve(2),
false, false,
@ -106,13 +106,13 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
@Test @Test
public void nodeCanCreatePrivacyGroup() { public void nodeCanCreatePrivacyGroup() {
final String privacyGroupId = createOnChainPrivacyGroup(alice); final String privacyGroupId = createOnchainPrivacyGroup(alice);
checkOnChainPrivacyGroupExists(privacyGroupId, alice); checkOnchainPrivacyGroupExists(privacyGroupId, alice);
} }
@Test @Test
public void deployingMustGiveValidReceipt() { public void deployingMustGiveValidReceipt() {
final String privacyGroupId = createOnChainPrivacyGroup(alice, bob); final String privacyGroupId = createOnchainPrivacyGroup(alice, bob);
final Contract eventEmitter = deployPrivateContract(EventEmitter.class, privacyGroupId, alice); final Contract eventEmitter = deployPrivateContract(EventEmitter.class, privacyGroupId, alice);
final String commitmentHash = getContractDeploymentCommitmentHash(eventEmitter); final String commitmentHash = getContractDeploymentCommitmentHash(eventEmitter);
@ -122,7 +122,7 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
@Test @Test
public void canAddParticipantToGroup() { public void canAddParticipantToGroup() {
final String privacyGroupId = createOnChainPrivacyGroup(alice, bob); final String privacyGroupId = createOnchainPrivacyGroup(alice, bob);
final Contract eventEmitter = deployPrivateContract(EventEmitter.class, privacyGroupId, alice); final Contract eventEmitter = deployPrivateContract(EventEmitter.class, privacyGroupId, alice);
final String commitmentHash = getContractDeploymentCommitmentHash(eventEmitter); final String commitmentHash = getContractDeploymentCommitmentHash(eventEmitter);
@ -131,14 +131,14 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
final Credentials aliceCredentials = Credentials.create(alice.getTransactionSigningKey()); final Credentials aliceCredentials = Credentials.create(alice.getTransactionSigningKey());
lockPrivacyGroup(privacyGroupId, alice, aliceCredentials); lockPrivacyGroup(privacyGroupId, alice, aliceCredentials);
addMembersToPrivacyGroup(privacyGroupId, alice, aliceCredentials, charlie); addMembersToPrivacyGroup(privacyGroupId, alice, aliceCredentials, charlie);
checkOnChainPrivacyGroupExists(privacyGroupId, alice, bob, charlie); checkOnchainPrivacyGroupExists(privacyGroupId, alice, bob, charlie);
charlie.verify(privateTransactionVerifier.existingPrivateTransactionReceipt(commitmentHash)); charlie.verify(privateTransactionVerifier.existingPrivateTransactionReceipt(commitmentHash));
} }
@Test @Test
public void removedMemberCannotSendTransactionToGroup() { public void removedMemberCannotSendTransactionToGroup() {
final String privacyGroupId = createOnChainPrivacyGroup(alice, bob); final String privacyGroupId = createOnchainPrivacyGroup(alice, bob);
final String removeHash = final String removeHash =
removeFromPrivacyGroup( removeFromPrivacyGroup(
@ -153,7 +153,7 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
@Test @Test
public void canInteractWithPrivateGenesisPreCompile() throws Exception { public void canInteractWithPrivateGenesisPreCompile() throws Exception {
final String privacyGroupId = createOnChainPrivacyGroup(alice, bob); final String privacyGroupId = createOnchainPrivacyGroup(alice, bob);
final EventEmitter eventEmitter = final EventEmitter eventEmitter =
alice.execute( alice.execute(
@ -198,15 +198,15 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
@Test @Test
public void memberCanBeAddedAfterBeingRemoved() { public void memberCanBeAddedAfterBeingRemoved() {
final String privacyGroupId = createOnChainPrivacyGroup(alice); final String privacyGroupId = createOnchainPrivacyGroup(alice);
checkOnChainPrivacyGroupExists(privacyGroupId, alice); checkOnchainPrivacyGroupExists(privacyGroupId, alice);
lockPrivacyGroup(privacyGroupId, alice, Credentials.create(alice.getTransactionSigningKey())); lockPrivacyGroup(privacyGroupId, alice, Credentials.create(alice.getTransactionSigningKey()));
addMembersToPrivacyGroup( addMembersToPrivacyGroup(
privacyGroupId, alice, Credentials.create(alice.getTransactionSigningKey()), bob); privacyGroupId, alice, Credentials.create(alice.getTransactionSigningKey()), bob);
checkOnChainPrivacyGroupExists(privacyGroupId, alice, bob); checkOnchainPrivacyGroupExists(privacyGroupId, alice, bob);
final EventEmitter eventEmitter = final EventEmitter eventEmitter =
deployPrivateContract(EventEmitter.class, privacyGroupId, alice); deployPrivateContract(EventEmitter.class, privacyGroupId, alice);
@ -222,7 +222,7 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
removeFromPrivacyGroup( removeFromPrivacyGroup(
privacyGroupId, alice, Credentials.create(alice.getTransactionSigningKey()), bob); privacyGroupId, alice, Credentials.create(alice.getTransactionSigningKey()), bob);
checkOnChainPrivacyGroupExists(privacyGroupId, alice); checkOnchainPrivacyGroupExists(privacyGroupId, alice);
final int valueSetWhileBobWas_NOT_aMember = 1337; final int valueSetWhileBobWas_NOT_aMember = 1337;
final PrivateTransactionReceipt receiptWhileBobRemoved = final PrivateTransactionReceipt receiptWhileBobRemoved =
@ -241,7 +241,7 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
addMembersToPrivacyGroup( addMembersToPrivacyGroup(
privacyGroupId, alice, Credentials.create(alice.getTransactionSigningKey()), bob); privacyGroupId, alice, Credentials.create(alice.getTransactionSigningKey()), bob);
checkOnChainPrivacyGroupExists(privacyGroupId, alice, bob); checkOnchainPrivacyGroupExists(privacyGroupId, alice, bob);
checkEmitterValue( checkEmitterValue(
Lists.newArrayList(alice, bob), Lists.newArrayList(alice, bob),
@ -282,7 +282,7 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
final PrivacyNode firstNode = nodes.get(0); final PrivacyNode firstNode = nodes.get(0);
final String txHash = final String txHash =
firstNode.execute( firstNode.execute(
privateContractTransactions.callOnChainPermissioningSmartContract( privateContractTransactions.callOnchainPermissioningSmartContract(
eventEmitter.getContractAddress(), eventEmitter.getContractAddress(),
eventEmitter.store(BigInteger.valueOf(value)).encodeFunctionCall(), eventEmitter.store(BigInteger.valueOf(value)).encodeFunctionCall(),
firstNode.getTransactionSigningKey(), firstNode.getTransactionSigningKey(),
@ -314,8 +314,8 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
@Test @Test
public void bobCanAddCharlieAfterBeingAddedByAlice() { public void bobCanAddCharlieAfterBeingAddedByAlice() {
final String privacyGroupId = createOnChainPrivacyGroup(alice); final String privacyGroupId = createOnchainPrivacyGroup(alice);
checkOnChainPrivacyGroupExists(privacyGroupId, alice); checkOnchainPrivacyGroupExists(privacyGroupId, alice);
final EventEmitter eventEmitter = final EventEmitter eventEmitter =
alice.execute( alice.execute(
privateContractTransactions.createSmartContractWithPrivacyGroupId( privateContractTransactions.createSmartContractWithPrivacyGroupId(
@ -338,7 +338,7 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
alice.execute( alice.execute(
privacyTransactions.addToPrivacyGroup(privacyGroupId, alice, aliceCredentials, bob)); privacyTransactions.addToPrivacyGroup(privacyGroupId, alice, aliceCredentials, bob));
checkOnChainPrivacyGroupExists(privacyGroupId, alice, bob); checkOnchainPrivacyGroupExists(privacyGroupId, alice, bob);
bob.execute( bob.execute(
privacyTransactions.privxLockPrivacyGroupAndCheck(privacyGroupId, bob, aliceCredentials)); privacyTransactions.privxLockPrivacyGroupAndCheck(privacyGroupId, bob, aliceCredentials));
@ -352,7 +352,7 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
final String callHash = final String callHash =
alice.execute( alice.execute(
privateContractTransactions.callOnChainPermissioningSmartContract( privateContractTransactions.callOnchainPermissioningSmartContract(
eventEmitter.getContractAddress(), eventEmitter.getContractAddress(),
eventEmitter.value().encodeFunctionCall(), eventEmitter.value().encodeFunctionCall(),
alice.getTransactionSigningKey(), alice.getTransactionSigningKey(),
@ -372,7 +372,7 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
alice.getBesu().verify(ethConditions.miningStatus(true)); alice.getBesu().verify(ethConditions.miningStatus(true));
checkOnChainPrivacyGroupExists(privacyGroupId, alice, bob, charlie); checkOnchainPrivacyGroupExists(privacyGroupId, alice, bob, charlie);
final Optional<TransactionReceipt> aliceAddReceipt = final Optional<TransactionReceipt> aliceAddReceipt =
alice.execute(ethTransactions.getTransactionReceipt(bobAddHash)); alice.execute(ethTransactions.getTransactionReceipt(bobAddHash));
@ -428,7 +428,7 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
final String aliceStoreHash = final String aliceStoreHash =
charlie.execute( charlie.execute(
privateContractTransactions.callOnChainPermissioningSmartContract( privateContractTransactions.callOnchainPermissioningSmartContract(
eventEmitter.getContractAddress(), eventEmitter.getContractAddress(),
eventEmitter.store(BigInteger.valueOf(1337)).encodeFunctionCall(), eventEmitter.store(BigInteger.valueOf(1337)).encodeFunctionCall(),
charlie.getTransactionSigningKey(), charlie.getTransactionSigningKey(),
@ -475,13 +475,13 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
removeFromPrivacyGroup(privacyGroupId, bob, aliceCredentials, charlie); removeFromPrivacyGroup(privacyGroupId, bob, aliceCredentials, charlie);
checkOnChainPrivacyGroupExists(privacyGroupId, alice, bob); checkOnchainPrivacyGroupExists(privacyGroupId, alice, bob);
} }
@Test @Test
public void canOnlyCallProxyContractWhenGroupLocked() { public void canOnlyCallProxyContractWhenGroupLocked() {
final String privacyGroupId = createOnChainPrivacyGroup(alice); final String privacyGroupId = createOnchainPrivacyGroup(alice);
checkOnChainPrivacyGroupExists(privacyGroupId, alice); checkOnchainPrivacyGroupExists(privacyGroupId, alice);
final EventEmitter eventEmitter = final EventEmitter eventEmitter =
alice.execute( alice.execute(
@ -501,7 +501,7 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
final Supplier<String> callContract = final Supplier<String> callContract =
() -> { () -> {
return alice.execute( return alice.execute(
privateContractTransactions.callOnChainPermissioningSmartContract( privateContractTransactions.callOnchainPermissioningSmartContract(
eventEmitter.getContractAddress(), eventEmitter.getContractAddress(),
eventEmitter.value().encodeFunctionCall(), eventEmitter.value().encodeFunctionCall(),
alice.getTransactionSigningKey(), alice.getTransactionSigningKey(),
@ -545,10 +545,10 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
@Test @Test
public void addMembersToTwoGroupsInTheSameBlock() { public void addMembersToTwoGroupsInTheSameBlock() {
final String privacyGroupId1 = createOnChainPrivacyGroup(alice); final String privacyGroupId1 = createOnchainPrivacyGroup(alice);
final String privacyGroupId2 = createOnChainPrivacyGroup(bob); final String privacyGroupId2 = createOnchainPrivacyGroup(bob);
checkOnChainPrivacyGroupExists(privacyGroupId1, alice); checkOnchainPrivacyGroupExists(privacyGroupId1, alice);
checkOnChainPrivacyGroupExists(privacyGroupId2, bob); checkOnchainPrivacyGroupExists(privacyGroupId2, bob);
lockPrivacyGroup(privacyGroupId1, alice, Credentials.create(alice.getTransactionSigningKey())); lockPrivacyGroup(privacyGroupId1, alice, Credentials.create(alice.getTransactionSigningKey()));
lockPrivacyGroup(privacyGroupId2, bob, Credentials.create(bob.getTransactionSigningKey())); lockPrivacyGroup(privacyGroupId2, bob, Credentials.create(bob.getTransactionSigningKey()));
@ -574,8 +574,8 @@ public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBa
alice.execute(minerTransactions.minerStart()); alice.execute(minerTransactions.minerStart());
checkOnChainPrivacyGroupExists(privacyGroupId1, alice, charlie); checkOnchainPrivacyGroupExists(privacyGroupId1, alice, charlie);
checkOnChainPrivacyGroupExists(privacyGroupId2, bob, alice); checkOnchainPrivacyGroupExists(privacyGroupId2, bob, alice);
} }
private <T extends Contract> T deployPrivateContract( private <T extends Contract> T deployPrivateContract(

@ -16,13 +16,13 @@ package org.hyperledger.besu.tests.web3j.privacy;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.hyperledger.besu.ethereum.core.PrivacyParameters.ONCHAIN_PRIVACY_PROXY; import static org.hyperledger.besu.ethereum.core.PrivacyParameters.ONCHAIN_PRIVACY_PROXY;
import static org.hyperledger.besu.ethereum.privacy.group.OnChainGroupManagement.GET_PARTICIPANTS_METHOD_SIGNATURE; import static org.hyperledger.besu.ethereum.privacy.group.OnchainGroupManagement.GET_PARTICIPANTS_METHOD_SIGNATURE;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.Quantity; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.Quantity;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyAcceptanceTestBase; import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyAcceptanceTestBase;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode; import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.condition.ExpectValidOnChainPrivacyGroupCreated; import org.hyperledger.besu.tests.acceptance.dsl.privacy.condition.ExpectValidOnchainPrivacyGroupCreated;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.transaction.CreateOnChainPrivacyGroupTransaction; import org.hyperledger.besu.tests.acceptance.dsl.privacy.transaction.CreateOnchainPrivacyGroupTransaction;
import org.hyperledger.besu.tests.acceptance.dsl.transaction.privacy.PrivacyRequestFactory; import org.hyperledger.besu.tests.acceptance.dsl.transaction.privacy.PrivacyRequestFactory;
import java.util.Arrays; import java.util.Arrays;
@ -37,12 +37,12 @@ import org.web3j.protocol.core.methods.response.TransactionReceipt;
import org.web3j.tx.Contract; import org.web3j.tx.Contract;
import org.web3j.utils.Base64String; import org.web3j.utils.Base64String;
public class OnChainPrivacyAcceptanceTestBase extends PrivacyAcceptanceTestBase { public class OnchainPrivacyAcceptanceTestBase extends PrivacyAcceptanceTestBase {
protected String createOnChainPrivacyGroup(final PrivacyNode... members) { protected String createOnchainPrivacyGroup(final PrivacyNode... members) {
final List<String> addresses = final List<String> addresses =
Arrays.stream(members).map(PrivacyNode::getEnclaveKey).collect(Collectors.toList()); Arrays.stream(members).map(PrivacyNode::getEnclaveKey).collect(Collectors.toList());
return createOnChainPrivacyGroup(members[0].getEnclaveKey(), addresses, members); return createOnchainPrivacyGroup(members[0].getEnclaveKey(), addresses, members);
} }
/** /**
@ -55,13 +55,13 @@ public class OnChainPrivacyAcceptanceTestBase extends PrivacyAcceptanceTestBase
* the creator of the group. * the creator of the group.
* @return the id of the privacy group * @return the id of the privacy group
*/ */
protected String createOnChainPrivacyGroup( protected String createOnchainPrivacyGroup(
final String privateFrom, final List<String> addresses, final PrivacyNode... members) { final String privateFrom, final List<String> addresses, final PrivacyNode... members) {
final PrivacyNode groupCreator = members[0]; final PrivacyNode groupCreator = members[0];
final CreateOnChainPrivacyGroupTransaction createTx = final CreateOnchainPrivacyGroupTransaction createTx =
privacyTransactions.createOnChainPrivacyGroup(groupCreator, privateFrom, addresses); privacyTransactions.createOnchainPrivacyGroup(groupCreator, privateFrom, addresses);
final PrivacyRequestFactory.PrivxCreatePrivacyGroupResponse createResponse = final PrivacyRequestFactory.PrivxCreatePrivacyGroupResponse createResponse =
groupCreator.execute(createTx); groupCreator.execute(createTx);
@ -73,7 +73,7 @@ public class OnChainPrivacyAcceptanceTestBase extends PrivacyAcceptanceTestBase
.collect(Collectors.toList()); .collect(Collectors.toList());
for (final PrivacyNode member : members) { for (final PrivacyNode member : members) {
member.verify(onChainPrivacyGroupExists(privacyGroupId, membersEnclaveKeys)); member.verify(onchainPrivacyGroupExists(privacyGroupId, membersEnclaveKeys));
} }
final String commitmentHash = final String commitmentHash =
@ -94,7 +94,7 @@ public class OnChainPrivacyAcceptanceTestBase extends PrivacyAcceptanceTestBase
protected String callGetParticipantsMethodAndReturnCommitmentHash( protected String callGetParticipantsMethodAndReturnCommitmentHash(
final String privacyGroupId, final PrivacyNode groupCreator, final String privateFrom) { final String privacyGroupId, final PrivacyNode groupCreator, final String privateFrom) {
return groupCreator.execute( return groupCreator.execute(
privateContractTransactions.callOnChainPermissioningSmartContract( privateContractTransactions.callOnchainPermissioningSmartContract(
ONCHAIN_PRIVACY_PROXY.toHexString(), ONCHAIN_PRIVACY_PROXY.toHexString(),
GET_PARTICIPANTS_METHOD_SIGNATURE.toString(), GET_PARTICIPANTS_METHOD_SIGNATURE.toString(),
groupCreator.getTransactionSigningKey(), groupCreator.getTransactionSigningKey(),
@ -140,9 +140,9 @@ public class OnChainPrivacyAcceptanceTestBase extends PrivacyAcceptanceTestBase
null); null);
} }
protected ExpectValidOnChainPrivacyGroupCreated onChainPrivacyGroupExists( protected ExpectValidOnchainPrivacyGroupCreated onchainPrivacyGroupExists(
final String privacyGroupId, final List<Base64String> members) { final String privacyGroupId, final List<Base64String> members) {
return privateTransactionVerifier.onChainPrivacyGroupExists(privacyGroupId, members); return privateTransactionVerifier.onchainPrivacyGroupExists(privacyGroupId, members);
} }
protected String getContractDeploymentCommitmentHash(final Contract contract) { protected String getContractDeploymentCommitmentHash(final Contract contract) {
@ -161,7 +161,7 @@ public class OnChainPrivacyAcceptanceTestBase extends PrivacyAcceptanceTestBase
* @param privacyGroupId the id of the privacy group * @param privacyGroupId the id of the privacy group
* @param members the list of member in the privacy group * @param members the list of member in the privacy group
*/ */
protected void checkOnChainPrivacyGroupExists( protected void checkOnchainPrivacyGroupExists(
final String privacyGroupId, final PrivacyNode... members) { final String privacyGroupId, final PrivacyNode... members) {
final List<Base64String> membersEnclaveKeys = final List<Base64String> membersEnclaveKeys =
Arrays.stream(members) Arrays.stream(members)
@ -170,7 +170,7 @@ public class OnChainPrivacyAcceptanceTestBase extends PrivacyAcceptanceTestBase
.collect(Collectors.toList()); .collect(Collectors.toList());
for (final PrivacyNode member : members) { for (final PrivacyNode member : members) {
member.verify(onChainPrivacyGroupExists(privacyGroupId, membersEnclaveKeys)); member.verify(onchainPrivacyGroupExists(privacyGroupId, membersEnclaveKeys));
} }
} }
} }

@ -16,7 +16,7 @@ package org.hyperledger.besu.tests.web3j.privacy.contracts;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import org.hyperledger.besu.privacy.contracts.generated.DefaultOnChainPrivacyGroupManagementContract; import org.hyperledger.besu.privacy.contracts.generated.DefaultOnchainPrivacyGroupManagementContract;
import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBase; import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBase;
import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode; import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode;
@ -40,7 +40,7 @@ public class PrivacyGroupTest extends AcceptanceTestBase {
Base64String.wrap("Ko2bVqD+nNlNYL5EE7y3IdOnviftjiizpjRt+HTuFBs="); Base64String.wrap("Ko2bVqD+nNlNYL5EE7y3IdOnviftjiizpjRt+HTuFBs=");
private final Base64String thirdParticipant = private final Base64String thirdParticipant =
Base64String.wrap("Jo2bVqD+nNlNYL5EE7y3IdOnviftjiizpjRt+HTuFBs="); Base64String.wrap("Jo2bVqD+nNlNYL5EE7y3IdOnviftjiizpjRt+HTuFBs=");
private DefaultOnChainPrivacyGroupManagementContract defaultPrivacyGroupManagementContract; private DefaultOnchainPrivacyGroupManagementContract defaultPrivacyGroupManagementContract;
private static final String RAW_FIRST_PARTICIPANT = "0x5aa68ac0"; private static final String RAW_FIRST_PARTICIPANT = "0x5aa68ac0";
private static final String RAW_ADD_PARTICIPANT = private static final String RAW_ADD_PARTICIPANT =
@ -61,7 +61,7 @@ public class PrivacyGroupTest extends AcceptanceTestBase {
defaultPrivacyGroupManagementContract = defaultPrivacyGroupManagementContract =
minerNode.execute( minerNode.execute(
contractTransactions.createSmartContract( contractTransactions.createSmartContract(
DefaultOnChainPrivacyGroupManagementContract.class)); DefaultOnchainPrivacyGroupManagementContract.class));
} }
@Test @Test

@ -17,8 +17,8 @@ package org.hyperledger.besu.tests.web3j.privacy.contracts;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.assertj.core.api.Assertions.assertThatThrownBy;
import org.hyperledger.besu.privacy.contracts.generated.DefaultOnChainPrivacyGroupManagementContract; import org.hyperledger.besu.privacy.contracts.generated.DefaultOnchainPrivacyGroupManagementContract;
import org.hyperledger.besu.privacy.contracts.generated.OnChainPrivacyGroupManagementProxy; import org.hyperledger.besu.privacy.contracts.generated.OnchainPrivacyGroupManagementProxy;
import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBase; import org.hyperledger.besu.tests.acceptance.dsl.AcceptanceTestBase;
import org.hyperledger.besu.tests.acceptance.dsl.account.Accounts; import org.hyperledger.besu.tests.acceptance.dsl.account.Accounts;
import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode; import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode;
@ -45,58 +45,58 @@ public class PrivacyProxyTest extends AcceptanceTestBase {
Base64String.wrap("9iaJ6OObl6TUWYjXAOyZsL0VaDPwF+tRFkMwwYSeqqw="); Base64String.wrap("9iaJ6OObl6TUWYjXAOyZsL0VaDPwF+tRFkMwwYSeqqw=");
private final Base64String thirdParticipant = private final Base64String thirdParticipant =
Base64String.wrap("Jo2bVqD+nNlNYL5EE7y3IdOnviftjiizpjRt+HTuFBs="); Base64String.wrap("Jo2bVqD+nNlNYL5EE7y3IdOnviftjiizpjRt+HTuFBs=");
private OnChainPrivacyGroupManagementProxy onChainPrivacyGroupManagementProxy; private OnchainPrivacyGroupManagementProxy onchainPrivacyGroupManagementProxy;
private static final String RAW_GET_PARTICIPANTS = "0x5aa68ac0"; private static final String RAW_GET_PARTICIPANTS = "0x5aa68ac0";
private static final String RAW_ADD_PARTICIPANT = private static final String RAW_ADD_PARTICIPANT =
"0xb4926e2500000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001f772b2ee55f016431cefe724a05814324bb96e9afdb73e338665a693d4653678"; "0xb4926e2500000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001f772b2ee55f016431cefe724a05814324bb96e9afdb73e338665a693d4653678";
private BesuNode minerNode; private BesuNode minerNode;
private DefaultOnChainPrivacyGroupManagementContract defaultOnChainPrivacyGroupManagementContract; private DefaultOnchainPrivacyGroupManagementContract defaultOnchainPrivacyGroupManagementContract;
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
minerNode = besu.createMinerNode("node"); minerNode = besu.createMinerNode("node");
cluster.start(minerNode); cluster.start(minerNode);
defaultOnChainPrivacyGroupManagementContract = defaultOnchainPrivacyGroupManagementContract =
minerNode.execute( minerNode.execute(
contractTransactions.createSmartContract( contractTransactions.createSmartContract(
DefaultOnChainPrivacyGroupManagementContract.class)); DefaultOnchainPrivacyGroupManagementContract.class));
onChainPrivacyGroupManagementProxy = onchainPrivacyGroupManagementProxy =
minerNode.execute( minerNode.execute(
contractTransactions.createSmartContract( contractTransactions.createSmartContract(
OnChainPrivacyGroupManagementProxy.class, OnchainPrivacyGroupManagementProxy.class,
defaultOnChainPrivacyGroupManagementContract.getContractAddress())); defaultOnchainPrivacyGroupManagementContract.getContractAddress()));
} }
@Test @Test
public void rlp() throws Exception { public void rlp() throws Exception {
assertThat(onChainPrivacyGroupManagementProxy.isValid()).isEqualTo(true); assertThat(onchainPrivacyGroupManagementProxy.isValid()).isEqualTo(true);
contractVerifier contractVerifier
.validTransactionReceipt(onChainPrivacyGroupManagementProxy.getContractAddress()) .validTransactionReceipt(onchainPrivacyGroupManagementProxy.getContractAddress())
.verify(onChainPrivacyGroupManagementProxy); .verify(onchainPrivacyGroupManagementProxy);
assertThat(RAW_GET_PARTICIPANTS) assertThat(RAW_GET_PARTICIPANTS)
.isEqualTo(onChainPrivacyGroupManagementProxy.getParticipants().encodeFunctionCall()); .isEqualTo(onchainPrivacyGroupManagementProxy.getParticipants().encodeFunctionCall());
assertThat(RAW_ADD_PARTICIPANT) assertThat(RAW_ADD_PARTICIPANT)
.isEqualTo( .isEqualTo(
onChainPrivacyGroupManagementProxy onchainPrivacyGroupManagementProxy
.addParticipants(List.of(firstParticipant.raw())) .addParticipants(List.of(firstParticipant.raw()))
.encodeFunctionCall()); .encodeFunctionCall());
} }
@Test @Test
public void deploysWithNoParticipant() throws Exception { public void deploysWithNoParticipant() throws Exception {
final List<byte[]> participants = onChainPrivacyGroupManagementProxy.getParticipants().send(); final List<byte[]> participants = onchainPrivacyGroupManagementProxy.getParticipants().send();
assertThat(participants.size()).isEqualTo(0); assertThat(participants.size()).isEqualTo(0);
} }
@Test @Test
public void canAddParticipants() throws Exception { public void canAddParticipants() throws Exception {
onChainPrivacyGroupManagementProxy onchainPrivacyGroupManagementProxy
.addParticipants(Arrays.asList(firstParticipant.raw(), secondParticipant.raw())) .addParticipants(Arrays.asList(firstParticipant.raw(), secondParticipant.raw()))
.send(); .send();
final List<byte[]> participants = onChainPrivacyGroupManagementProxy.getParticipants().send(); final List<byte[]> participants = onchainPrivacyGroupManagementProxy.getParticipants().send();
assertThat(participants.size()).isEqualTo(2); assertThat(participants.size()).isEqualTo(2);
assertThat(firstParticipant.raw()).isEqualTo(participants.get(0)); assertThat(firstParticipant.raw()).isEqualTo(participants.get(0));
assertThat(secondParticipant.raw()).isEqualTo(participants.get(1)); assertThat(secondParticipant.raw()).isEqualTo(participants.get(1));
@ -104,18 +104,18 @@ public class PrivacyProxyTest extends AcceptanceTestBase {
@Test @Test
public void nonOwnerCannotUpgrade() throws Exception { public void nonOwnerCannotUpgrade() throws Exception {
onChainPrivacyGroupManagementProxy onchainPrivacyGroupManagementProxy
.addParticipants(Arrays.asList(firstParticipant.raw(), secondParticipant.raw())) .addParticipants(Arrays.asList(firstParticipant.raw(), secondParticipant.raw()))
.send(); .send();
final List<byte[]> participants = onChainPrivacyGroupManagementProxy.getParticipants().send(); final List<byte[]> participants = onchainPrivacyGroupManagementProxy.getParticipants().send();
assertThat(participants.size()).isEqualTo(2); assertThat(participants.size()).isEqualTo(2);
assertThat(firstParticipant.raw()).isEqualTo(participants.get(0)); assertThat(firstParticipant.raw()).isEqualTo(participants.get(0));
assertThat(secondParticipant.raw()).isEqualTo(participants.get(1)); assertThat(secondParticipant.raw()).isEqualTo(participants.get(1));
final DefaultOnChainPrivacyGroupManagementContract upgradedContract = final DefaultOnchainPrivacyGroupManagementContract upgradedContract =
minerNode.execute( minerNode.execute(
contractTransactions.createSmartContract( contractTransactions.createSmartContract(
DefaultOnChainPrivacyGroupManagementContract.class)); DefaultOnchainPrivacyGroupManagementContract.class));
final HttpService httpService = final HttpService httpService =
new HttpService( new HttpService(
@ -123,9 +123,9 @@ public class PrivacyProxyTest extends AcceptanceTestBase {
final Web3j web3j = Web3j.build(httpService); final Web3j web3j = Web3j.build(httpService);
// load the proxy contract, use it with another signer // load the proxy contract, use it with another signer
final OnChainPrivacyGroupManagementProxy proxyContractAccount2 = final OnchainPrivacyGroupManagementProxy proxyContractAccount2 =
OnChainPrivacyGroupManagementProxy.load( OnchainPrivacyGroupManagementProxy.load(
onChainPrivacyGroupManagementProxy.getContractAddress(), onchainPrivacyGroupManagementProxy.getContractAddress(),
web3j, web3j,
Credentials.create(Accounts.GENESIS_ACCOUNT_TWO_PRIVATE_KEY), Credentials.create(Accounts.GENESIS_ACCOUNT_TWO_PRIVATE_KEY),
new DefaultGasProvider()); new DefaultGasProvider());
@ -138,22 +138,22 @@ public class PrivacyProxyTest extends AcceptanceTestBase {
@Test @Test
public void ownerCanUpgrade() throws Exception { public void ownerCanUpgrade() throws Exception {
onChainPrivacyGroupManagementProxy onchainPrivacyGroupManagementProxy
.addParticipants(Arrays.asList(firstParticipant.raw(), secondParticipant.raw())) .addParticipants(Arrays.asList(firstParticipant.raw(), secondParticipant.raw()))
.send(); .send();
final List<byte[]> participants = onChainPrivacyGroupManagementProxy.getParticipants().send(); final List<byte[]> participants = onchainPrivacyGroupManagementProxy.getParticipants().send();
assertThat(participants.size()).isEqualTo(2); assertThat(participants.size()).isEqualTo(2);
assertThat(firstParticipant.raw()).isEqualTo(participants.get(0)); assertThat(firstParticipant.raw()).isEqualTo(participants.get(0));
assertThat(secondParticipant.raw()).isEqualTo(participants.get(1)); assertThat(secondParticipant.raw()).isEqualTo(participants.get(1));
final DefaultOnChainPrivacyGroupManagementContract upgradedContract = final DefaultOnchainPrivacyGroupManagementContract upgradedContract =
minerNode.execute( minerNode.execute(
contractTransactions.createSmartContract( contractTransactions.createSmartContract(
DefaultOnChainPrivacyGroupManagementContract.class)); DefaultOnchainPrivacyGroupManagementContract.class));
onChainPrivacyGroupManagementProxy.upgradeTo(upgradedContract.getContractAddress()).send(); onchainPrivacyGroupManagementProxy.upgradeTo(upgradedContract.getContractAddress()).send();
final List<byte[]> participantsAfterUpgrade = final List<byte[]> participantsAfterUpgrade =
onChainPrivacyGroupManagementProxy.getParticipants().send(); onchainPrivacyGroupManagementProxy.getParticipants().send();
assertThat(participantsAfterUpgrade.size()).isEqualTo(2); assertThat(participantsAfterUpgrade.size()).isEqualTo(2);
assertThat(firstParticipant.raw()).isEqualTo(participantsAfterUpgrade.get(0)); assertThat(firstParticipant.raw()).isEqualTo(participantsAfterUpgrade.get(0));
assertThat(secondParticipant.raw()).isEqualTo(participantsAfterUpgrade.get(1)); assertThat(secondParticipant.raw()).isEqualTo(participantsAfterUpgrade.get(1));
@ -161,14 +161,14 @@ public class PrivacyProxyTest extends AcceptanceTestBase {
@Test @Test
public void canAddTwiceToContractWhenCallLock() throws Exception { public void canAddTwiceToContractWhenCallLock() throws Exception {
onChainPrivacyGroupManagementProxy onchainPrivacyGroupManagementProxy
.addParticipants(Arrays.asList(firstParticipant.raw(), thirdParticipant.raw())) .addParticipants(Arrays.asList(firstParticipant.raw(), thirdParticipant.raw()))
.send(); .send();
onChainPrivacyGroupManagementProxy.lock().send(); onchainPrivacyGroupManagementProxy.lock().send();
onChainPrivacyGroupManagementProxy onchainPrivacyGroupManagementProxy
.addParticipants(Collections.singletonList(secondParticipant.raw())) .addParticipants(Collections.singletonList(secondParticipant.raw()))
.send(); .send();
final List<byte[]> participants = onChainPrivacyGroupManagementProxy.getParticipants().send(); final List<byte[]> participants = onchainPrivacyGroupManagementProxy.getParticipants().send();
assertThat(participants.size()).isEqualTo(3); assertThat(participants.size()).isEqualTo(3);
assertThat(firstParticipant.raw()).isEqualTo(participants.get(0)); assertThat(firstParticipant.raw()).isEqualTo(participants.get(0));
assertThat(thirdParticipant.raw()).isEqualTo(participants.get(1)); assertThat(thirdParticipant.raw()).isEqualTo(participants.get(1));

@ -61,7 +61,7 @@ import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.OnChainPrivacyPrecompiledContract; import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.OnchainPrivacyPrecompiledContract;
import org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration; import org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration;
import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration; import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration;
import org.hyperledger.besu.ethereum.p2p.config.RlpxConfiguration; import org.hyperledger.besu.ethereum.p2p.config.RlpxConfiguration;
@ -909,8 +909,8 @@ public class RunnerBuilder {
// register privateTransactionObserver as observer of events fired by the onchain precompile. // register privateTransactionObserver as observer of events fired by the onchain precompile.
if (privacyParameters.isOnchainPrivacyGroupsEnabled() if (privacyParameters.isOnchainPrivacyGroupsEnabled()
&& privacyParameters.isMultiTenancyEnabled()) { && privacyParameters.isMultiTenancyEnabled()) {
final OnChainPrivacyPrecompiledContract onchainPrivacyPrecompiledContract = final OnchainPrivacyPrecompiledContract onchainPrivacyPrecompiledContract =
(OnChainPrivacyPrecompiledContract) (OnchainPrivacyPrecompiledContract)
besuController besuController
.getProtocolSchedule() .getProtocolSchedule()
.getByBlockNumber(1) .getByBlockNumber(1)

@ -86,10 +86,10 @@ public class PrivacyTest {
final PrecompiledContract onchainPrecompiledContract = final PrecompiledContract onchainPrecompiledContract =
getPrecompile(besuController, ONCHAIN_PRIVACY); getPrecompile(besuController, ONCHAIN_PRIVACY);
assertThat(onchainPrecompiledContract.getName()).isEqualTo("OnChainPrivacy"); assertThat(onchainPrecompiledContract.getName()).isEqualTo("OnchainPrivacy");
} }
private BesuController setUpControllerWithPrivacyEnabled(final boolean onChainEnabled) private BesuController setUpControllerWithPrivacyEnabled(final boolean onchainEnabled)
throws IOException, URISyntaxException { throws IOException, URISyntaxException {
final Path dataDir = folder.newFolder().toPath(); final Path dataDir = folder.newFolder().toPath();
final Path dbDir = dataDir.resolve("database"); final Path dbDir = dataDir.resolve("database");
@ -99,7 +99,7 @@ public class PrivacyTest {
.setEnclaveUrl(new URI("http://127.0.0.1:8000")) .setEnclaveUrl(new URI("http://127.0.0.1:8000"))
.setStorageProvider(createKeyValueStorageProvider(dataDir, dbDir)) .setStorageProvider(createKeyValueStorageProvider(dataDir, dbDir))
.setEnclaveFactory(new EnclaveFactory(vertx)) .setEnclaveFactory(new EnclaveFactory(vertx))
.setOnchainPrivacyGroupsEnabled(onChainEnabled) .setOnchainPrivacyGroupsEnabled(onchainEnabled)
.build(); .build();
return new BesuController.Builder() return new BesuController.Builder()
.fromGenesisConfig(GenesisConfigFile.mainnet()) .fromGenesisConfig(GenesisConfigFile.mainnet())

@ -3416,7 +3416,7 @@ public class BesuCommandTest extends CommandTestAbstract {
} }
@Test @Test
public void onChainPrivacyGroupEnabledFlagDefaultValueIsFalse() { public void onchainPrivacyGroupEnabledFlagDefaultValueIsFalse() {
parseCommand( parseCommand(
"--privacy-enabled", "--privacy-enabled",
"--privacy-public-key-file", "--privacy-public-key-file",
@ -3438,7 +3438,7 @@ public class BesuCommandTest extends CommandTestAbstract {
} }
@Test @Test
public void onChainPrivacyGroupEnabledFlagValueIsSet() { public void onchainPrivacyGroupEnabledFlagValueIsSet() {
parseCommand( parseCommand(
"--privacy-enabled", "--privacy-enabled",
"--privacy-public-key-file", "--privacy-public-key-file",

@ -124,7 +124,7 @@ public abstract class BaseBftProtocolSchedule {
.blockImporterBuilder(MainnetBlockImporter::new) .blockImporterBuilder(MainnetBlockImporter::new)
.difficultyCalculator((time, parent, protocolContext) -> BigInteger.ONE) .difficultyCalculator((time, parent, protocolContext) -> BigInteger.ONE)
.skipZeroBlockRewards(true) .skipZeroBlockRewards(true)
.blockHeaderFunctions(BftBlockHeaderFunctions.forOnChainBlock(bftExtraDataCodec)); .blockHeaderFunctions(BftBlockHeaderFunctions.forOnchainBlock(bftExtraDataCodec));
blockReward.ifPresent(bigInteger -> builder.blockReward(Wei.of(bigInteger))); blockReward.ifPresent(bigInteger -> builder.blockReward(Wei.of(bigInteger)));

@ -69,7 +69,7 @@ public class BftBlockHashing {
* @param header The header for which a block hash is to be calculated * @param header The header for which a block hash is to be calculated
* @return the hash of the header to be used when referencing the header on the blockchain * @return the hash of the header to be used when referencing the header on the blockchain
*/ */
public Hash calculateHashOfBftBlockOnChain(final BlockHeader header) { public Hash calculateHashOfBftBlockOnchain(final BlockHeader header) {
final BftExtraData bftExtraData = bftExtraDataCodec.decode(header); final BftExtraData bftExtraData = bftExtraDataCodec.decode(header);
return Hash.hash( return Hash.hash(
serializeHeader( serializeHeader(
@ -102,7 +102,7 @@ public class BftBlockHashing {
// create a block header which is a copy of the header supplied as parameter except of the // create a block header which is a copy of the header supplied as parameter except of the
// extraData field // extraData field
final BlockHeaderBuilder builder = BlockHeaderBuilder.fromHeader(header); final BlockHeaderBuilder builder = BlockHeaderBuilder.fromHeader(header);
builder.blockHeaderFunctions(BftBlockHeaderFunctions.forOnChainBlock(bftExtraDataCodec)); builder.blockHeaderFunctions(BftBlockHeaderFunctions.forOnchainBlock(bftExtraDataCodec));
// set the extraData field using the supplied extraDataSerializer if the block height is not 0 // set the extraData field using the supplied extraDataSerializer if the block height is not 0
if (header.getNumber() == BlockHeader.GENESIS_BLOCK_NUMBER) { if (header.getNumber() == BlockHeader.GENESIS_BLOCK_NUMBER) {

@ -31,9 +31,9 @@ public class BftBlockHeaderFunctions implements BlockHeaderFunctions {
this.bftExtraDataCodec = bftExtraDataCodec; this.bftExtraDataCodec = bftExtraDataCodec;
} }
public static BlockHeaderFunctions forOnChainBlock(final BftExtraDataCodec bftExtraDataCodec) { public static BlockHeaderFunctions forOnchainBlock(final BftExtraDataCodec bftExtraDataCodec) {
return new BftBlockHeaderFunctions( return new BftBlockHeaderFunctions(
h -> new BftBlockHashing(bftExtraDataCodec).calculateHashOfBftBlockOnChain(h), h -> new BftBlockHashing(bftExtraDataCodec).calculateHashOfBftBlockOnchain(h),
bftExtraDataCodec); bftExtraDataCodec);
} }

@ -55,7 +55,7 @@ public class BftHelpers {
final BlockHeader sealedHeader = final BlockHeader sealedHeader =
BlockHeaderBuilder.fromHeader(initialHeader) BlockHeaderBuilder.fromHeader(initialHeader)
.extraData(bftExtraDataCodec.encode(sealedExtraData)) .extraData(bftExtraDataCodec.encode(sealedExtraData))
.blockHeaderFunctions(BftBlockHeaderFunctions.forOnChainBlock(bftExtraDataCodec)) .blockHeaderFunctions(BftBlockHeaderFunctions.forOnchainBlock(bftExtraDataCodec))
.buildBlockHeader(); .buildBlockHeader();
return new Block(sealedHeader, block.getBody()); return new Block(sealedHeader, block.getBody());

@ -71,7 +71,7 @@ public class BftQueryServiceImplTest {
final BlockHeaderTestFixture blockHeaderTestFixture = new BlockHeaderTestFixture(); final BlockHeaderTestFixture blockHeaderTestFixture = new BlockHeaderTestFixture();
blockHeaderTestFixture.number(1); // can't be genesis block (due to extradata serialisation) blockHeaderTestFixture.number(1); // can't be genesis block (due to extradata serialisation)
blockHeaderTestFixture.blockHeaderFunctions( blockHeaderTestFixture.blockHeaderFunctions(
BftBlockHeaderFunctions.forOnChainBlock(bftExtraDataCodec)); BftBlockHeaderFunctions.forOnchainBlock(bftExtraDataCodec));
blockHeader = blockHeaderTestFixture.buildHeader(); blockHeader = blockHeaderTestFixture.buildHeader();
} }

@ -190,7 +190,7 @@ public class TestContextBuilder {
final MutableBlockchain blockChain = final MutableBlockchain blockChain =
createInMemoryBlockchain( createInMemoryBlockchain(
genesisBlock, BftBlockHeaderFunctions.forOnChainBlock(IBFT_EXTRA_DATA_ENCODER)); genesisBlock, BftBlockHeaderFunctions.forOnchainBlock(IBFT_EXTRA_DATA_ENCODER));
// Use a stubbed version of the multicaster, to prevent creating PeerConnections etc. // Use a stubbed version of the multicaster, to prevent creating PeerConnections etc.
final StubValidatorMulticaster multicaster = new StubValidatorMulticaster(); final StubValidatorMulticaster multicaster = new StubValidatorMulticaster();

@ -60,8 +60,8 @@ public class BftBlockHashingTest {
private final Hash EXPECTED_HEADER_HASH = expectedHeaderHash(); private final Hash EXPECTED_HEADER_HASH = expectedHeaderHash();
@Test @Test
public void testCalculateHashOfIbft2BlockOnChain() { public void testCalculateHashOfIbft2BlockOnchain() {
Hash actualHeaderHash = bftBlockHashing.calculateHashOfBftBlockOnChain(headerToBeHashed); Hash actualHeaderHash = bftBlockHashing.calculateHashOfBftBlockOnchain(headerToBeHashed);
assertThat(actualHeaderHash).isEqualTo(EXPECTED_HEADER_HASH); assertThat(actualHeaderHash).isEqualTo(EXPECTED_HEADER_HASH);
} }
@ -142,7 +142,7 @@ public class BftBlockHashingTest {
builder.mixHash( builder.mixHash(
Hash.fromHexString("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365")); Hash.fromHexString("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365"));
builder.nonce(0); builder.nonce(0);
builder.blockHeaderFunctions(BftBlockHeaderFunctions.forOnChainBlock(new IbftExtraDataCodec())); builder.blockHeaderFunctions(BftBlockHeaderFunctions.forOnchainBlock(new IbftExtraDataCodec()));
return builder; return builder;
} }

@ -73,7 +73,7 @@ public class IbftBlockHashing {
* @param header The header for which a block hash is to be calculated * @param header The header for which a block hash is to be calculated
* @return the hash of the header including the validator and proposer seal in the extra data * @return the hash of the header including the validator and proposer seal in the extra data
*/ */
public static Hash calculateHashOfIbftBlockOnChain(final BlockHeader header) { public static Hash calculateHashOfIbftBlockOnchain(final BlockHeader header) {
final IbftExtraData ibftExtraData = IbftExtraData.decode(header); final IbftExtraData ibftExtraData = IbftExtraData.decode(header);
return Hash.hash(serializeHeaderWithoutCommittedSeals(header, ibftExtraData)); return Hash.hash(serializeHeaderWithoutCommittedSeals(header, ibftExtraData));
} }

@ -22,7 +22,7 @@ public class LegacyIbftBlockHeaderFunctions implements BlockHeaderFunctions {
@Override @Override
public Hash hash(final BlockHeader header) { public Hash hash(final BlockHeader header) {
return IbftBlockHashing.calculateHashOfIbftBlockOnChain(header); return IbftBlockHashing.calculateHashOfIbftBlockOnchain(header);
} }
@Override @Override

@ -259,7 +259,7 @@ public class TestContextBuilder {
blockChain = blockChain =
createInMemoryBlockchain( createInMemoryBlockchain(
genesisState.getBlock(), genesisState.getBlock(),
BftBlockHeaderFunctions.forOnChainBlock(BFT_EXTRA_DATA_ENCODER)); BftBlockHeaderFunctions.forOnchainBlock(BFT_EXTRA_DATA_ENCODER));
genesisState.writeStateTo(worldStateArchive.getMutable()); genesisState.writeStateTo(worldStateArchive.getMutable());
} catch (IOException e) { } catch (IOException e) {
throw new IllegalStateException(e); throw new IllegalStateException(e);
@ -268,7 +268,7 @@ public class TestContextBuilder {
final Block genesisBlock = createGenesisBlock(networkNodes.getValidatorAddresses()); final Block genesisBlock = createGenesisBlock(networkNodes.getValidatorAddresses());
blockChain = blockChain =
createInMemoryBlockchain( createInMemoryBlockchain(
genesisBlock, BftBlockHeaderFunctions.forOnChainBlock(BFT_EXTRA_DATA_ENCODER)); genesisBlock, BftBlockHeaderFunctions.forOnchainBlock(BFT_EXTRA_DATA_ENCODER));
} }
// Use a stubbed version of the multicaster, to prevent creating PeerConnections etc. // Use a stubbed version of the multicaster, to prevent creating PeerConnections etc.

@ -36,12 +36,12 @@ import java.util.Optional;
import io.vertx.ext.auth.User; import io.vertx.ext.auth.User;
import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.bytes.Bytes;
public class RestrictedOffChainEeaSendRawTransaction extends AbstractEeaSendRawTransaction { public class RestrictedOffchainEeaSendRawTransaction extends AbstractEeaSendRawTransaction {
final PrivacyController privacyController; final PrivacyController privacyController;
private final PrivacyIdProvider privacyIdProvider; private final PrivacyIdProvider privacyIdProvider;
public RestrictedOffChainEeaSendRawTransaction( public RestrictedOffchainEeaSendRawTransaction(
final TransactionPool transactionPool, final TransactionPool transactionPool,
final PrivacyIdProvider privacyIdProvider, final PrivacyIdProvider privacyIdProvider,
final PrivateMarkerTransactionFactory privateMarkerTransactionFactory, final PrivateMarkerTransactionFactory privateMarkerTransactionFactory,

@ -37,12 +37,12 @@ import io.vertx.ext.auth.User;
import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32; import org.apache.tuweni.bytes.Bytes32;
public class RestrictedOnChainEeaSendRawTransaction extends AbstractEeaSendRawTransaction { public class RestrictedOnchainEeaSendRawTransaction extends AbstractEeaSendRawTransaction {
private final PrivacyController privacyController; private final PrivacyController privacyController;
private final PrivacyIdProvider privacyIdProvider; private final PrivacyIdProvider privacyIdProvider;
public RestrictedOnChainEeaSendRawTransaction( public RestrictedOnchainEeaSendRawTransaction(
final TransactionPool transactionPool, final TransactionPool transactionPool,
final PrivacyIdProvider privacyIdProvider, final PrivacyIdProvider privacyIdProvider,
final PrivateMarkerTransactionFactory privateMarkerTransactionFactory, final PrivateMarkerTransactionFactory privateMarkerTransactionFactory,

@ -33,13 +33,13 @@ import java.util.List;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
public class PrivxFindOnChainPrivacyGroup implements JsonRpcMethod { public class PrivxFindOnchainPrivacyGroup implements JsonRpcMethod {
private static final Logger LOG = getLogger(); private static final Logger LOG = getLogger();
private final PrivacyController privacyController; private final PrivacyController privacyController;
private final PrivacyIdProvider privacyIdProvider; private final PrivacyIdProvider privacyIdProvider;
public PrivxFindOnChainPrivacyGroup( public PrivxFindOnchainPrivacyGroup(
final PrivacyController privacyController, final PrivacyIdProvider privacyIdProvider) { final PrivacyController privacyController, final PrivacyIdProvider privacyIdProvider) {
this.privacyController = privacyController; this.privacyController = privacyController;
this.privacyIdProvider = privacyIdProvider; this.privacyIdProvider = privacyIdProvider;
@ -61,7 +61,7 @@ public class PrivxFindOnChainPrivacyGroup implements JsonRpcMethod {
final List<PrivacyGroup> response; final List<PrivacyGroup> response;
try { try {
response = response =
privacyController.findOnChainPrivacyGroupByMembers( privacyController.findOnchainPrivacyGroupByMembers(
Arrays.asList(addresses), Arrays.asList(addresses),
privacyIdProvider.getPrivacyUserId(requestContext.getUser())); privacyIdProvider.getPrivacyUserId(requestContext.getUser()));
} catch (final MultiTenancyValidationException e) { } catch (final MultiTenancyValidationException e) {

@ -20,8 +20,8 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.RpcApis;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.PrivacyIdProvider; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.PrivacyIdProvider;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.eea.PluginEeaSendRawTransaction; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.eea.PluginEeaSendRawTransaction;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.eea.RestrictedOffChainEeaSendRawTransaction; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.eea.RestrictedOffchainEeaSendRawTransaction;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.eea.RestrictedOnChainEeaSendRawTransaction; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.eea.RestrictedOnchainEeaSendRawTransaction;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.priv.PrivGetEeaTransactionCount; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.priv.PrivGetEeaTransactionCount;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
@ -69,7 +69,7 @@ public class EeaJsonRpcMethods extends PrivacyApiGroupJsonRpcMethods {
new PrivGetEeaTransactionCount(privacyController, privacyIdProvider)); new PrivGetEeaTransactionCount(privacyController, privacyIdProvider));
} else if (getPrivacyParameters().isOnchainPrivacyGroupsEnabled()) { } else if (getPrivacyParameters().isOnchainPrivacyGroupsEnabled()) {
return mapOf( return mapOf(
new RestrictedOnChainEeaSendRawTransaction( new RestrictedOnchainEeaSendRawTransaction(
transactionPool, transactionPool,
privacyIdProvider, privacyIdProvider,
privateMarkerTransactionFactory, privateMarkerTransactionFactory,
@ -78,7 +78,7 @@ public class EeaJsonRpcMethods extends PrivacyApiGroupJsonRpcMethods {
new PrivGetEeaTransactionCount(privacyController, privacyIdProvider)); new PrivGetEeaTransactionCount(privacyController, privacyIdProvider));
} else { // off chain privacy } else { // off chain privacy
return mapOf( return mapOf(
new RestrictedOffChainEeaSendRawTransaction( new RestrictedOffchainEeaSendRawTransaction(
transactionPool, transactionPool,
privacyIdProvider, privacyIdProvider,
privateMarkerTransactionFactory, privateMarkerTransactionFactory,

@ -18,7 +18,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.RpcApi;
import org.hyperledger.besu.ethereum.api.jsonrpc.RpcApis; import org.hyperledger.besu.ethereum.api.jsonrpc.RpcApis;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.PrivacyIdProvider; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.PrivacyIdProvider;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.privx.PrivxFindOnChainPrivacyGroup; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.privx.PrivxFindOnchainPrivacyGroup;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
@ -49,7 +49,7 @@ public class PrivxJsonRpcMethods extends PrivacyApiGroupJsonRpcMethods {
final PrivacyIdProvider privacyIdProvider, final PrivacyIdProvider privacyIdProvider,
final PrivateMarkerTransactionFactory privateMarkerTransactionFactory) { final PrivateMarkerTransactionFactory privateMarkerTransactionFactory) {
if (getPrivacyParameters().isOnchainPrivacyGroupsEnabled()) { if (getPrivacyParameters().isOnchainPrivacyGroupsEnabled()) {
return mapOf(new PrivxFindOnChainPrivacyGroup(privacyController, privacyIdProvider)); return mapOf(new PrivxFindOnchainPrivacyGroup(privacyController, privacyIdProvider));
} else { } else {
return Map.of(); return Map.of();
} }

@ -56,13 +56,13 @@ public class EeaSendRawTransactionTest extends BaseEeaSendRawTransaction {
static final String ENCLAVE_PUBLIC_KEY = "S28yYlZxRCtuTmxOWUw1RUU3eTNJZE9udmlmdGppaXo="; static final String ENCLAVE_PUBLIC_KEY = "S28yYlZxRCtuTmxOWUw1RUU3eTNJZE9udmlmdGppaXo=";
final PrivacyIdProvider privacyIdProvider = (user) -> ENCLAVE_PUBLIC_KEY; final PrivacyIdProvider privacyIdProvider = (user) -> ENCLAVE_PUBLIC_KEY;
RestrictedOffChainEeaSendRawTransaction method; RestrictedOffchainEeaSendRawTransaction method;
@Before @Before
public void before() { public void before() {
method = method =
new RestrictedOffChainEeaSendRawTransaction( new RestrictedOffchainEeaSendRawTransaction(
transactionPool, transactionPool,
privacyIdProvider, privacyIdProvider,
privateMarkerTransactionFactory, privateMarkerTransactionFactory,

@ -36,17 +36,17 @@ import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner; import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class) @RunWith(MockitoJUnitRunner.class)
public class RestrictedOffChainEeaSendRawTransactionTest extends BaseEeaSendRawTransaction { public class RestrictedOffchainEeaSendRawTransactionTest extends BaseEeaSendRawTransaction {
static final String ENCLAVE_PUBLIC_KEY = "S28yYlZxRCtuTmxOWUw1RUU3eTNJZE9udmlmdGppaXo="; static final String ENCLAVE_PUBLIC_KEY = "S28yYlZxRCtuTmxOWUw1RUU3eTNJZE9udmlmdGppaXo=";
final PrivacyIdProvider privacyIdProvider = (user) -> ENCLAVE_PUBLIC_KEY; final PrivacyIdProvider privacyIdProvider = (user) -> ENCLAVE_PUBLIC_KEY;
RestrictedOffChainEeaSendRawTransaction method; RestrictedOffchainEeaSendRawTransaction method;
@Before @Before
public void before() { public void before() {
method = method =
new RestrictedOffChainEeaSendRawTransaction( new RestrictedOffchainEeaSendRawTransaction(
transactionPool, transactionPool,
privacyIdProvider, privacyIdProvider,
privateMarkerTransactionFactory, privateMarkerTransactionFactory,

@ -37,17 +37,17 @@ import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner; import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class) @RunWith(MockitoJUnitRunner.class)
public class RestrictedOnChainEeaSendRawTransactionTest extends BaseEeaSendRawTransaction { public class RestrictedOnchainEeaSendRawTransactionTest extends BaseEeaSendRawTransaction {
static final String ENCLAVE_PUBLIC_KEY = "S28yYlZxRCtuTmxOWUw1RUU3eTNJZE9udmlmdGppaXo="; static final String ENCLAVE_PUBLIC_KEY = "S28yYlZxRCtuTmxOWUw1RUU3eTNJZE9udmlmdGppaXo=";
final PrivacyIdProvider privacyIdProvider = (user) -> ENCLAVE_PUBLIC_KEY; final PrivacyIdProvider privacyIdProvider = (user) -> ENCLAVE_PUBLIC_KEY;
RestrictedOnChainEeaSendRawTransaction method; RestrictedOnchainEeaSendRawTransaction method;
@Before @Before
public void before() { public void before() {
method = method =
new RestrictedOnChainEeaSendRawTransaction( new RestrictedOnchainEeaSendRawTransaction(
transactionPool, transactionPool,
privacyIdProvider, privacyIdProvider,
privateMarkerTransactionFactory, privateMarkerTransactionFactory,
@ -56,7 +56,7 @@ public class RestrictedOnChainEeaSendRawTransactionTest extends BaseEeaSendRawTr
} }
@Test @Test
public void validOnChainTransactionPrivacyGroupIsSentToTransactionPool() { public void validOnchainTransactionPrivacyGroupIsSentToTransactionPool() {
when(privacyController.validatePrivateTransaction(any(), any())) when(privacyController.validatePrivateTransaction(any(), any()))
.thenReturn(ValidationResult.valid()); .thenReturn(ValidationResult.valid());
when(transactionPool.addLocalTransaction(any(Transaction.class))) when(transactionPool.addLocalTransaction(any(Transaction.class)))
@ -65,13 +65,13 @@ public class RestrictedOnChainEeaSendRawTransactionTest extends BaseEeaSendRawTr
when(privacyController.createPrivateMarkerTransactionPayload(any(), any(), any())) when(privacyController.createPrivateMarkerTransactionPayload(any(), any(), any()))
.thenReturn(MOCK_ORION_KEY); .thenReturn(MOCK_ORION_KEY);
final Optional<PrivacyGroup> onChainPrivacyGroup = final Optional<PrivacyGroup> onchainPrivacyGroup =
Optional.of( Optional.of(
new PrivacyGroup( new PrivacyGroup(
"", PrivacyGroup.Type.ONCHAIN, "", "", Arrays.asList(ENCLAVE_PUBLIC_KEY))); "", PrivacyGroup.Type.ONCHAIN, "", "", Arrays.asList(ENCLAVE_PUBLIC_KEY)));
when(privacyController.findOnChainPrivacyGroupAndAddNewMembers(any(), any(), any())) when(privacyController.findOnchainPrivacyGroupAndAddNewMembers(any(), any(), any()))
.thenReturn(onChainPrivacyGroup); .thenReturn(onchainPrivacyGroup);
final JsonRpcSuccessResponse expectedResponse = final JsonRpcSuccessResponse expectedResponse =
new JsonRpcSuccessResponse( new JsonRpcSuccessResponse(
@ -104,7 +104,7 @@ public class RestrictedOnChainEeaSendRawTransactionTest extends BaseEeaSendRawTr
when(privacyController.validatePrivateTransaction(any(), any())) when(privacyController.validatePrivateTransaction(any(), any()))
.thenReturn(ValidationResult.valid()); .thenReturn(ValidationResult.valid());
when(privacyController.findOnChainPrivacyGroupAndAddNewMembers(any(), any(), any())) when(privacyController.findOnchainPrivacyGroupAndAddNewMembers(any(), any(), any()))
.thenReturn(Optional.empty()); .thenReturn(Optional.empty());
final JsonRpcResponse expectedResponse = final JsonRpcResponse expectedResponse =
@ -118,7 +118,7 @@ public class RestrictedOnChainEeaSendRawTransactionTest extends BaseEeaSendRawTr
} }
@Test @Test
public void onChainPrivacyGroupTransactionFailsWhenGroupDoesNotExist() { public void onchainPrivacyGroupTransactionFailsWhenGroupDoesNotExist() {
when(privacyController.validatePrivateTransaction(any(), any())) when(privacyController.validatePrivateTransaction(any(), any()))
.thenReturn(ValidationResult.valid()); .thenReturn(ValidationResult.valid());

@ -43,7 +43,7 @@ import org.assertj.core.util.Lists;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
public class PrivxFindOnChainPrivacyGroupTest { public class PrivxFindOnchainPrivacyGroupTest {
private static final String ENCLAVE_PUBLIC_KEY = "A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo="; private static final String ENCLAVE_PUBLIC_KEY = "A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo=";
private static final List<String> ADDRESSES = private static final List<String> ADDRESSES =
List.of( List.of(
@ -60,7 +60,7 @@ public class PrivxFindOnChainPrivacyGroupTest {
private JsonRpcRequestContext request; private JsonRpcRequestContext request;
private PrivacyGroup privacyGroup; private PrivacyGroup privacyGroup;
private PrivxFindOnChainPrivacyGroup privxFindOnChainPrivacyGroup; private PrivxFindOnchainPrivacyGroup privxFindOnchainPrivacyGroup;
@Before @Before
public void setUp() { public void setUp() {
@ -76,45 +76,45 @@ public class PrivxFindOnChainPrivacyGroupTest {
privacyGroup.setPrivacyGroupId("privacy group id"); privacyGroup.setPrivacyGroupId("privacy group id");
privacyGroup.setMembers(Lists.list("member1")); privacyGroup.setMembers(Lists.list("member1"));
privxFindOnChainPrivacyGroup = privxFindOnchainPrivacyGroup =
new PrivxFindOnChainPrivacyGroup(privacyController, privacyIdProvider); new PrivxFindOnchainPrivacyGroup(privacyController, privacyIdProvider);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Test @Test
public void findsPrivacyGroupWithValidAddresses() { public void findsPrivacyGroupWithValidAddresses() {
when(privacyController.findOnChainPrivacyGroupByMembers(ADDRESSES, ENCLAVE_PUBLIC_KEY)) when(privacyController.findOnchainPrivacyGroupByMembers(ADDRESSES, ENCLAVE_PUBLIC_KEY))
.thenReturn(Collections.singletonList(privacyGroup)); .thenReturn(Collections.singletonList(privacyGroup));
final JsonRpcSuccessResponse response = final JsonRpcSuccessResponse response =
(JsonRpcSuccessResponse) privxFindOnChainPrivacyGroup.response(request); (JsonRpcSuccessResponse) privxFindOnchainPrivacyGroup.response(request);
final List<PrivacyGroup> result = (List<PrivacyGroup>) response.getResult(); final List<PrivacyGroup> result = (List<PrivacyGroup>) response.getResult();
assertThat(result).hasSize(1); assertThat(result).hasSize(1);
assertThat(result.get(0)).isEqualToComparingFieldByField(privacyGroup); assertThat(result.get(0)).isEqualToComparingFieldByField(privacyGroup);
verify(privacyController).findOnChainPrivacyGroupByMembers(ADDRESSES, ENCLAVE_PUBLIC_KEY); verify(privacyController).findOnchainPrivacyGroupByMembers(ADDRESSES, ENCLAVE_PUBLIC_KEY);
} }
@Test @Test
public void failsWithFindPrivacyGroupErrorIfEnclaveFails() { public void failsWithFindPrivacyGroupErrorIfEnclaveFails() {
when(privacyController.findOnChainPrivacyGroupByMembers(ADDRESSES, ENCLAVE_PUBLIC_KEY)) when(privacyController.findOnchainPrivacyGroupByMembers(ADDRESSES, ENCLAVE_PUBLIC_KEY))
.thenThrow(new EnclaveClientException(500, "some failure")); .thenThrow(new EnclaveClientException(500, "some failure"));
final JsonRpcErrorResponse response = final JsonRpcErrorResponse response =
(JsonRpcErrorResponse) privxFindOnChainPrivacyGroup.response(request); (JsonRpcErrorResponse) privxFindOnchainPrivacyGroup.response(request);
assertThat(response.getError()).isEqualTo(JsonRpcError.FIND_ONCHAIN_PRIVACY_GROUP_ERROR); assertThat(response.getError()).isEqualTo(JsonRpcError.FIND_ONCHAIN_PRIVACY_GROUP_ERROR);
verify(privacyController).findOnChainPrivacyGroupByMembers(ADDRESSES, ENCLAVE_PUBLIC_KEY); verify(privacyController).findOnchainPrivacyGroupByMembers(ADDRESSES, ENCLAVE_PUBLIC_KEY);
} }
@Test @Test
public void failsWithUnauthorizedErrorIfMultiTenancyValidationFails() { public void failsWithUnauthorizedErrorIfMultiTenancyValidationFails() {
when(privacyController.findOnChainPrivacyGroupByMembers(ADDRESSES, ENCLAVE_PUBLIC_KEY)) when(privacyController.findOnchainPrivacyGroupByMembers(ADDRESSES, ENCLAVE_PUBLIC_KEY))
.thenThrow(new MultiTenancyValidationException("validation failed")); .thenThrow(new MultiTenancyValidationException("validation failed"));
final JsonRpcResponse expectedResponse = final JsonRpcResponse expectedResponse =
new JsonRpcErrorResponse( new JsonRpcErrorResponse(
request.getRequest().getId(), JsonRpcError.FIND_ONCHAIN_PRIVACY_GROUP_ERROR); request.getRequest().getId(), JsonRpcError.FIND_ONCHAIN_PRIVACY_GROUP_ERROR);
final JsonRpcResponse response = privxFindOnChainPrivacyGroup.response(request); final JsonRpcResponse response = privxFindOnchainPrivacyGroup.response(request);
assertThat(response).isEqualTo(expectedResponse); assertThat(response).isEqualTo(expectedResponse);
verify(privacyController).findOnChainPrivacyGroupByMembers(ADDRESSES, ENCLAVE_PUBLIC_KEY); verify(privacyController).findOnchainPrivacyGroupByMembers(ADDRESSES, ENCLAVE_PUBLIC_KEY);
} }
} }

@ -20,7 +20,7 @@ import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.privx.PrivxFindOnChainPrivacyGroup; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.privx.PrivxFindOnchainPrivacyGroup;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
@ -69,6 +69,6 @@ public class PrivxJsonRpcMethodsTest {
final JsonRpcMethod method = rpcMethods.get(PRIVX_FIND_PRIVACY_GROUP.getMethodName()); final JsonRpcMethod method = rpcMethods.get(PRIVX_FIND_PRIVACY_GROUP.getMethodName());
assertThat(method).isNotNull(); assertThat(method).isNotNull();
assertThat(method).isInstanceOf(PrivxFindOnChainPrivacyGroup.class); assertThat(method).isInstanceOf(PrivxFindOnchainPrivacyGroup.class);
} }
} }

@ -22,7 +22,7 @@ import static org.hyperledger.besu.evm.precompile.MainnetPrecompiledContracts.po
import static org.hyperledger.besu.evm.precompile.MainnetPrecompiledContracts.populateForFrontier; import static org.hyperledger.besu.evm.precompile.MainnetPrecompiledContracts.populateForFrontier;
import static org.hyperledger.besu.evm.precompile.MainnetPrecompiledContracts.populateForIstanbul; import static org.hyperledger.besu.evm.precompile.MainnetPrecompiledContracts.populateForIstanbul;
import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.OnChainPrivacyPrecompiledContract; import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.OnchainPrivacyPrecompiledContract;
import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.PrivacyPluginPrecompiledContract; import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.PrivacyPluginPrecompiledContract;
import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.PrivacyPrecompiledContract; import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.PrivacyPrecompiledContract;
import org.hyperledger.besu.evm.precompile.PrecompileContractRegistry; import org.hyperledger.besu.evm.precompile.PrecompileContractRegistry;
@ -79,7 +79,7 @@ public abstract class MainnetPrecompiledContractRegistries {
.isOnchainPrivacyGroupsEnabled()) { .isOnchainPrivacyGroupsEnabled()) {
registry.put( registry.put(
ONCHAIN_PRIVACY, ONCHAIN_PRIVACY,
new OnChainPrivacyPrecompiledContract( new OnchainPrivacyPrecompiledContract(
precompiledContractConfiguration.getGasCalculator(), precompiledContractConfiguration.getGasCalculator(),
precompiledContractConfiguration.getPrivacyParameters())); precompiledContractConfiguration.getPrivacyParameters()));
} else { } else {

@ -109,7 +109,7 @@ public class PrivacyBlockProcessor implements BlockProcessor {
final BlockHeader blockHeader, final BlockHeader blockHeader,
final List<Transaction> transactions) { final List<Transaction> transactions) {
transactions.stream() transactions.stream()
.filter(this::onChainAddToGroupPrivateMarkerTransactions) .filter(this::onchainAddToGroupPrivateMarkerTransactions)
.forEach( .forEach(
pmt -> { pmt -> {
final Bytes32 privateTransactionsLookupId = final Bytes32 privateTransactionsLookupId =
@ -159,7 +159,7 @@ public class PrivacyBlockProcessor implements BlockProcessor {
}); });
} }
private boolean onChainAddToGroupPrivateMarkerTransactions(final Transaction t) { private boolean onchainAddToGroupPrivateMarkerTransactions(final Transaction t) {
return t.getTo().isPresent() return t.getTo().isPresent()
&& t.getTo().equals(Optional.of(ONCHAIN_PRIVACY)) && t.getTo().equals(Optional.of(ONCHAIN_PRIVACY))
&& t.getPayload().size() == 64; && t.getPayload().size() == 64;

@ -28,7 +28,7 @@ import org.hyperledger.besu.ethereum.core.BlockImporter;
import org.hyperledger.besu.ethereum.core.GoQuorumPrivacyParameters; import org.hyperledger.besu.ethereum.core.GoQuorumPrivacyParameters;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket; import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket;
import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.OnChainPrivacyPrecompiledContract; import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.OnchainPrivacyPrecompiledContract;
import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.PrivacyPluginPrecompiledContract; import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.PrivacyPluginPrecompiledContract;
import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.PrivacyPrecompiledContract; import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.PrivacyPrecompiledContract;
import org.hyperledger.besu.ethereum.privacy.PrivateTransactionProcessor; import org.hyperledger.besu.ethereum.privacy.PrivateTransactionProcessor;
@ -318,9 +318,9 @@ public class ProtocolSpecBuilder {
privacyPluginPrecompiledContract.setPrivateTransactionProcessor( privacyPluginPrecompiledContract.setPrivateTransactionProcessor(
privateTransactionProcessor); privateTransactionProcessor);
} else if (privacyParameters.isOnchainPrivacyGroupsEnabled()) { } else if (privacyParameters.isOnchainPrivacyGroupsEnabled()) {
final OnChainPrivacyPrecompiledContract onChainPrivacyPrecompiledContract = final OnchainPrivacyPrecompiledContract onchainPrivacyPrecompiledContract =
(OnChainPrivacyPrecompiledContract) precompileContractRegistry.get(ONCHAIN_PRIVACY); (OnchainPrivacyPrecompiledContract) precompileContractRegistry.get(ONCHAIN_PRIVACY);
onChainPrivacyPrecompiledContract.setPrivateTransactionProcessor( onchainPrivacyPrecompiledContract.setPrivateTransactionProcessor(
privateTransactionProcessor); privateTransactionProcessor);
} else { } else {
final PrivacyPrecompiledContract privacyPrecompiledContract = final PrivacyPrecompiledContract privacyPrecompiledContract =

@ -35,7 +35,7 @@ import org.hyperledger.besu.ethereum.privacy.PrivateTransactionEvent;
import org.hyperledger.besu.ethereum.privacy.PrivateTransactionObserver; import org.hyperledger.besu.ethereum.privacy.PrivateTransactionObserver;
import org.hyperledger.besu.ethereum.privacy.PrivateTransactionReceipt; import org.hyperledger.besu.ethereum.privacy.PrivateTransactionReceipt;
import org.hyperledger.besu.ethereum.privacy.VersionedPrivateTransaction; import org.hyperledger.besu.ethereum.privacy.VersionedPrivateTransaction;
import org.hyperledger.besu.ethereum.privacy.group.OnChainGroupManagement; import org.hyperledger.besu.ethereum.privacy.group.OnchainGroupManagement;
import org.hyperledger.besu.ethereum.privacy.storage.PrivateMetadataUpdater; import org.hyperledger.besu.ethereum.privacy.storage.PrivateMetadataUpdater;
import org.hyperledger.besu.ethereum.processing.TransactionProcessingResult; import org.hyperledger.besu.ethereum.processing.TransactionProcessingResult;
import org.hyperledger.besu.ethereum.rlp.BytesValueRLPInput; import org.hyperledger.besu.ethereum.rlp.BytesValueRLPInput;
@ -57,14 +57,14 @@ import org.apache.logging.log4j.Logger;
import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32; import org.apache.tuweni.bytes.Bytes32;
public class OnChainPrivacyPrecompiledContract extends PrivacyPrecompiledContract { public class OnchainPrivacyPrecompiledContract extends PrivacyPrecompiledContract {
private static final Logger LOG = LogManager.getLogger(); private static final Logger LOG = LogManager.getLogger();
private final Subscribers<PrivateTransactionObserver> privateTransactionEventObservers = private final Subscribers<PrivateTransactionObserver> privateTransactionEventObservers =
Subscribers.create(); Subscribers.create();
public OnChainPrivacyPrecompiledContract( public OnchainPrivacyPrecompiledContract(
final GasCalculator gasCalculator, final GasCalculator gasCalculator,
final Enclave enclave, final Enclave enclave,
final WorldStateArchive worldStateArchive, final WorldStateArchive worldStateArchive,
@ -76,10 +76,10 @@ public class OnChainPrivacyPrecompiledContract extends PrivacyPrecompiledContrac
worldStateArchive, worldStateArchive,
privateStateRootResolver, privateStateRootResolver,
privateStateGenesisAllocator, privateStateGenesisAllocator,
"OnChainPrivacy"); "OnchainPrivacy");
} }
public OnChainPrivacyPrecompiledContract( public OnchainPrivacyPrecompiledContract(
final GasCalculator gasCalculator, final PrivacyParameters privacyParameters) { final GasCalculator gasCalculator, final PrivacyParameters privacyParameters) {
this( this(
gasCalculator, gasCalculator,
@ -250,7 +250,7 @@ public class OnChainPrivacyPrecompiledContract extends PrivacyPrecompiledContrac
return false; return false;
} }
if (!onChainPrivacyGroupVersionMatches(onchainPrivacyGroupContract, privacyGroupId, version)) { if (!onchainPrivacyGroupVersionMatches(onchainPrivacyGroupContract, privacyGroupId, version)) {
LOG.debug( LOG.debug(
"Privacy group version mismatch while trying to execute transaction with commitment {}", "Privacy group version mismatch while trying to execute transaction with commitment {}",
(Hash) messageFrame.getContextVariable(KEY_TRANSACTION_HASH)); (Hash) messageFrame.getContextVariable(KEY_TRANSACTION_HASH));
@ -322,7 +322,7 @@ public class OnChainPrivacyPrecompiledContract extends PrivacyPrecompiledContrac
&& privateTransaction && privateTransaction
.getPayload() .getPayload()
.toHexString() .toHexString()
.startsWith(OnChainGroupManagement.ADD_PARTICIPANTS_METHOD_SIGNATURE.toHexString()); .startsWith(OnchainGroupManagement.ADD_PARTICIPANTS_METHOD_SIGNATURE.toHexString());
} }
private boolean isRemovingParticipant(final PrivateTransaction privateTransaction) { private boolean isRemovingParticipant(final PrivateTransaction privateTransaction) {
@ -330,7 +330,7 @@ public class OnChainPrivacyPrecompiledContract extends PrivacyPrecompiledContrac
&& privateTransaction && privateTransaction
.getPayload() .getPayload()
.toHexString() .toHexString()
.startsWith(OnChainGroupManagement.REMOVE_PARTICIPANT_METHOD_SIGNATURE.toHexString()); .startsWith(OnchainGroupManagement.REMOVE_PARTICIPANT_METHOD_SIGNATURE.toHexString());
} }
protected boolean isContractLocked( protected boolean isContractLocked(
@ -341,7 +341,7 @@ public class OnChainPrivacyPrecompiledContract extends PrivacyPrecompiledContrac
return canExecuteResult.map(Bytes::isZero).orElse(true); return canExecuteResult.map(Bytes::isZero).orElse(true);
} }
protected boolean onChainPrivacyGroupVersionMatches( protected boolean onchainPrivacyGroupVersionMatches(
final OnchainPrivacyGroupContract onchainPrivacyGroupContract, final OnchainPrivacyGroupContract onchainPrivacyGroupContract,
final Bytes32 privacyGroupId, final Bytes32 privacyGroupId,
final Bytes32 version) { final Bytes32 version) {

@ -15,9 +15,9 @@
package org.hyperledger.besu.ethereum.privacy; package org.hyperledger.besu.ethereum.privacy;
import static org.hyperledger.besu.ethereum.core.PrivacyParameters.ONCHAIN_PRIVACY_PROXY; import static org.hyperledger.besu.ethereum.core.PrivacyParameters.ONCHAIN_PRIVACY_PROXY;
import static org.hyperledger.besu.ethereum.privacy.group.OnChainGroupManagement.CAN_EXECUTE_METHOD_SIGNATURE; import static org.hyperledger.besu.ethereum.privacy.group.OnchainGroupManagement.CAN_EXECUTE_METHOD_SIGNATURE;
import static org.hyperledger.besu.ethereum.privacy.group.OnChainGroupManagement.GET_PARTICIPANTS_METHOD_SIGNATURE; import static org.hyperledger.besu.ethereum.privacy.group.OnchainGroupManagement.GET_PARTICIPANTS_METHOD_SIGNATURE;
import static org.hyperledger.besu.ethereum.privacy.group.OnChainGroupManagement.GET_VERSION_METHOD_SIGNATURE; import static org.hyperledger.besu.ethereum.privacy.group.OnchainGroupManagement.GET_VERSION_METHOD_SIGNATURE;
import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.crypto.SECPSignature;
import org.hyperledger.besu.crypto.SignatureAlgorithm; import org.hyperledger.besu.crypto.SignatureAlgorithm;

@ -262,14 +262,14 @@ public class PluginPrivacyController implements PrivacyController {
} }
@Override @Override
public List<PrivacyGroup> findOnChainPrivacyGroupByMembers( public List<PrivacyGroup> findOnchainPrivacyGroupByMembers(
final List<String> asList, final String privacyUserId) { final List<String> asList, final String privacyUserId) {
throw new PrivacyConfigurationNotSupportedException( throw new PrivacyConfigurationNotSupportedException(
"Method not supported when using PrivacyPlugin"); "Method not supported when using PrivacyPlugin");
} }
@Override @Override
public Optional<PrivacyGroup> findOnChainPrivacyGroupAndAddNewMembers( public Optional<PrivacyGroup> findOnchainPrivacyGroupAndAddNewMembers(
final Bytes privacyGroupId, final Bytes privacyGroupId,
final String privacyUserId, final String privacyUserId,
final PrivateTransaction privateTransaction) { final PrivateTransaction privateTransaction) {

@ -71,7 +71,7 @@ public interface PrivacyController {
Optional<PrivacyGroup> findPrivacyGroupByGroupId( Optional<PrivacyGroup> findPrivacyGroupByGroupId(
final String privacyGroupId, final String privacyUserId); final String privacyGroupId, final String privacyUserId);
List<PrivacyGroup> findOnChainPrivacyGroupByMembers(List<String> asList, String privacyUserId); List<PrivacyGroup> findOnchainPrivacyGroupByMembers(List<String> asList, String privacyUserId);
Optional<Bytes> getContractCode( Optional<Bytes> getContractCode(
final String privacyGroupId, final String privacyGroupId,
@ -79,7 +79,7 @@ public interface PrivacyController {
final Hash blockHash, final Hash blockHash,
final String privacyUserId); final String privacyUserId);
Optional<PrivacyGroup> findOnChainPrivacyGroupAndAddNewMembers( Optional<PrivacyGroup> findOnchainPrivacyGroupAndAddNewMembers(
Bytes privacyGroupId, String privacyUserId, final PrivateTransaction privateTransaction); Bytes privacyGroupId, String privacyUserId, final PrivateTransaction privateTransaction);
List<PrivateTransactionWithMetadata> retrieveAddBlob(String addDataKey); List<PrivateTransactionWithMetadata> retrieveAddBlob(String addDataKey);

@ -62,7 +62,7 @@ public class PrivacyGroupUtil {
final PrivateTransaction privateTransaction) { final PrivateTransaction privateTransaction) {
return maybePrivacyGroupId.flatMap( return maybePrivacyGroupId.flatMap(
privacyGroupId -> privacyGroupId ->
privacyController.findOnChainPrivacyGroupAndAddNewMembers( privacyController.findOnchainPrivacyGroupAndAddNewMembers(
privacyGroupId, privacyUserId, privateTransaction)); privacyGroupId, privacyUserId, privateTransaction));
} }

@ -20,7 +20,7 @@ import static org.hyperledger.besu.ethereum.core.PrivacyParameters.ONCHAIN_PRIVA
import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.core.MutableWorldState; import org.hyperledger.besu.ethereum.core.MutableWorldState;
import org.hyperledger.besu.ethereum.privacy.group.OnChainGroupManagement; import org.hyperledger.besu.ethereum.privacy.group.OnchainGroupManagement;
import org.hyperledger.besu.evm.account.MutableAccount; import org.hyperledger.besu.evm.account.MutableAccount;
import org.hyperledger.besu.evm.worldstate.WorldUpdater; import org.hyperledger.besu.evm.worldstate.WorldUpdater;
import org.hyperledger.besu.plugin.data.PrivacyGenesis; import org.hyperledger.besu.plugin.data.PrivacyGenesis;
@ -93,14 +93,14 @@ public class PrivateStateGenesisAllocator {
privateWorldStateUpdater.createAccount(DEFAULT_ONCHAIN_PRIVACY_MANAGEMENT).getMutable(); privateWorldStateUpdater.createAccount(DEFAULT_ONCHAIN_PRIVACY_MANAGEMENT).getMutable();
// this is the code for the simple management contract // this is the code for the simple management contract
managementContract.setCode(OnChainGroupManagement.DEFAULT_GROUP_MANAGEMENT_RUNTIME_BYTECODE); managementContract.setCode(OnchainGroupManagement.DEFAULT_GROUP_MANAGEMENT_RUNTIME_BYTECODE);
// inject proxy // inject proxy
final MutableAccount procyContract = final MutableAccount procyContract =
privateWorldStateUpdater.createAccount(ONCHAIN_PRIVACY_PROXY).getMutable(); privateWorldStateUpdater.createAccount(ONCHAIN_PRIVACY_PROXY).getMutable();
// this is the code for the proxy contract // this is the code for the proxy contract
procyContract.setCode(OnChainGroupManagement.PROXY_RUNTIME_BYTECODE); procyContract.setCode(OnchainGroupManagement.PROXY_RUNTIME_BYTECODE);
// manually set the management contract address so the proxy can trust it // manually set the management contract address so the proxy can trust it
procyContract.setStorageValue( procyContract.setStorageValue(
UInt256.ZERO, UInt256.fromBytes(Bytes32.leftPad(DEFAULT_ONCHAIN_PRIVACY_MANAGEMENT))); UInt256.ZERO, UInt256.fromBytes(Bytes32.leftPad(DEFAULT_ONCHAIN_PRIVACY_MANAGEMENT)));

@ -16,9 +16,9 @@ package org.hyperledger.besu.ethereum.privacy;
import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.charset.StandardCharsets.UTF_8;
import static org.hyperledger.besu.ethereum.core.PrivacyParameters.ONCHAIN_PRIVACY_PROXY; import static org.hyperledger.besu.ethereum.core.PrivacyParameters.ONCHAIN_PRIVACY_PROXY;
import static org.hyperledger.besu.ethereum.privacy.group.OnChainGroupManagement.ADD_PARTICIPANTS_METHOD_SIGNATURE; import static org.hyperledger.besu.ethereum.privacy.group.OnchainGroupManagement.ADD_PARTICIPANTS_METHOD_SIGNATURE;
import static org.hyperledger.besu.ethereum.privacy.group.OnChainGroupManagement.GET_PARTICIPANTS_METHOD_SIGNATURE; import static org.hyperledger.besu.ethereum.privacy.group.OnchainGroupManagement.GET_PARTICIPANTS_METHOD_SIGNATURE;
import static org.hyperledger.besu.ethereum.privacy.group.OnChainGroupManagement.GET_VERSION_METHOD_SIGNATURE; import static org.hyperledger.besu.ethereum.privacy.group.OnchainGroupManagement.GET_VERSION_METHOD_SIGNATURE;
import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.datatypes.Hash;
@ -247,7 +247,7 @@ public class RestrictedDefaultPrivacyController implements PrivacyController {
// An exception is thrown if the offchain group cannot be found // An exception is thrown if the offchain group cannot be found
LOG.debug("Offchain privacy group not found: {}", privacyGroupId); LOG.debug("Offchain privacy group not found: {}", privacyGroupId);
} }
return findOnChainPrivacyGroupByGroupId(Bytes.fromBase64String(privacyGroupId), privacyUserId); return findOnchainPrivacyGroupByGroupId(Bytes.fromBase64String(privacyGroupId), privacyUserId);
} }
@Override @Override
@ -257,7 +257,7 @@ public class RestrictedDefaultPrivacyController implements PrivacyController {
} }
@Override @Override
public List<PrivacyGroup> findOnChainPrivacyGroupByMembers( public List<PrivacyGroup> findOnchainPrivacyGroupByMembers(
final List<String> addresses, final String privacyUserId) { final List<String> addresses, final String privacyUserId) {
final ArrayList<PrivacyGroup> privacyGroups = new ArrayList<>(); final ArrayList<PrivacyGroup> privacyGroups = new ArrayList<>();
final PrivacyGroupHeadBlockMap privacyGroupHeadBlockMap = final PrivacyGroupHeadBlockMap privacyGroupHeadBlockMap =
@ -269,7 +269,7 @@ public class RestrictedDefaultPrivacyController implements PrivacyController {
.forEach( .forEach(
c -> { c -> {
final Optional<PrivacyGroup> maybePrivacyGroup = final Optional<PrivacyGroup> maybePrivacyGroup =
findOnChainPrivacyGroupByGroupId(c, privacyUserId); findOnchainPrivacyGroupByGroupId(c, privacyUserId);
if (maybePrivacyGroup.isPresent() if (maybePrivacyGroup.isPresent()
&& maybePrivacyGroup.get().getMembers().containsAll(addresses)) { && maybePrivacyGroup.get().getMembers().containsAll(addresses)) {
privacyGroups.add(maybePrivacyGroup.get()); privacyGroups.add(maybePrivacyGroup.get());
@ -278,7 +278,7 @@ public class RestrictedDefaultPrivacyController implements PrivacyController {
return privacyGroups; return privacyGroups;
} }
public Optional<PrivacyGroup> findOnChainPrivacyGroupByGroupId( public Optional<PrivacyGroup> findOnchainPrivacyGroupByGroupId(
final Bytes privacyGroupId, final String enclaveKey) { final Bytes privacyGroupId, final String enclaveKey) {
// get the privateFor list from the management contract // get the privateFor list from the management contract
final Optional<TransactionProcessingResult> privateTransactionSimulatorResultOptional = final Optional<TransactionProcessingResult> privateTransactionSimulatorResultOptional =
@ -306,7 +306,7 @@ public class RestrictedDefaultPrivacyController implements PrivacyController {
} }
@Override @Override
public Optional<PrivacyGroup> findOnChainPrivacyGroupAndAddNewMembers( public Optional<PrivacyGroup> findOnchainPrivacyGroupAndAddNewMembers(
final Bytes privacyGroupId, final Bytes privacyGroupId,
final String privacyUserId, final String privacyUserId,
final PrivateTransaction privateTransaction) { final PrivateTransaction privateTransaction) {
@ -481,11 +481,11 @@ public class RestrictedDefaultPrivacyController implements PrivacyController {
privateTransaction.getPrivacyGroupId().get().toBase64String(), privateTransaction.getPrivacyGroupId().get().toBase64String(),
buildCallParams(GET_VERSION_METHOD_SIGNATURE)); buildCallParams(GET_VERSION_METHOD_SIGNATURE));
new VersionedPrivateTransaction(privateTransaction, result).writeTo(rlpOutput); new VersionedPrivateTransaction(privateTransaction, result).writeTo(rlpOutput);
final List<String> onChainPrivateFor = privacyGroup.getMembers(); final List<String> onchainPrivateFor = privacyGroup.getMembers();
return enclave.send( return enclave.send(
rlpOutput.encoded().toBase64String(), rlpOutput.encoded().toBase64String(),
privateTransaction.getPrivateFrom().toBase64String(), privateTransaction.getPrivateFrom().toBase64String(),
onChainPrivateFor); onchainPrivateFor);
} else if (privacyGroup.getType() == PrivacyGroup.Type.PANTHEON) { } else if (privacyGroup.getType() == PrivacyGroup.Type.PANTHEON) {
// offchain privacy group // offchain privacy group
privateTransaction.writeTo(rlpOutput); privateTransaction.writeTo(rlpOutput);

@ -208,14 +208,14 @@ public class RestrictedMultiTenancyPrivacyController implements PrivacyControlle
} }
@Override @Override
public List<PrivacyGroup> findOnChainPrivacyGroupByMembers( public List<PrivacyGroup> findOnchainPrivacyGroupByMembers(
final List<String> addresses, final String privacyUserId) { final List<String> addresses, final String privacyUserId) {
if (!addresses.contains(privacyUserId)) { if (!addresses.contains(privacyUserId)) {
throw new MultiTenancyValidationException( throw new MultiTenancyValidationException(
"Privacy group addresses must contain the enclave public key"); "Privacy group addresses must contain the enclave public key");
} }
final List<PrivacyGroup> resultantGroups = final List<PrivacyGroup> resultantGroups =
privacyController.findOnChainPrivacyGroupByMembers(addresses, privacyUserId); privacyController.findOnchainPrivacyGroupByMembers(addresses, privacyUserId);
return resultantGroups.stream() return resultantGroups.stream()
.filter(g -> g.getMembers().contains(privacyUserId)) .filter(g -> g.getMembers().contains(privacyUserId))
.collect(Collectors.toList()); .collect(Collectors.toList());
@ -243,12 +243,12 @@ public class RestrictedMultiTenancyPrivacyController implements PrivacyControlle
} }
@Override @Override
public Optional<PrivacyGroup> findOnChainPrivacyGroupAndAddNewMembers( public Optional<PrivacyGroup> findOnchainPrivacyGroupAndAddNewMembers(
final Bytes privacyGroupId, final Bytes privacyGroupId,
final String privacyUserId, final String privacyUserId,
final PrivateTransaction privateTransaction) { final PrivateTransaction privateTransaction) {
final Optional<PrivacyGroup> maybePrivacyGroup = final Optional<PrivacyGroup> maybePrivacyGroup =
privacyController.findOnChainPrivacyGroupAndAddNewMembers( privacyController.findOnchainPrivacyGroupAndAddNewMembers(
privacyGroupId, privacyUserId, privateTransaction); privacyGroupId, privacyUserId, privateTransaction);
// The check that the privacyUserId is a member (if the group already exists) is done in the // The check that the privacyUserId is a member (if the group already exists) is done in the
// DefaultPrivacyController. // DefaultPrivacyController.

@ -89,11 +89,11 @@ public class PrivateTransactionDataFixture {
return privateMarkerTransaction(VALID_BASE64_ENCLAVE_KEY, DEFAULT_PRIVACY); return privateMarkerTransaction(VALID_BASE64_ENCLAVE_KEY, DEFAULT_PRIVACY);
} }
public static Transaction privateMarkerTransactionOnChain() { public static Transaction privateMarkerTransactionOnchain() {
return privateMarkerTransaction(VALID_BASE64_ENCLAVE_KEY, ONCHAIN_PRIVACY); return privateMarkerTransaction(VALID_BASE64_ENCLAVE_KEY, ONCHAIN_PRIVACY);
} }
public static Transaction privateMarkerTransactionOnChainAdd() { public static Transaction privateMarkerTransactionOnchainAdd() {
return privateMarkerTransaction( return privateMarkerTransaction(
Bytes.concatenate(VALID_BASE64_ENCLAVE_KEY, VALID_BASE64_ENCLAVE_KEY), ONCHAIN_PRIVACY); Bytes.concatenate(VALID_BASE64_ENCLAVE_KEY, VALID_BASE64_ENCLAVE_KEY), ONCHAIN_PRIVACY);
} }

@ -25,7 +25,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.OnChainPrivacyPrecompiledContract; import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.OnchainPrivacyPrecompiledContract;
import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.PrivacyPrecompiledContract; import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.PrivacyPrecompiledContract;
import org.hyperledger.besu.evm.gascalculator.GasCalculator; import org.hyperledger.besu.evm.gascalculator.GasCalculator;
import org.hyperledger.besu.evm.precompile.PrecompileContractRegistry; import org.hyperledger.besu.evm.precompile.PrecompileContractRegistry;
@ -62,7 +62,7 @@ public class MainnetPrecompiledContractRegistriesTest {
verify(privacyParameters).isEnabled(); verify(privacyParameters).isEnabled();
verify(privacyParameters).isOnchainPrivacyGroupsEnabled(); verify(privacyParameters).isOnchainPrivacyGroupsEnabled();
assertThat(reg.get(ONCHAIN_PRIVACY)).isInstanceOf(OnChainPrivacyPrecompiledContract.class); assertThat(reg.get(ONCHAIN_PRIVACY)).isInstanceOf(OnchainPrivacyPrecompiledContract.class);
assertThat(reg.get(DEFAULT_PRIVACY)).isNull(); assertThat(reg.get(DEFAULT_PRIVACY)).isNull();
} }

@ -134,18 +134,18 @@ public class PrivacyBlockProcessorTest {
final Block firstBlock = final Block firstBlock =
blockDataGenerator.block( blockDataGenerator.block(
BlockDataGenerator.BlockOptions.create() BlockDataGenerator.BlockOptions.create()
.addTransaction(PrivateTransactionDataFixture.privateMarkerTransactionOnChain())); .addTransaction(PrivateTransactionDataFixture.privateMarkerTransactionOnchain()));
final Block secondBlock = final Block secondBlock =
blockDataGenerator.block( blockDataGenerator.block(
BlockDataGenerator.BlockOptions.create() BlockDataGenerator.BlockOptions.create()
.addTransaction( .addTransaction(
PrivateTransactionDataFixture.privateMarkerTransactionOnChainAdd())); PrivateTransactionDataFixture.privateMarkerTransactionOnchainAdd()));
when(enclave.receive(any())) when(enclave.receive(any()))
.thenReturn( .thenReturn(
PrivateTransactionDataFixture.generateAddToGroupReceiveResponse( PrivateTransactionDataFixture.generateAddToGroupReceiveResponse(
PrivateTransactionDataFixture.privateTransactionBesu(), PrivateTransactionDataFixture.privateTransactionBesu(),
PrivateTransactionDataFixture.privateMarkerTransactionOnChain())); PrivateTransactionDataFixture.privateMarkerTransactionOnchain()));
when(blockchain.getTransactionLocation(any())) when(blockchain.getTransactionLocation(any()))
.thenReturn(Optional.of(new TransactionLocation(firstBlock.getHash(), 0))); .thenReturn(Optional.of(new TransactionLocation(firstBlock.getHash(), 0)));
when(blockchain.getBlockByHash(any())).thenReturn(Optional.of(firstBlock)); when(blockchain.getBlockByHash(any())).thenReturn(Optional.of(firstBlock));

@ -69,7 +69,7 @@ import org.junit.Test;
import org.junit.rules.TemporaryFolder; import org.junit.rules.TemporaryFolder;
import org.mockito.Mockito; import org.mockito.Mockito;
public class OnChainPrivacyPrecompiledContractTest { public class OnchainPrivacyPrecompiledContractTest {
@Rule public final TemporaryFolder temp = new TemporaryFolder(); @Rule public final TemporaryFolder temp = new TemporaryFolder();
@ -144,7 +144,7 @@ public class OnChainPrivacyPrecompiledContractTest {
@Test @Test
public void testPayloadFoundInEnclave() { public void testPayloadFoundInEnclave() {
final Enclave enclave = mock(Enclave.class); final Enclave enclave = mock(Enclave.class);
final OnChainPrivacyPrecompiledContract contract = buildPrivacyPrecompiledContract(enclave); final OnchainPrivacyPrecompiledContract contract = buildPrivacyPrecompiledContract(enclave);
final List<Log> logs = new ArrayList<>(); final List<Log> logs = new ArrayList<>();
contract.setPrivateTransactionProcessor( contract.setPrivateTransactionProcessor(
mockPrivateTxProcessor( mockPrivateTxProcessor(
@ -161,7 +161,7 @@ public class OnChainPrivacyPrecompiledContractTest {
new ReceiveResponse(payload, PAYLOAD_TEST_PRIVACY_GROUP_ID, privateFrom); new ReceiveResponse(payload, PAYLOAD_TEST_PRIVACY_GROUP_ID, privateFrom);
when(enclave.receive(any())).thenReturn(response); when(enclave.receive(any())).thenReturn(response);
final OnChainPrivacyPrecompiledContract contractSpy = spy(contract); final OnchainPrivacyPrecompiledContract contractSpy = spy(contract);
Mockito.doReturn(true) Mockito.doReturn(true)
.when(contractSpy) .when(contractSpy)
.canExecute(any(), any(), any(), any(), any(), any(), any(), any()); .canExecute(any(), any(), any(), any(), any(), any(), any(), any());
@ -195,7 +195,7 @@ public class OnChainPrivacyPrecompiledContractTest {
@Test @Test
public void testEnclaveBelowRequiredVersion() { public void testEnclaveBelowRequiredVersion() {
final Enclave enclave = mock(Enclave.class); final Enclave enclave = mock(Enclave.class);
final OnChainPrivacyPrecompiledContract contract = buildPrivacyPrecompiledContract(enclave); final OnchainPrivacyPrecompiledContract contract = buildPrivacyPrecompiledContract(enclave);
final VersionedPrivateTransaction versionedPrivateTransaction = final VersionedPrivateTransaction versionedPrivateTransaction =
versionedPrivateTransactionBesu(); versionedPrivateTransactionBesu();
final byte[] payload = convertVersionedPrivateTransactionToBytes(versionedPrivateTransaction); final byte[] payload = convertVersionedPrivateTransactionToBytes(versionedPrivateTransaction);
@ -213,7 +213,7 @@ public class OnChainPrivacyPrecompiledContractTest {
@Test @Test
public void testPayloadNotMatchingPrivateFrom() { public void testPayloadNotMatchingPrivateFrom() {
final Enclave enclave = mock(Enclave.class); final Enclave enclave = mock(Enclave.class);
final OnChainPrivacyPrecompiledContract contract = buildPrivacyPrecompiledContract(enclave); final OnchainPrivacyPrecompiledContract contract = buildPrivacyPrecompiledContract(enclave);
final VersionedPrivateTransaction versionedPrivateTransaction = final VersionedPrivateTransaction versionedPrivateTransaction =
versionedPrivateTransactionBesu(); versionedPrivateTransactionBesu();
final byte[] payload = convertVersionedPrivateTransactionToBytes(versionedPrivateTransaction); final byte[] payload = convertVersionedPrivateTransactionToBytes(versionedPrivateTransaction);
@ -260,16 +260,16 @@ public class OnChainPrivacyPrecompiledContractTest {
private void assertThatComputeReturnsEmptyGivenContractMembershipQueryReturns( private void assertThatComputeReturnsEmptyGivenContractMembershipQueryReturns(
final Bytes memberList) { final Bytes memberList) {
final Enclave enclave = mock(Enclave.class); final Enclave enclave = mock(Enclave.class);
final OnChainPrivacyPrecompiledContract contract = buildPrivacyPrecompiledContract(enclave); final OnchainPrivacyPrecompiledContract contract = buildPrivacyPrecompiledContract(enclave);
final List<Log> logs = new ArrayList<>(); final List<Log> logs = new ArrayList<>();
contract.setPrivateTransactionProcessor( contract.setPrivateTransactionProcessor(
mockPrivateTxProcessor( mockPrivateTxProcessor(
TransactionProcessingResult.successful(logs, 0, 0, memberList, null))); TransactionProcessingResult.successful(logs, 0, 0, memberList, null)));
final OnChainPrivacyPrecompiledContract contractSpy = spy(contract); final OnchainPrivacyPrecompiledContract contractSpy = spy(contract);
Mockito.doReturn(false).when(contractSpy).isContractLocked(any(), any()); Mockito.doReturn(false).when(contractSpy).isContractLocked(any(), any());
Mockito.doReturn(true).when(contractSpy).onChainPrivacyGroupVersionMatches(any(), any(), any()); Mockito.doReturn(true).when(contractSpy).onchainPrivacyGroupVersionMatches(any(), any(), any());
final VersionedPrivateTransaction privateTransaction = versionedPrivateTransactionBesu(); final VersionedPrivateTransaction privateTransaction = versionedPrivateTransactionBesu();
final byte[] payload = convertVersionedPrivateTransactionToBytes(privateTransaction); final byte[] payload = convertVersionedPrivateTransactionToBytes(privateTransaction);
@ -289,8 +289,8 @@ public class OnChainPrivacyPrecompiledContractTest {
public void testInvalidPrivateTransaction() { public void testInvalidPrivateTransaction() {
final Enclave enclave = mock(Enclave.class); final Enclave enclave = mock(Enclave.class);
final OnChainPrivacyPrecompiledContract contract = final OnchainPrivacyPrecompiledContract contract =
new OnChainPrivacyPrecompiledContract( new OnchainPrivacyPrecompiledContract(
new SpuriousDragonGasCalculator(), new SpuriousDragonGasCalculator(),
enclave, enclave,
worldStateArchive, worldStateArchive,
@ -302,7 +302,7 @@ public class OnChainPrivacyPrecompiledContractTest {
TransactionProcessingResult.invalid( TransactionProcessingResult.invalid(
ValidationResult.invalid(TransactionInvalidReason.INCORRECT_NONCE)))); ValidationResult.invalid(TransactionInvalidReason.INCORRECT_NONCE))));
final OnChainPrivacyPrecompiledContract contractSpy = spy(contract); final OnchainPrivacyPrecompiledContract contractSpy = spy(contract);
Mockito.doReturn(true) Mockito.doReturn(true)
.when(contractSpy) .when(contractSpy)
.canExecute(any(), any(), any(), any(), any(), any(), any(), any()); .canExecute(any(), any(), any(), any(), any(), any(), any(), any());
@ -330,8 +330,8 @@ public class OnChainPrivacyPrecompiledContractTest {
return bytesValueRLPOutput.encoded().toBase64String().getBytes(UTF_8); return bytesValueRLPOutput.encoded().toBase64String().getBytes(UTF_8);
} }
private OnChainPrivacyPrecompiledContract buildPrivacyPrecompiledContract(final Enclave enclave) { private OnchainPrivacyPrecompiledContract buildPrivacyPrecompiledContract(final Enclave enclave) {
return new OnChainPrivacyPrecompiledContract( return new OnchainPrivacyPrecompiledContract(
new SpuriousDragonGasCalculator(), new SpuriousDragonGasCalculator(),
enclave, enclave,
worldStateArchive, worldStateArchive,

@ -18,8 +18,8 @@ package org.hyperledger.besu.ethereum.privacy;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.hyperledger.besu.ethereum.core.PrivacyParameters.DEFAULT_ONCHAIN_PRIVACY_MANAGEMENT; import static org.hyperledger.besu.ethereum.core.PrivacyParameters.DEFAULT_ONCHAIN_PRIVACY_MANAGEMENT;
import static org.hyperledger.besu.ethereum.core.PrivacyParameters.ONCHAIN_PRIVACY_PROXY; import static org.hyperledger.besu.ethereum.core.PrivacyParameters.ONCHAIN_PRIVACY_PROXY;
import static org.hyperledger.besu.ethereum.privacy.group.OnChainGroupManagement.DEFAULT_GROUP_MANAGEMENT_RUNTIME_BYTECODE; import static org.hyperledger.besu.ethereum.privacy.group.OnchainGroupManagement.DEFAULT_GROUP_MANAGEMENT_RUNTIME_BYTECODE;
import static org.hyperledger.besu.ethereum.privacy.group.OnChainGroupManagement.PROXY_RUNTIME_BYTECODE; import static org.hyperledger.besu.ethereum.privacy.group.OnchainGroupManagement.PROXY_RUNTIME_BYTECODE;
import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.datatypes.Hash;
@ -82,7 +82,7 @@ public class PrivateStateGenesisAllocatorTest {
}); });
@Test @Test
public void whenOnChainDisabledAndNoAccountsProvidedNoGenesisIsApplied() { public void whenOnchainDisabledAndNoAccountsProvidedNoGenesisIsApplied() {
PrivateStateGenesisAllocator privateStateGenesisAllocator = PrivateStateGenesisAllocator privateStateGenesisAllocator =
new PrivateStateGenesisAllocator( new PrivateStateGenesisAllocator(
false, (privacyGroupId, blockNumber) -> Collections::emptyList); false, (privacyGroupId, blockNumber) -> Collections::emptyList);
@ -94,7 +94,7 @@ public class PrivateStateGenesisAllocatorTest {
} }
@Test @Test
public void whenOnChainEnabledAndNoAccountsProvidedPrivacyManagementContractIsApplied() { public void whenOnchainEnabledAndNoAccountsProvidedPrivacyManagementContractIsApplied() {
PrivateStateGenesisAllocator privateStateGenesisAllocator = PrivateStateGenesisAllocator privateStateGenesisAllocator =
new PrivateStateGenesisAllocator( new PrivateStateGenesisAllocator(
true, (privacyGroupId, blockNumber) -> Collections::emptyList); true, (privacyGroupId, blockNumber) -> Collections::emptyList);
@ -108,7 +108,7 @@ public class PrivateStateGenesisAllocatorTest {
} }
@Test @Test
public void whenOnChainEnabledAndAccountsProvidedPrivacyManagementContractAndGenesisIsApplied() { public void whenOnchainEnabledAndAccountsProvidedPrivacyManagementContractAndGenesisIsApplied() {
PrivateStateGenesisAllocator privateStateGenesisAllocator = PrivateStateGenesisAllocator privateStateGenesisAllocator =
new PrivateStateGenesisAllocator(true, (privacyGroupId, blockNumber) -> privacyGenesis); new PrivateStateGenesisAllocator(true, (privacyGroupId, blockNumber) -> privacyGenesis);
@ -122,7 +122,7 @@ public class PrivateStateGenesisAllocatorTest {
} }
@Test @Test
public void whenOnChainDisabledAndAccountsProvidedPrivacyManagementContractAndGenesisIsApplied() { public void whenOnchainDisabledAndAccountsProvidedPrivacyManagementContractAndGenesisIsApplied() {
PrivateStateGenesisAllocator privateStateGenesisAllocator = PrivateStateGenesisAllocator privateStateGenesisAllocator =
new PrivateStateGenesisAllocator(false, (privacyGroupId, blockNumber) -> privacyGenesis); new PrivateStateGenesisAllocator(false, (privacyGroupId, blockNumber) -> privacyGenesis);

@ -126,7 +126,7 @@ public class PrivateTransactionLocatorTest {
@Test @Test
public void locateBesuPrivateTransactionSentToOnchainPrivacyGroup() { public void locateBesuPrivateTransactionSentToOnchainPrivacyGroup() {
final Transaction pmt = PrivateTransactionDataFixture.privateMarkerTransactionOnChain(); final Transaction pmt = PrivateTransactionDataFixture.privateMarkerTransactionOnchain();
final PrivateTransaction privateTransaction = privateTransactionBesu(); final PrivateTransaction privateTransaction = privateTransactionBesu();
final ExecutedPrivateTransaction expectedPrivateTx = final ExecutedPrivateTransaction expectedPrivateTx =
@ -160,7 +160,7 @@ public class PrivateTransactionLocatorTest {
@Test @Test
public void locateBesuPrivateTransactionFromAddBlobSentToOnchainPrivacyGroup() { public void locateBesuPrivateTransactionFromAddBlobSentToOnchainPrivacyGroup() {
final Transaction pmt = PrivateTransactionDataFixture.privateMarkerTransactionOnChain(); final Transaction pmt = PrivateTransactionDataFixture.privateMarkerTransactionOnchain();
final PrivateTransaction privateTransaction = privateTransactionBesu(); final PrivateTransaction privateTransaction = privateTransactionBesu();
final ExecutedPrivateTransaction expectedPrivateTx = final ExecutedPrivateTransaction expectedPrivateTx =
@ -174,7 +174,7 @@ public class PrivateTransactionLocatorTest {
@Test @Test
public void locatePrivateTransactionWithNoEntryOnPGHeadBlockMap() { public void locatePrivateTransactionWithNoEntryOnPGHeadBlockMap() {
final Transaction pmt = PrivateTransactionDataFixture.privateMarkerTransactionOnChain(); final Transaction pmt = PrivateTransactionDataFixture.privateMarkerTransactionOnchain();
final PrivateTransaction privateTransaction = privateTransactionBesu(); final PrivateTransaction privateTransaction = privateTransactionBesu();
createExecutedPrivateTransactionFromAddBlob(pmt, privateTransaction); createExecutedPrivateTransactionFromAddBlob(pmt, privateTransaction);
@ -190,7 +190,7 @@ public class PrivateTransactionLocatorTest {
@Test @Test
public void locateBesuPrivateTransactionNotFoundInAddBlob() { public void locateBesuPrivateTransactionNotFoundInAddBlob() {
final Transaction pmt = PrivateTransactionDataFixture.privateMarkerTransactionOnChain(); final Transaction pmt = PrivateTransactionDataFixture.privateMarkerTransactionOnchain();
final PrivateTransaction privateTransaction = privateTransactionBesu(); final PrivateTransaction privateTransaction = privateTransactionBesu();
createExecutedPrivateTransactionFromAddBlob(pmt, privateTransaction); createExecutedPrivateTransactionFromAddBlob(pmt, privateTransaction);

@ -164,7 +164,7 @@ public class RestrictedDefaultPrivacyControllerTest {
} }
@Test @Test
public void findOnChainPrivacyGroups() { public void findOnchainPrivacyGroups() {
final List<String> privacyGroupAddresses = newArrayList(ENCLAVE_PUBLIC_KEY, ENCLAVE_KEY2); final List<String> privacyGroupAddresses = newArrayList(ENCLAVE_PUBLIC_KEY, ENCLAVE_KEY2);
final PrivacyGroup privacyGroup = final PrivacyGroup privacyGroup =
@ -193,7 +193,7 @@ public class RestrictedDefaultPrivacyControllerTest {
Optional.empty()))); Optional.empty())));
final List<PrivacyGroup> privacyGroups = final List<PrivacyGroup> privacyGroups =
privacyController.findOnChainPrivacyGroupByMembers( privacyController.findOnchainPrivacyGroupByMembers(
privacyGroupAddresses, ENCLAVE_PUBLIC_KEY); privacyGroupAddresses, ENCLAVE_PUBLIC_KEY);
assertThat(privacyGroups).hasSize(1); assertThat(privacyGroups).hasSize(1);
assertThat(privacyGroups.get(0)).isEqualToComparingFieldByField(privacyGroup); assertThat(privacyGroups.get(0)).isEqualToComparingFieldByField(privacyGroup);

@ -79,12 +79,12 @@ public class BlockHashLookupTest {
} }
@Test @Test
public void shouldReturnEmptyHashWhenRequestedBlockNotOnChain() { public void shouldReturnEmptyHashWhenRequestedBlockNotOnchain() {
Assertions.assertThat(lookup.apply(CURRENT_BLOCK_NUMBER + 20L)).isEqualTo(Hash.ZERO); Assertions.assertThat(lookup.apply(CURRENT_BLOCK_NUMBER + 20L)).isEqualTo(Hash.ZERO);
} }
@Test @Test
public void shouldReturnEmptyHashWhenParentBlockNotOnChain() { public void shouldReturnEmptyHashWhenParentBlockNotOnchain() {
final BlockHashLookup lookupWithUnavailableParent = final BlockHashLookup lookupWithUnavailableParent =
new BlockHashLookup( new BlockHashLookup(
new BlockHeaderTestFixture().number(CURRENT_BLOCK_NUMBER + 20).buildHeader(), new BlockHeaderTestFixture().number(CURRENT_BLOCK_NUMBER + 20).buildHeader(),

@ -201,7 +201,7 @@ public class TransactionPoolTest {
} }
@Test @Test
public void shouldRemoveTransactionsFromPendingListWhenIncludedInBlockOnChain() { public void shouldRemoveTransactionsFromPendingListWhenIncludedInBlockOnchain() {
transactions.addRemoteTransaction(transaction1); transactions.addRemoteTransaction(transaction1);
assertTransactionPending(transaction1); assertTransactionPending(transaction1);
appendBlock(transaction1); appendBlock(transaction1);

@ -40,6 +40,6 @@ class IBFTGenesisFileModule extends GenesisFileModule {
@Override @Override
BlockHeaderFunctions blockHashFunction() { BlockHeaderFunctions blockHashFunction() {
return BftBlockHeaderFunctions.forOnChainBlock(bftExtraDataEncoder); return BftBlockHeaderFunctions.forOnchainBlock(bftExtraDataEncoder);
} }
} }

@ -52,7 +52,7 @@ public class AccountPermissioningController {
public boolean isPermitted( public boolean isPermitted(
final Transaction transaction, final Transaction transaction,
final boolean includeLocalCheck, final boolean includeLocalCheck,
final boolean includeOnChainCheck) { final boolean includeOnchainCheck) {
final boolean checkPermissions = final boolean checkPermissions =
goQuorumQip714Gate.map(GoQuorumQip714Gate::shouldCheckPermissions).orElse(true); goQuorumQip714Gate.map(GoQuorumQip714Gate::shouldCheckPermissions).orElse(true);
if (!checkPermissions) { if (!checkPermissions) {
@ -76,7 +76,7 @@ public class AccountPermissioningController {
.orElse(true); .orElse(true);
} }
if (includeOnChainCheck) { if (includeOnchainCheck) {
permittedOnchain = permittedOnchain =
transactionSmartContractPermissioningController transactionSmartContractPermissioningController
.map(c -> c.isPermitted(transaction)) .map(c -> c.isPermitted(transaction))

@ -138,7 +138,7 @@ public class MessageCallProcessor extends AbstractMessageProcessor {
final Bytes output = contract.compute(frame.getInputData(), frame); final Bytes output = contract.compute(frame.getInputData(), frame);
operationTracer.tracePrecompileCall(frame, gasRequirement, output); operationTracer.tracePrecompileCall(frame, gasRequirement, output);
if (output != null) { if (output != null) {
if (contract.getName().equals("Privacy") || contract.getName().equals("OnChainPrivacy")) { if (contract.getName().equals("Privacy") || contract.getName().equals("OnchainPrivacy")) {
// do not decrement the gas requirement for a privacy pre-compile contract call -> leads // do not decrement the gas requirement for a privacy pre-compile contract call -> leads
// to discrepancies in receipts root between public and private nodes in a network. // to discrepancies in receipts root between public and private nodes in a network.
frame.incrementRemainingGas(gasRequirement); frame.incrementRemainingGas(gasRequirement);

@ -47,7 +47,7 @@ import org.web3j.tx.gas.ContractGasProvider;
* <p>Generated with web3j version 4.5.16. * <p>Generated with web3j version 4.5.16.
*/ */
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public class OnChainPrivacyGroupManagementInterface extends Contract { public class OnchainPrivacyGroupManagementInterface extends Contract {
public static final String BINARY = ""; public static final String BINARY = "";
public static final String FUNC_ADDPARTICIPANTS = "addParticipants"; public static final String FUNC_ADDPARTICIPANTS = "addParticipants";
@ -67,7 +67,7 @@ public class OnChainPrivacyGroupManagementInterface extends Contract {
public static final String FUNC_UNLOCK = "unlock"; public static final String FUNC_UNLOCK = "unlock";
@Deprecated @Deprecated
protected OnChainPrivacyGroupManagementInterface( protected OnchainPrivacyGroupManagementInterface(
String contractAddress, String contractAddress,
Web3j web3j, Web3j web3j,
Credentials credentials, Credentials credentials,
@ -76,7 +76,7 @@ public class OnChainPrivacyGroupManagementInterface extends Contract {
super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
} }
protected OnChainPrivacyGroupManagementInterface( protected OnchainPrivacyGroupManagementInterface(
String contractAddress, String contractAddress,
Web3j web3j, Web3j web3j,
Credentials credentials, Credentials credentials,
@ -85,7 +85,7 @@ public class OnChainPrivacyGroupManagementInterface extends Contract {
} }
@Deprecated @Deprecated
protected OnChainPrivacyGroupManagementInterface( protected OnchainPrivacyGroupManagementInterface(
String contractAddress, String contractAddress,
Web3j web3j, Web3j web3j,
TransactionManager transactionManager, TransactionManager transactionManager,
@ -94,7 +94,7 @@ public class OnChainPrivacyGroupManagementInterface extends Contract {
super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit); super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
} }
protected OnChainPrivacyGroupManagementInterface( protected OnchainPrivacyGroupManagementInterface(
String contractAddress, String contractAddress,
Web3j web3j, Web3j web3j,
TransactionManager transactionManager, TransactionManager transactionManager,
@ -180,49 +180,49 @@ public class OnChainPrivacyGroupManagementInterface extends Contract {
} }
@Deprecated @Deprecated
public static OnChainPrivacyGroupManagementInterface load( public static OnchainPrivacyGroupManagementInterface load(
String contractAddress, String contractAddress,
Web3j web3j, Web3j web3j,
Credentials credentials, Credentials credentials,
BigInteger gasPrice, BigInteger gasPrice,
BigInteger gasLimit) { BigInteger gasLimit) {
return new OnChainPrivacyGroupManagementInterface( return new OnchainPrivacyGroupManagementInterface(
contractAddress, web3j, credentials, gasPrice, gasLimit); contractAddress, web3j, credentials, gasPrice, gasLimit);
} }
@Deprecated @Deprecated
public static OnChainPrivacyGroupManagementInterface load( public static OnchainPrivacyGroupManagementInterface load(
String contractAddress, String contractAddress,
Web3j web3j, Web3j web3j,
TransactionManager transactionManager, TransactionManager transactionManager,
BigInteger gasPrice, BigInteger gasPrice,
BigInteger gasLimit) { BigInteger gasLimit) {
return new OnChainPrivacyGroupManagementInterface( return new OnchainPrivacyGroupManagementInterface(
contractAddress, web3j, transactionManager, gasPrice, gasLimit); contractAddress, web3j, transactionManager, gasPrice, gasLimit);
} }
public static OnChainPrivacyGroupManagementInterface load( public static OnchainPrivacyGroupManagementInterface load(
String contractAddress, String contractAddress,
Web3j web3j, Web3j web3j,
Credentials credentials, Credentials credentials,
ContractGasProvider contractGasProvider) { ContractGasProvider contractGasProvider) {
return new OnChainPrivacyGroupManagementInterface( return new OnchainPrivacyGroupManagementInterface(
contractAddress, web3j, credentials, contractGasProvider); contractAddress, web3j, credentials, contractGasProvider);
} }
public static OnChainPrivacyGroupManagementInterface load( public static OnchainPrivacyGroupManagementInterface load(
String contractAddress, String contractAddress,
Web3j web3j, Web3j web3j,
TransactionManager transactionManager, TransactionManager transactionManager,
ContractGasProvider contractGasProvider) { ContractGasProvider contractGasProvider) {
return new OnChainPrivacyGroupManagementInterface( return new OnchainPrivacyGroupManagementInterface(
contractAddress, web3j, transactionManager, contractGasProvider); contractAddress, web3j, transactionManager, contractGasProvider);
} }
public static RemoteCall<OnChainPrivacyGroupManagementInterface> deploy( public static RemoteCall<OnchainPrivacyGroupManagementInterface> deploy(
Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
return deployRemoteCall( return deployRemoteCall(
OnChainPrivacyGroupManagementInterface.class, OnchainPrivacyGroupManagementInterface.class,
web3j, web3j,
credentials, credentials,
contractGasProvider, contractGasProvider,
@ -231,10 +231,10 @@ public class OnChainPrivacyGroupManagementInterface extends Contract {
} }
@Deprecated @Deprecated
public static RemoteCall<OnChainPrivacyGroupManagementInterface> deploy( public static RemoteCall<OnchainPrivacyGroupManagementInterface> deploy(
Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
return deployRemoteCall( return deployRemoteCall(
OnChainPrivacyGroupManagementInterface.class, OnchainPrivacyGroupManagementInterface.class,
web3j, web3j,
credentials, credentials,
gasPrice, gasPrice,
@ -243,10 +243,10 @@ public class OnChainPrivacyGroupManagementInterface extends Contract {
""); "");
} }
public static RemoteCall<OnChainPrivacyGroupManagementInterface> deploy( public static RemoteCall<OnchainPrivacyGroupManagementInterface> deploy(
Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
return deployRemoteCall( return deployRemoteCall(
OnChainPrivacyGroupManagementInterface.class, OnchainPrivacyGroupManagementInterface.class,
web3j, web3j,
transactionManager, transactionManager,
contractGasProvider, contractGasProvider,
@ -255,13 +255,13 @@ public class OnChainPrivacyGroupManagementInterface extends Contract {
} }
@Deprecated @Deprecated
public static RemoteCall<OnChainPrivacyGroupManagementInterface> deploy( public static RemoteCall<OnchainPrivacyGroupManagementInterface> deploy(
Web3j web3j, Web3j web3j,
TransactionManager transactionManager, TransactionManager transactionManager,
BigInteger gasPrice, BigInteger gasPrice,
BigInteger gasLimit) { BigInteger gasLimit) {
return deployRemoteCall( return deployRemoteCall(
OnChainPrivacyGroupManagementInterface.class, OnchainPrivacyGroupManagementInterface.class,
web3j, web3j,
transactionManager, transactionManager,
gasPrice, gasPrice,
Loading…
Cancel
Save