use of com.quorum.gauge.ext.EthChainId in project quorum-acceptance-tests by ConsenSys.
the class MultiTenancy method deployPublicContract.
@Step("`<clientName>` deploys a <contractId> public contract, named <contractName>, by sending a transaction to `<node>`")
public void deployPublicContract(String clientName, String contractId, String contractName, QuorumNetworkProperty.Node node) {
Contract contract = requestAccessToken(clientName).flatMap(accessToken -> rpcService.call(node, "eth_chainId", Collections.emptyList(), EthChainId.class)).flatMap(ethChainId -> rawContractService.createRawSimplePublicContract(42, networkProperty.getWallets().get("Wallet1"), node, ethChainId.getChainId())).doOnTerminate(Context::removeAccessToken).doOnNext(c -> {
if (c == null || !c.getTransactionReceipt().isPresent()) {
throw new RuntimeException("contract not deployed");
}
}).blockingFirst();
logger.debug("Saving contract address {} with name {}", contract.getContractAddress(), contractName);
DataStoreFactory.getScenarioDataStore().put(contractName, contract);
}
Aggregations