use of com.hedera.services.bdd.spec.infrastructure.RegistryNotFound in project hedera-services by hashgraph.
the class HapiScheduleSign method opBodyDef.
@Override
protected Consumer<TransactionBody.Builder> opBodyDef(HapiApiSpec spec) throws Throwable {
ScheduleSignTransactionBody opBody = spec.txns().<ScheduleSignTransactionBody, ScheduleSignTransactionBody.Builder>body(ScheduleSignTransactionBody.class, b -> {
ScheduleID id;
try {
id = asScheduleId(schedule, spec);
b.setScheduleID(id);
} catch (RegistryNotFound e) {
if (!ignoreMissing) {
throw e;
}
}
});
return b -> b.setScheduleSign(opBody);
}
use of com.hedera.services.bdd.spec.infrastructure.RegistryNotFound in project hedera-services by hashgraph.
the class ParallelSpecOps method submitOp.
@Override
protected boolean submitOp(HapiApiSpec spec) throws Throwable {
Map<String, Throwable> subErrors = new HashMap<>();
CompletableFuture future = CompletableFuture.allOf(Stream.of(subs).map(op -> CompletableFuture.runAsync(() -> op.execFor(spec).map(t -> subErrors.put(op.toString(), t)))).toArray(n -> new CompletableFuture[n]));
future.join();
if (subErrors.size() > 0) {
String errMessages = subErrors.entrySet().stream().filter(e -> !(e.getValue() instanceof RegistryNotFound)).peek(e -> e.getValue().printStackTrace()).map(e -> e.getKey() + " :: " + e.getValue().getMessage()).collect(joining(", "));
if (errMessages.length() > 0) {
log.error("Problem(s) with sub-operation(s): {}", errMessages);
}
}
return false;
}
Aggregations