use of com.hedera.services.bdd.spec.queries.file.HapiGetFileInfo in project hedera-services by hashgraph.
the class TxnUtils method currExpiry.
public static Timestamp currExpiry(String file, HapiApiSpec spec, String payer) throws Throwable {
HapiGetFileInfo subOp = getFileInfo(file).payingWith(payer).noLogging();
Optional<Throwable> error = subOp.execFor(spec);
if (error.isPresent()) {
log.error("Unable to look up current expiration timestamp of file 0.0." + spec.registry().getFileId(file).getFileNum());
throw error.get();
}
return subOp.getResponse().getFileGetInfo().getFileInfo().getExpirationTime();
}
use of com.hedera.services.bdd.spec.queries.file.HapiGetFileInfo in project hedera-services by hashgraph.
the class HapiFileUpdate method lookupInfo.
private FileGetInfoResponse.FileInfo lookupInfo(HapiApiSpec spec) throws Throwable {
HapiGetFileInfo subOp = getFileInfo(file).noLogging().fee(ONE_HBAR);
Optional<Throwable> error = subOp.execFor(spec);
if (error.isPresent()) {
if (!loggingOff) {
log.warn("Unable to look up current file info!", error.get());
}
throw error.get();
}
return subOp.getResponse().getFileGetInfo().getFileInfo();
}
Aggregations