Always show privacyGroupId on PrivateTransactionReceipt (#3544)

- This is to provide a clearer way of knowing which
privacyGroupId a private transaction ended up in.

Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>

Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
pull/3556/head
Antony Denyer 3 years ago committed by GitHub
parent 1adc58d5b9
commit 64ec6c763e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/PrivacyClusterAcceptanceTest.java
  2. 6
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/privacy/PrivateTransactionReceiptResult.java

@ -220,7 +220,7 @@ public class PrivacyClusterAcceptanceTest extends PrivacyAcceptanceTestBase {
"A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo=",
new ArrayList<>(
Collections.singletonList("Ko2bVqD+nNlNYL5EE7y3IdOnviftjiizpjRt+HTuFBs=")),
null,
"DyAOiF/ynpc+JXa2YAGB0bCitSlOMNm+ShmB/7M6C4w=",
"0x1",
null);

@ -17,6 +17,7 @@ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.privacy;
import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.Quantity;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.TransactionReceiptLogResult;
import org.hyperledger.besu.ethereum.privacy.PrivacyGroupUtil;
import org.hyperledger.besu.evm.log.Log;
import org.hyperledger.besu.evm.log.LogsBloomFilter;
@ -91,7 +92,10 @@ public class PrivateTransactionReceiptResult {
privateFor != null
? privateFor.stream().map(Bytes::toBase64String).collect(Collectors.toList())
: null;
this.privacyGroupId = privacyGroupId != null ? privacyGroupId.toBase64String() : null;
this.privacyGroupId =
privacyGroupId != null
? privacyGroupId.toBase64String()
: PrivacyGroupUtil.calculateEeaPrivacyGroupId(privateFrom, privateFor).toBase64String();
this.revertReason = revertReason != null ? revertReason.toString() : null;
this.status = status;
this.logs = logReceipts(logs, blockNumber, commitmentHash, blockHash, txIndex);

Loading…
Cancel
Save