use of com.hedera.services.bdd.suites.utils.validation.domain.SysFilesUpScenario in project hedera-services by hashgraph.
the class ValidationScenarios method sysFilesUp.
private static HapiApiSpec sysFilesUp() {
ensureScenarios();
if (scenarios.getSysFilesUp() == null) {
scenarios.setSysFilesUp(new SysFilesUpScenario());
}
var sys = scenarios.getSysFilesUp();
long[] payers = sys.getUpdates().stream().mapToLong(UpdateAction::getPayer).toArray();
try {
return customHapiSpec("SysFilesUp").withProperties(Map.of("nodes", nodes(), "default.payer", primaryPayer(), "default.node", defaultNode(), "fees.useFixedOffer", "true", "fees.fixedOffer", "" + FEE_TO_OFFER, "startupAccounts.literal", payerKeystoreLiteral())).given(LongStream.of(payers).mapToObj(payer -> keyFromPem(() -> pemForAccount(payer)).name(String.format("payer%d", payer)).passphrase(passphraseFor(payer)).linkedTo(() -> String.format("0.0.%d", payer))).toArray(HapiSpecOperation[]::new)).when().then(sys.getUpdates().stream().map(action -> updateLargeFile(String.format("payer%d", action.getPayer()), String.format("0.0.%d", action.getNum()), appropriateContents(action.getNum()), true, OptionalLong.of(10_000_000_000L))).toArray(HapiSpecOperation[]::new));
} catch (Exception e) {
log.warn("Unable to initialize system file update scenario, skipping it!", e);
errorsOccurred.set(true);
return null;
}
}
Aggregations