use of com.hedera.services.bdd.suites.utils.validation.domain.ConsensusScenario in project hedera-services by hashgraph.
the class ValidationScenarios method consensusScenario.
private static HapiApiSpec consensusScenario() {
try {
ensureScenarios();
if (scenarios.getConsensus() == null) {
scenarios.setConsensus(new ConsensusScenario());
}
var consensus = scenarios.getConsensus();
var expectedSeqNo = new AtomicLong(0);
return customHapiSpec("ConsensusScenario").withProperties(Map.of("nodes", nodes(), "default.payer", primaryPayer(), "default.node", defaultNode(), "fees.useFixedOffer", "true", "fees.fixedOffer", "" + FEE_TO_OFFER, "startupAccounts.literal", payerKeystoreLiteral())).given(keyFromPem(() -> pemForAccount(targetNetwork().getScenarioPayer())).name(SCENARIO_PAYER_NAME).linkedTo(() -> String.format("0.0.%d", targetNetwork().getScenarioPayer())), ensureValidatedTopicExistence(PERSISTENT_TOPIC_NAME, pemForTopic(persistentTopicOrNegativeOne(consensus).getAsLong()), persistentTopicOrNegativeOne(consensus), consensus::setPersistent, expectedSeqNo)).when(flattened(submitMessageTo(PERSISTENT_TOPIC_NAME).payingWith(SCENARIO_PAYER_NAME).setNodeFrom(ValidationScenarios::nextNode).message("The particular is pounded till it is man."), novelTopicIfDesired())).then(getTopicInfo(PERSISTENT_TOPIC_NAME).payingWith(SCENARIO_PAYER_NAME).setNodeFrom(ValidationScenarios::nextNode).hasSeqNo(expectedSeqNo::get).logged());
} catch (Exception e) {
log.warn("Unable to initialize consensus scenario, skipping it!", e);
errorsOccurred.set(true);
return null;
}
}
Aggregations