use of com.hedera.services.bdd.spec.queries.crypto.HapiGetAccountInfo in project hedera-services by hashgraph.
the class HapiCryptoUpdate method lookupInfo.
private CryptoGetInfoResponse.AccountInfo lookupInfo(HapiApiSpec spec) throws Throwable {
HapiGetAccountInfo subOp = getAccountInfo(account).noLogging();
Optional<Throwable> error = subOp.execFor(spec);
if (error.isPresent()) {
if (!loggingOff) {
log.warn("Unable to look up current account info!", error.get());
}
throw error.get();
}
return subOp.getResponse().getCryptoGetInfo().getAccountInfo();
}
use of com.hedera.services.bdd.spec.queries.crypto.HapiGetAccountInfo in project hedera-services by hashgraph.
the class HapiTokenAssociate method lookupExpiry.
private long lookupExpiry(HapiApiSpec spec) throws Throwable {
if (!spec.registry().hasContractId(account)) {
HapiGetAccountInfo subOp = getAccountInfo(account).noLogging();
Optional<Throwable> error = subOp.execFor(spec);
if (error.isPresent()) {
if (!loggingOff) {
log.warn("Unable to look up current info for " + HapiPropertySource.asAccountString(spec.registry().getAccountID(account)), error.get());
}
throw error.get();
}
return subOp.getResponse().getCryptoGetInfo().getAccountInfo().getExpirationTime().getSeconds();
} else {
HapiGetContractInfo subOp = getContractInfo(account).noLogging();
Optional<Throwable> error = subOp.execFor(spec);
if (error.isPresent()) {
if (!loggingOff) {
log.warn("Unable to look up current info for " + HapiPropertySource.asContractString(spec.registry().getContractId(account)), error.get());
}
throw error.get();
}
return subOp.getResponse().getContractGetInfo().getContractInfo().getExpirationTime().getSeconds();
}
}
Aggregations