use of com.hedera.services.bdd.suites.utils.validation.domain.FileScenario.PERSISTENT_FILE_NAME in project hedera-services by hashgraph.
the class ValidationScenarios method fileScenario.
private static HapiApiSpec fileScenario() {
try {
ensureScenarios();
if (scenarios.getFile() == null) {
var fs = new FileScenario();
fs.setPersistent(new PersistentFile());
scenarios.setFile(fs);
}
var file = scenarios.getFile();
return customHapiSpec("FileScenario").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())), ensureValidatedFileExistence(PERSISTENT_FILE_NAME, file.getPersistent().getContents(), pemForFile(persistentOrNegativeOne(file).getAsLong()), persistentOrNegativeOne(file), num -> file.getPersistent().setNum(num), loc -> file.getPersistent().setContents(loc))).when().then(novelFileIfDesired());
} catch (Exception e) {
log.warn("Unable to initialize file scenario, skipping it!", e);
errorsOccurred.set(true);
return null;
}
}
Aggregations