use of com.hedera.services.bdd.suites.utils.validation.domain.Network in project hedera-services by hashgraph.
the class ValidationScenarios method updatePaymentCsv.
private static HapiApiSpec updatePaymentCsv() {
ensureScenarios();
if (scenarios.getFeeSnapshots() == null) {
scenarios.setFeeSnapshots(new FeeSnapshotsScenario());
}
var feeSnapshots = scenarios.getFeeSnapshots();
try {
return customHapiSpec("UpdatePaymentCsv").withProperties(Map.of("nodes", nodes(), "default.payer", primaryPayer(), "default.node", defaultNode(), "fees.useFixedOffer", "true", "fees.fixedOffer", "" + FEE_TO_OFFER, "startupAccounts.literal", payerKeystoreLiteral())).given().when().then(withOpContext((spec, opLog) -> {
var payments = HapiApiSpec.costSnapshotFrom("cost-snapshots/fees/ValidationScenarios-FeeSnapshots-costs.properties");
var network = params.getTargetNetwork();
var feesCsvLoc = String.format("fees/%s-fees.csv", network);
var csvFile = new File(feesCsvLoc);
if (!feeSnapshots.getAppendToSnapshotCsv() || !csvFile.exists()) {
createInitialFeesCsv(feesCsvLoc, payments, feeSnapshots);
} else {
appendToFeesCsv(feesCsvLoc, payments, feeSnapshots);
}
}));
} catch (Exception e) {
log.warn("Unable to ensure fee snapshots bytecode, skipping it!", e);
errorsOccurred.set(true);
return null;
}
}
Aggregations