Search in sources :

Example 1 with HapiGetFileInfo

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();
}
Also used : HapiGetFileInfo(com.hedera.services.bdd.spec.queries.file.HapiGetFileInfo)

Example 2 with HapiGetFileInfo

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();
}
Also used : HapiGetFileInfo(com.hedera.services.bdd.spec.queries.file.HapiGetFileInfo)

Aggregations

HapiGetFileInfo (com.hedera.services.bdd.spec.queries.file.HapiGetFileInfo)2