Skip to content

Commit

Permalink
modified acceptance test
Browse files Browse the repository at this point in the history
Signed-off-by: Nischal Sharma <[email protected]>
  • Loading branch information
NickSneo committed Nov 23, 2023
1 parent d390420 commit d575a2c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package org.hyperledger.besu.tests.acceptance.dsl.privacy.transaction;

import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.ethereum.privacy.PrivacyGroupUtil;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.condition.PrivGetTransactionReceiptTransaction;
Expand Down Expand Up @@ -118,8 +117,8 @@ public PrivGetLogsTransaction privGetLogs(
}

public PrivTraceTransaction privTraceTrasnaction(
final String privacyGroupId, final Hash transactionhash) {
return new PrivTraceTransaction(privacyGroupId, transactionhash);
final String privacyGroupId, final String transactionHash) {
return new PrivTraceTransaction(privacyGroupId, transactionHash);
}

public RemoveFromFlexiblePrivacyGroupTransaction removeFromPrivacyGroup(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static org.assertj.core.api.Assertions.assertThat;

import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.tests.acceptance.dsl.transaction.NodeRequests;
import org.hyperledger.besu.tests.acceptance.dsl.transaction.Transaction;

Expand All @@ -25,9 +24,9 @@
public class PrivTraceTransaction implements Transaction<String> {

private final String privacyGroupId;
private final Hash transactionHash;
private final String transactionHash;

public PrivTraceTransaction(final String privacyGroupId, final Hash transactionHash) {
public PrivTraceTransaction(final String privacyGroupId, final String transactionHash) {
this.privacyGroupId = privacyGroupId;
this.transactionHash = transactionHash;
}
Expand All @@ -41,7 +40,7 @@ public String execute(final NodeRequests node) {
assertThat(response).as("check response is not null").isNotNull();
assertThat(response.getResult()).as("check result in response isn't null").isNotNull();

return response.getRawResponse();
return response.getResult();
} catch (final IOException e) {
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ public Request<?, EthLog> privGetLogs(
}

public Request<?, PrivTraceTransaction> privTraceTransaction(
final String privacyGroupId, final Hash transactionHash) {
final String privacyGroupId, final String transactionHash) {

return new Request<>(
"priv_traceTransaction",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.web3j.utils.Restriction.UNRESTRICTED;

import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.ParameterizedEnclaveTestBase;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode;
import org.hyperledger.besu.tests.acceptance.dsl.privacy.account.PrivacyAccountResolver;
Expand Down Expand Up @@ -65,7 +64,7 @@ public void getTransactionTrace() {
/*
Updating the contract value
*/
Hash transactionHash = doTransaction(privacyGroupId, simpleStorageContract, 1);
String transactionHash = doTransaction(privacyGroupId, simpleStorageContract, 1);

final String result =
node.execute(privacyTransactions.privTraceTrasnaction(privacyGroupId, transactionHash));
Expand Down Expand Up @@ -96,18 +95,15 @@ private SimpleStorage deploySimpleStorageContract(final String privacyGroupId) {
return simpleStorage;
}

private Hash doTransaction(
private String doTransaction(
final String privacyGroupId, final SimpleStorage simpleStorageContract, final int value) {
final String transactionHash =
node.execute(
privateContractTransactions.callSmartContractWithPrivacyGroupId(
simpleStorageContract.getContractAddress(),
simpleStorageContract.set(BigInteger.valueOf(value)).encodeFunctionCall(),
node.getTransactionSigningKey(),
restriction,
node.getEnclaveKey(),
privacyGroupId));

return Hash.fromHexString(transactionHash);
return node.execute(
privateContractTransactions.callSmartContractWithPrivacyGroupId(
simpleStorageContract.getContractAddress(),
simpleStorageContract.set(BigInteger.valueOf(value)).encodeFunctionCall(),
node.getTransactionSigningKey(),
restriction,
node.getEnclaveKey(),
privacyGroupId));
}
}

0 comments on commit d575a2c

Please sign in to comment.