Search in sources :

Example 1 with VersionInfoScenario

use of com.hedera.services.bdd.suites.utils.validation.domain.VersionInfoScenario in project hedera-services by hashgraph.

the class ValidationScenarios method versionsScenario.

private static HapiApiSpec versionsScenario() {
    try {
        ensureScenarios();
        if (scenarios.getVersions() == null) {
            scenarios.setVersions(new VersionInfoScenario());
        }
        var versions = scenarios.getVersions();
        int[] hapiProto = Arrays.stream(versions.getHapiProtoSemVer().split("[.]")).mapToInt(Integer::parseInt).toArray();
        int[] services = Arrays.stream(versions.getServicesSemVer().split("[.]")).mapToInt(Integer::parseInt).toArray();
        return customHapiSpec("VersionsScenario").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()))).when().then(getVersionInfo().payingWith(SCENARIO_PAYER_NAME).setNodeFrom(ValidationScenarios::nextNode));
    } catch (Exception e) {
        log.warn("Unable to initialize versions scenario, skipping it!", e);
        errorsOccurred.set(true);
        return null;
    }
}
Also used : VersionInfoScenario(com.hedera.services.bdd.suites.utils.validation.domain.VersionInfoScenario) KeyStoreException(java.security.KeyStoreException) InvalidProtocolBufferException(com.google.protobuf.InvalidProtocolBufferException) IOException(java.io.IOException)

Aggregations

InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 VersionInfoScenario (com.hedera.services.bdd.suites.utils.validation.domain.VersionInfoScenario)1 IOException (java.io.IOException)1 KeyStoreException (java.security.KeyStoreException)1