use of org.hyperledger.besu.ethereum.privacy.PrivacyController in project besu by hyperledger.
the class PrivateWebSocketMethodsFactory method methods.
public Collection<JsonRpcMethod> methods() {
final SubscriptionRequestMapper subscriptionRequestMapper = new SubscriptionRequestMapper();
final PrivacyIdProvider privacyIdProvider = PrivacyIdProvider.build(privacyParameters);
final PrivacyController privacyController = createPrivacyController();
return Set.of(new PrivSubscribe(subscriptionManager, subscriptionRequestMapper, privacyController, privacyIdProvider), new PrivUnsubscribe(subscriptionManager, subscriptionRequestMapper, privacyController, privacyIdProvider));
}
use of org.hyperledger.besu.ethereum.privacy.PrivacyController in project besu by hyperledger.
the class PrivacyApiGroupJsonRpcMethods method create.
@Override
protected Map<String, JsonRpcMethod> create() {
final PrivateMarkerTransactionFactory markerTransactionFactory = createPrivateMarkerTransactionFactory();
final PrivacyIdProvider enclavePublicProvider = PrivacyIdProvider.build(privacyParameters);
final PrivacyController privacyController = createPrivacyController();
return create(privacyController, enclavePublicProvider, markerTransactionFactory).entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> createPrivacyMethod(privacyParameters, entry.getValue())));
}
use of org.hyperledger.besu.ethereum.privacy.PrivacyController in project besu by hyperledger.
the class PrivacyApiGroupJsonRpcMethodsTest method rpcsCreatedWithMultiTenancyUseMultiTenancyController.
@Test
public void rpcsCreatedWithMultiTenancyUseMultiTenancyController() {
when(privacyParameters.isEnabled()).thenReturn(true);
when(privacyParameters.isMultiTenancyEnabled()).thenReturn(true);
privacyApiGroupJsonRpcMethods.create();
final PrivacyController privacyController = privacyApiGroupJsonRpcMethods.privacyController;
assertThat(privacyController).isInstanceOf(MultiTenancyPrivacyController.class);
}
use of org.hyperledger.besu.ethereum.privacy.PrivacyController in project besu by hyperledger.
the class PrivJsonRpcMethods method create.
@Override
protected Map<String, JsonRpcMethod> create(final PrivacyController privacyController, final PrivacyIdProvider privacyIdProvider, final PrivateMarkerTransactionFactory privateMarkerTransactionFactory) {
final Map<String, JsonRpcMethod> RPC_METHODS = mapOf(new PrivCall(getBlockchainQueries(), privacyController, privacyIdProvider), new PrivDebugGetStateRoot(getBlockchainQueries(), privacyIdProvider, privacyController), new PrivDistributeRawTransaction(privacyController, privacyIdProvider, getPrivacyParameters().isFlexiblePrivacyGroupsEnabled()), new PrivGetCode(getBlockchainQueries(), privacyController, privacyIdProvider), new PrivGetLogs(getBlockchainQueries(), getPrivacyQueries(), privacyController, privacyIdProvider), new PrivGetPrivateTransaction(privacyController, privacyIdProvider), new PrivGetPrivacyPrecompileAddress(getPrivacyParameters()), new PrivGetTransactionCount(privacyController, privacyIdProvider), new PrivGetTransactionReceipt(getPrivacyParameters().getPrivateStateStorage(), privacyController, privacyIdProvider), new PrivGetFilterLogs(filterManager, privacyController, privacyIdProvider), new PrivGetFilterChanges(filterManager, privacyController, privacyIdProvider), new PrivNewFilter(filterManager, privacyController, privacyIdProvider), new PrivUninstallFilter(filterManager, privacyController, privacyIdProvider));
if (!getPrivacyParameters().isFlexiblePrivacyGroupsEnabled()) {
final Map<String, JsonRpcMethod> OFFCHAIN_METHODS = mapOf(new PrivCreatePrivacyGroup(privacyController, privacyIdProvider), new PrivDeletePrivacyGroup(privacyController, privacyIdProvider), new PrivFindPrivacyGroup(privacyController, privacyIdProvider));
OFFCHAIN_METHODS.forEach((key, jsonRpcMethod) -> RPC_METHODS.merge(key, jsonRpcMethod, (oldVal, newVal) -> newVal));
}
return RPC_METHODS;
}
Aggregations