use of org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.privacy.PrivateTransactionResult in project besu by hyperledger.
the class PrivGetPrivateTransactionTest method returnsPrivateTransactionLegacy.
@Test
public void returnsPrivateTransactionLegacy() {
final PrivateTransaction legacyPrivateTransaction = PrivateTransactionDataFixture.privateTransactionLegacy();
final ExecutedPrivateTransaction executedPrivateTransaction = createExecutedPrivateTransaction(legacyPrivateTransaction);
when(privacyController.findPrivateTransactionByPmtHash(any(), any())).thenReturn(Optional.of(executedPrivateTransaction));
final PrivateTransactionLegacyResult expectedResult = new PrivateTransactionLegacyResult(legacyPrivateTransaction);
final JsonRpcRequestContext request = createRequestContext();
final PrivateTransactionResult result = makeRequest(request);
assertThat(result).usingRecursiveComparison().isEqualTo(expectedResult);
}
use of org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.privacy.PrivateTransactionResult in project besu by hyperledger.
the class PrivGetPrivateTransactionTest method returnsPrivateTransactionGroup.
@Test
public void returnsPrivateTransactionGroup() {
final PrivateTransaction privateTransaction = PrivateTransactionDataFixture.privateTransactionBesu();
final ExecutedPrivateTransaction executedPrivateTransaction = createExecutedPrivateTransaction(privateTransaction);
when(privacyController.findPrivateTransactionByPmtHash(any(), any())).thenReturn(Optional.of(executedPrivateTransaction));
final PrivateTransactionGroupResult expectedResult = new PrivateTransactionGroupResult(privateTransaction);
final JsonRpcRequestContext request = createRequestContext();
final PrivateTransactionResult result = makeRequest(request);
assertThat(result).usingRecursiveComparison().isEqualTo(expectedResult);
}
use of org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.privacy.PrivateTransactionResult in project besu by hyperledger.
the class PrivGetPrivateTransactionTest method makeRequest.
private PrivateTransactionResult makeRequest(final JsonRpcRequestContext request) {
final PrivGetPrivateTransaction privGetPrivateTransaction = new PrivGetPrivateTransaction(privacyController, privacyIdProvider);
final JsonRpcSuccessResponse response = (JsonRpcSuccessResponse) privGetPrivateTransaction.response(request);
return (PrivateTransactionResult) response.getResult();
}
Aggregations