-
Notifications
You must be signed in to change notification settings - Fork 884
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow unlocking onchain privacy groups (#2717)
* allow onchain privacy group proxy calls under group lock Prior to this commit, the only allowed transactions in locked onchain privacy groups were those making the addParticipants call to *any* contract--not just the proxy. This commit ensures that: - while locked, only the group management proxy can be called - while locked, all functions of the management proxy can be called Corollary, this commit allows unlocking a group using unlock instead of implicitely unlocking it via addParticipants. This fixes #2693. Signed-off-by: Taccat Isid <taccatisid@protonmail.com> * add acceptance test asserting that privacy groups can be unlocked Signed-off-by: Taccat Isid <taccatisid@protonmail.com> Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
- Loading branch information
1 parent
ce1c8ef
commit 62c4115
Showing
8 changed files
with
172 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...r/besu/tests/acceptance/dsl/privacy/transaction/UnlockOnChainPrivacyGroupTransaction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright ConsenSys AG. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package org.hyperledger.besu.tests.acceptance.dsl.privacy.transaction; | ||
|
||
import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode; | ||
import org.hyperledger.besu.tests.acceptance.dsl.transaction.NodeRequests; | ||
import org.hyperledger.besu.tests.acceptance.dsl.transaction.Transaction; | ||
|
||
import java.io.IOException; | ||
|
||
import org.web3j.crypto.Credentials; | ||
import org.web3j.protocol.exceptions.TransactionException; | ||
import org.web3j.utils.Base64String; | ||
|
||
public class UnlockOnChainPrivacyGroupTransaction implements Transaction<String> { | ||
private final Base64String privacyGroupId; | ||
private final PrivacyNode locker; | ||
private final Credentials signer; | ||
|
||
public UnlockOnChainPrivacyGroupTransaction( | ||
final String privacyGroupId, final PrivacyNode locker, final Credentials signer) { | ||
this.privacyGroupId = Base64String.wrap(privacyGroupId); | ||
this.locker = locker; | ||
this.signer = signer; | ||
} | ||
|
||
@Override | ||
public String execute(final NodeRequests node) { | ||
try { | ||
return node.privacy().privxUnlockPrivacyGroup(locker, privacyGroupId, signer); | ||
} catch (final IOException | TransactionException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters