Search in sources :

Example 1 with PrivateLogsSubscription

use of org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.logs.PrivateLogsSubscription in project besu by hyperledger.

the class SubscriptionBuilderTest method shouldBuildPrivateLogsSubscriptionWhenSubscribeRequestTypeIsPrivateLogs.

@Test
public void shouldBuildPrivateLogsSubscriptionWhenSubscribeRequestTypeIsPrivateLogs() {
    final String privacyGroupId = "ZDmkMK7CyxA1F1rktItzKFTfRwApg7aWzsTtm2IOZ5Y=";
    final String enclavePublicKey = "C1bVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo=";
    final FilterParameter filterParameter = filterParameter();
    final PrivateSubscribeRequest subscribeRequest = new PrivateSubscribeRequest(SubscriptionType.LOGS, filterParameter, null, CONNECTION_ID, privacyGroupId, enclavePublicKey);
    final PrivateLogsSubscription expectedSubscription = new PrivateLogsSubscription(1L, CONNECTION_ID, filterParameter, privacyGroupId, enclavePublicKey);
    final Subscription builtSubscription = subscriptionBuilder.build(1L, CONNECTION_ID, subscribeRequest);
    assertThat(builtSubscription).usingRecursiveComparison().isEqualTo(expectedSubscription);
}
Also used : PrivateLogsSubscription(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.logs.PrivateLogsSubscription) PrivateSubscribeRequest(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.request.PrivateSubscribeRequest) SyncingSubscription(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.syncing.SyncingSubscription) LogsSubscription(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.logs.LogsSubscription) NewBlockHeadersSubscription(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.blockheaders.NewBlockHeadersSubscription) PrivateLogsSubscription(org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.logs.PrivateLogsSubscription) FilterParameter(org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.FilterParameter) Test(org.junit.Test)

Aggregations

FilterParameter (org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.FilterParameter)1 NewBlockHeadersSubscription (org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.blockheaders.NewBlockHeadersSubscription)1 LogsSubscription (org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.logs.LogsSubscription)1 PrivateLogsSubscription (org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.logs.PrivateLogsSubscription)1 PrivateSubscribeRequest (org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.request.PrivateSubscribeRequest)1 SyncingSubscription (org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.syncing.SyncingSubscription)1 Test (org.junit.Test)1