diff --git a/enclave/src/integration-test/java/org/hyperledger/besu/enclave/EnclaveTest.java b/enclave/src/integration-test/java/org/hyperledger/besu/enclave/EnclaveTest.java index 540f2127861..16998a51bc9 100644 --- a/enclave/src/integration-test/java/org/hyperledger/besu/enclave/EnclaveTest.java +++ b/enclave/src/integration-test/java/org/hyperledger/besu/enclave/EnclaveTest.java @@ -126,7 +126,7 @@ public void testCreateAndDeletePrivacyGroup() { assertThat(privacyGroupResponse.getPrivacyGroupId()).isNotNull(); assertThat(privacyGroupResponse.getName()).isEqualTo(name); assertThat(privacyGroupResponse.getDescription()).isEqualTo(description); - assertThat(privacyGroupResponse.getType()).isEqualByComparingTo(PrivacyGroup.Type.PANTHEON); + assertThat(privacyGroupResponse.getType()).isEqualByComparingTo(PrivacyGroup.Type.BESU); final String response = enclave.deletePrivacyGroup(privacyGroupResponse.getPrivacyGroupId(), publicKeys.get(0)); @@ -146,7 +146,7 @@ public void testCreateFindDeleteFindPrivacyGroup() { assertThat(privacyGroupResponse.getPrivacyGroupId()).isNotNull(); assertThat(privacyGroupResponse.getName()).isEqualTo(name); assertThat(privacyGroupResponse.getDescription()).isEqualTo(description); - assertThat(privacyGroupResponse.getType()).isEqualTo(PrivacyGroup.Type.PANTHEON); + assertThat(privacyGroupResponse.getType()).isEqualTo(PrivacyGroup.Type.BESU); PrivacyGroup[] findPrivacyGroupResponse = enclave.findPrivacyGroup(publicKeys); @@ -176,7 +176,7 @@ public void testCreateDeleteRetrievePrivacyGroup() { assertThat(privacyGroupResponse.getPrivacyGroupId()).isNotNull(); assertThat(privacyGroupResponse.getName()).isEqualTo(name); assertThat(privacyGroupResponse.getDescription()).isEqualTo(description); - assertThat(privacyGroupResponse.getType()).isEqualTo(PrivacyGroup.Type.PANTHEON); + assertThat(privacyGroupResponse.getType()).isEqualTo(PrivacyGroup.Type.BESU); final PrivacyGroup retrievePrivacyGroup = enclave.retrievePrivacyGroup(privacyGroupResponse.getPrivacyGroupId()); diff --git a/enclave/src/main/java/org/hyperledger/besu/enclave/types/PrivacyGroup.java b/enclave/src/main/java/org/hyperledger/besu/enclave/types/PrivacyGroup.java index f2b6c020d46..4257842e1f6 100644 --- a/enclave/src/main/java/org/hyperledger/besu/enclave/types/PrivacyGroup.java +++ b/enclave/src/main/java/org/hyperledger/besu/enclave/types/PrivacyGroup.java @@ -82,7 +82,6 @@ public PrivacyGroup( public enum Type { LEGACY, - PANTHEON, BESU } } diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivCreatePrivacyGroupTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivCreatePrivacyGroupTest.java index 16e79a222d0..24fb5d0e350 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivCreatePrivacyGroupTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivCreatePrivacyGroupTest.java @@ -69,7 +69,7 @@ public void setUp() { public void verifyCreatePrivacyGroup() { final String expected = "a wonderful group"; final PrivacyGroup privacyGroup = - new PrivacyGroup(expected, PrivacyGroup.Type.PANTHEON, NAME, DESCRIPTION, ADDRESSES); + new PrivacyGroup(expected, PrivacyGroup.Type.BESU, NAME, DESCRIPTION, ADDRESSES); when(privacyController.createPrivacyGroup(ADDRESSES, NAME, DESCRIPTION, ENCLAVE_PUBLIC_KEY)) .thenReturn(privacyGroup); when(privacyParameters.getEnclavePublicKey()).thenReturn(FROM); @@ -98,7 +98,7 @@ public void verifyCreatePrivacyGroup() { public void verifyCreatePrivacyGroupWithoutDescription() { final String expected = "a wonderful group"; final PrivacyGroup privacyGroup = - new PrivacyGroup(expected, PrivacyGroup.Type.PANTHEON, NAME, DESCRIPTION, ADDRESSES); + new PrivacyGroup(expected, PrivacyGroup.Type.BESU, NAME, DESCRIPTION, ADDRESSES); when(privacyController.createPrivacyGroup(ADDRESSES, NAME, null, ENCLAVE_PUBLIC_KEY)) .thenReturn(privacyGroup); when(privacyParameters.getEnclavePublicKey()).thenReturn(FROM); @@ -134,7 +134,7 @@ public String getName() { public void verifyCreatePrivacyGroupWithoutName() { final String expected = "a wonderful group"; final PrivacyGroup privacyGroup = - new PrivacyGroup(expected, PrivacyGroup.Type.PANTHEON, NAME, DESCRIPTION, ADDRESSES); + new PrivacyGroup(expected, PrivacyGroup.Type.BESU, NAME, DESCRIPTION, ADDRESSES); when(privacyController.createPrivacyGroup(ADDRESSES, null, DESCRIPTION, ENCLAVE_PUBLIC_KEY)) .thenReturn(privacyGroup); when(privacyParameters.getEnclavePublicKey()).thenReturn(FROM); @@ -170,7 +170,7 @@ public String getDescription() { public void verifyCreatePrivacyGroupWithoutOptionalParams() { final String expected = "a wonderful group"; final PrivacyGroup privacyGroup = - new PrivacyGroup(expected, PrivacyGroup.Type.PANTHEON, NAME, DESCRIPTION, ADDRESSES); + new PrivacyGroup(expected, PrivacyGroup.Type.BESU, NAME, DESCRIPTION, ADDRESSES); when(privacyController.createPrivacyGroup(ADDRESSES, null, null, ENCLAVE_PUBLIC_KEY)) .thenReturn(privacyGroup); when(privacyParameters.getEnclavePublicKey()).thenReturn(FROM); @@ -203,7 +203,7 @@ public void returnsCorrectExceptionInvalidParam() { final String expected = "a wonderful group"; final PrivacyGroup privacyGroup = - new PrivacyGroup(expected, PrivacyGroup.Type.PANTHEON, NAME, DESCRIPTION, ADDRESSES); + new PrivacyGroup(expected, PrivacyGroup.Type.BESU, NAME, DESCRIPTION, ADDRESSES); when(enclave.createPrivacyGroup(any(), any(), any(), any())).thenReturn(privacyGroup); when(privacyParameters.getEnclavePublicKey()).thenReturn(FROM); diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/DefaultPrivacyControllerTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/DefaultPrivacyControllerTest.java index e7049ddeaf2..8e4d56315bb 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/DefaultPrivacyControllerTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/DefaultPrivacyControllerTest.java @@ -283,7 +283,7 @@ public void createsPrivacyGroup() { final PrivacyGroup enclavePrivacyGroupResponse = new PrivacyGroup( PRIVACY_GROUP_ID, - Type.PANTHEON, + Type.BESU, PRIVACY_GROUP_NAME, PRIVACY_GROUP_DESCRIPTION, PRIVACY_GROUP_ADDRESSES); @@ -322,7 +322,7 @@ public void findsPrivacyGroup() { final PrivacyGroup privacyGroup = new PrivacyGroup( PRIVACY_GROUP_ID, - Type.PANTHEON, + Type.BESU, PRIVACY_GROUP_NAME, PRIVACY_GROUP_DESCRIPTION, PRIVACY_GROUP_ADDRESSES); diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/MultiTenancyPrivacyControllerTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/MultiTenancyPrivacyControllerTest.java index 2e797beee2c..56c0cab817a 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/MultiTenancyPrivacyControllerTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/MultiTenancyPrivacyControllerTest.java @@ -92,11 +92,7 @@ public void setup() { .thenReturn(new SendTransactionResponse(ENCLAVE_KEY, PRIVACY_GROUP_ID)); final PrivacyGroup privacyGroupWithEnclavePublicKey = new PrivacyGroup( - PRIVACY_GROUP_ID, - Type.PANTHEON, - "", - "", - List.of(ENCLAVE_PUBLIC_KEY1, ENCLAVE_PUBLIC_KEY2)); + PRIVACY_GROUP_ID, Type.BESU, "", "", List.of(ENCLAVE_PUBLIC_KEY1, ENCLAVE_PUBLIC_KEY2)); when(enclave.retrievePrivacyGroup(PRIVACY_GROUP_ID)) .thenReturn(privacyGroupWithEnclavePublicKey); @@ -149,7 +145,7 @@ public void sendBesuTransactionFailsWithValidationExceptionWhenPrivateFromDoesNo .build(); final PrivacyGroup privacyGroupWithoutEnclavePublicKey = - new PrivacyGroup(PRIVACY_GROUP_ID, Type.PANTHEON, "", "", List.of(ENCLAVE_PUBLIC_KEY2)); + new PrivacyGroup(PRIVACY_GROUP_ID, Type.BESU, "", "", List.of(ENCLAVE_PUBLIC_KEY2)); when(enclave.retrievePrivacyGroup(PRIVACY_GROUP_ID)) .thenReturn(privacyGroupWithoutEnclavePublicKey); @@ -179,7 +175,7 @@ public void retrieveTransactionDelegatesToPrivacyController() { public void createPrivacyGroupDelegatesToPrivacyController() { final List addresses = List.of(ENCLAVE_PUBLIC_KEY1, ENCLAVE_PUBLIC_KEY2); final PrivacyGroup delegatePrivacyGroup = - new PrivacyGroup(PRIVACY_GROUP_ID, Type.PANTHEON, "name", "description", addresses); + new PrivacyGroup(PRIVACY_GROUP_ID, Type.BESU, "name", "description", addresses); when(privacyController.createPrivacyGroup( addresses, "name", "description", ENCLAVE_PUBLIC_KEY1)) @@ -197,11 +193,7 @@ public void createPrivacyGroupDelegatesToPrivacyController() { public void deletesPrivacyGroupWhenEnclavePublicKeyInPrivacyGroup() { final PrivacyGroup privacyGroupWithEnclavePublicKey = new PrivacyGroup( - PRIVACY_GROUP_ID, - Type.PANTHEON, - "", - "", - List.of(ENCLAVE_PUBLIC_KEY1, ENCLAVE_PUBLIC_KEY2)); + PRIVACY_GROUP_ID, Type.BESU, "", "", List.of(ENCLAVE_PUBLIC_KEY1, ENCLAVE_PUBLIC_KEY2)); when(enclave.retrievePrivacyGroup(PRIVACY_GROUP_ID)) .thenReturn(privacyGroupWithEnclavePublicKey); when(privacyController.deletePrivacyGroup(PRIVACY_GROUP_ID, ENCLAVE_PUBLIC_KEY1)) @@ -217,7 +209,7 @@ public void deletesPrivacyGroupWhenEnclavePublicKeyInPrivacyGroup() { public void deletePrivacyGroupFailsWithValidationExceptionWhenPrivacyGroupDoesNotContainEnclavePublicKey() { final PrivacyGroup privacyGroupWithoutEnclavePublicKey = - new PrivacyGroup(PRIVACY_GROUP_ID, Type.PANTHEON, "", "", List.of(ENCLAVE_PUBLIC_KEY2)); + new PrivacyGroup(PRIVACY_GROUP_ID, Type.BESU, "", "", List.of(ENCLAVE_PUBLIC_KEY2)); when(enclave.retrievePrivacyGroup(PRIVACY_GROUP_ID)) .thenReturn(privacyGroupWithoutEnclavePublicKey); @@ -233,7 +225,7 @@ public void deletesPrivacyGroupWhenEnclavePublicKeyInPrivacyGroup() { public void findsPrivacyGroupWhenEnclavePublicKeyInAddresses() { final List addresses = List.of(ENCLAVE_PUBLIC_KEY1, ENCLAVE_PUBLIC_KEY2); final PrivacyGroup privacyGroup = - new PrivacyGroup(PRIVACY_GROUP_ID, Type.PANTHEON, "", "", List.of(ENCLAVE_PUBLIC_KEY2)); + new PrivacyGroup(PRIVACY_GROUP_ID, Type.BESU, "", "", List.of(ENCLAVE_PUBLIC_KEY2)); when(privacyController.findPrivacyGroup(addresses, ENCLAVE_PUBLIC_KEY1)) .thenReturn(new PrivacyGroup[] {privacyGroup}); @@ -285,11 +277,7 @@ public void determinesEeaNonceWhenPrivateFromMatchesEnclavePublicKey() { public void determineBesuNonceWhenEnclavePublicKeyInPrivacyGroup() { final PrivacyGroup privacyGroupWithEnclavePublicKey = new PrivacyGroup( - PRIVACY_GROUP_ID, - Type.PANTHEON, - "", - "", - List.of(ENCLAVE_PUBLIC_KEY1, ENCLAVE_PUBLIC_KEY2)); + PRIVACY_GROUP_ID, Type.BESU, "", "", List.of(ENCLAVE_PUBLIC_KEY1, ENCLAVE_PUBLIC_KEY2)); when(enclave.retrievePrivacyGroup(PRIVACY_GROUP_ID)) .thenReturn(privacyGroupWithEnclavePublicKey); when(privacyController.determineBesuNonce(Address.ZERO, PRIVACY_GROUP_ID, ENCLAVE_PUBLIC_KEY1)) @@ -307,7 +295,7 @@ public void determineBesuNonceWhenEnclavePublicKeyInPrivacyGroup() { public void determineBesuNonceFailsWithValidationExceptionWhenEnclavePublicKeyNotInPrivacyGroup() { final PrivacyGroup privacyGroupWithoutEnclavePublicKey = - new PrivacyGroup(PRIVACY_GROUP_ID, Type.PANTHEON, "", "", List.of(ENCLAVE_PUBLIC_KEY2)); + new PrivacyGroup(PRIVACY_GROUP_ID, Type.BESU, "", "", List.of(ENCLAVE_PUBLIC_KEY2)); when(enclave.retrievePrivacyGroup(PRIVACY_GROUP_ID)) .thenReturn(privacyGroupWithoutEnclavePublicKey); @@ -322,7 +310,7 @@ public void determineBesuNonceWhenEnclavePublicKeyInPrivacyGroup() { @Test public void simulatePrivateTransactionWorksForValidEnclaveKey() { final PrivacyGroup privacyGroupWithEnclavePublicKey = - new PrivacyGroup(PRIVACY_GROUP_ID, Type.PANTHEON, "", "", List.of(ENCLAVE_PUBLIC_KEY1)); + new PrivacyGroup(PRIVACY_GROUP_ID, Type.BESU, "", "", List.of(ENCLAVE_PUBLIC_KEY1)); when(enclave.retrievePrivacyGroup(PRIVACY_GROUP_ID)) .thenReturn(privacyGroupWithEnclavePublicKey); when(privacyController.simulatePrivateTransaction(any(), any(), any(), any(long.class))) @@ -344,7 +332,7 @@ public void simulatePrivateTransactionWorksForValidEnclaveKey() { @Test public void simulatePrivateTransactionFailsForInvalidEnclaveKey() { final PrivacyGroup privacyGroupWithEnclavePublicKey = - new PrivacyGroup(PRIVACY_GROUP_ID, Type.PANTHEON, "", "", List.of(ENCLAVE_PUBLIC_KEY1)); + new PrivacyGroup(PRIVACY_GROUP_ID, Type.BESU, "", "", List.of(ENCLAVE_PUBLIC_KEY1)); when(enclave.retrievePrivacyGroup(PRIVACY_GROUP_ID)) .thenReturn(privacyGroupWithEnclavePublicKey); diff --git a/ethereum/referencetests/src/test/resources b/ethereum/referencetests/src/test/resources index 6af0621522d..73bfbcc213e 160000 --- a/ethereum/referencetests/src/test/resources +++ b/ethereum/referencetests/src/test/resources @@ -1 +1 @@ -Subproject commit 6af0621522dd0274525457741291d391c10002be +Subproject commit 73bfbcc213efd7cabe678a46c83596024e85e2e2