use of com.hederahashgraph.api.proto.java.Query in project hedera-services by hashgraph.
the class HapiGetFileInfo method submitWith.
@Override
protected void submitWith(HapiApiSpec spec, Transaction payment) throws Throwable {
Query query = getFileInfoQuery(spec, payment, false);
response = spec.clients().getFileSvcStub(targetNodeFor(spec), useTls).getFileInfo(query);
if (verboseLoggingOn) {
log.info("Info for file '" + file + "': " + response.getFileGetInfo());
}
if (saveFileInfoToReg.isPresent()) {
spec.registry().saveFileInfo(saveFileInfoToReg.get(), response.getFileGetInfo().getFileInfo());
}
}
use of com.hederahashgraph.api.proto.java.Query in project hedera-services by hashgraph.
the class HapiTxnOp method resolvedStatusOfSubmission.
private ResponseCodeEnum resolvedStatusOfSubmission(HapiApiSpec spec) throws Throwable {
long delayMS = spec.setup().statusPreResolvePauseMs();
long elapsedMS = System.currentTimeMillis() - submitTime;
if (elapsedMS <= delayMS) {
pause(delayMS - elapsedMS);
}
long beginWait = Instant.now().toEpochMilli();
Query receiptQuery = txnReceiptQueryFor(extractTxnId(txnSubmitted));
do {
Response response = statusResponse(spec, receiptQuery);
lastReceipt = response.getTransactionGetReceipt().getReceipt();
ResponseCodeEnum statusNow = lastReceipt.getStatus();
if (acceptAnyStatus) {
expectedStatus = Optional.of(statusNow);
return statusNow;
} else if (statusNow != UNKNOWN) {
if (acceptAnyKnownStatus) {
expectedStatus = Optional.of(statusNow);
}
return statusNow;
}
pause(spec.setup().statusWaitSleepMs());
} while ((Instant.now().toEpochMilli() - beginWait) < spec.setup().statusWaitTimeoutMs());
return UNKNOWN;
}
use of com.hederahashgraph.api.proto.java.Query in project hedera-services by hashgraph.
the class HapiGetAccountNftInfos method lookupCostWith.
@Override
protected long lookupCostWith(HapiApiSpec spec, Transaction payment) throws Throwable {
Query query = getAccountNftInfosQuery(spec, payment, true);
Response response = spec.clients().getTokenSvcStub(targetNodeFor(spec), useTls).getAccountNftInfos(query);
return costFrom(response);
}
use of com.hederahashgraph.api.proto.java.Query in project hedera-services by hashgraph.
the class HapiGetTokenInfo method submitWith.
@Override
protected void submitWith(HapiApiSpec spec, Transaction payment) {
Query query = getTokenInfoQuery(spec, payment, false);
response = spec.clients().getTokenSvcStub(targetNodeFor(spec), useTls).getTokenInfo(query);
if (verboseLoggingOn) {
log.info("Info for '" + token + "': " + response.getTokenGetInfo().getTokenInfo());
}
}
use of com.hederahashgraph.api.proto.java.Query in project hedera-services by hashgraph.
the class HapiGetTokenInfo method lookupCostWith.
@Override
protected long lookupCostWith(HapiApiSpec spec, Transaction payment) throws Throwable {
Query query = getTokenInfoQuery(spec, payment, true);
Response response = spec.clients().getTokenSvcStub(targetNodeFor(spec), useTls).getTokenInfo(query);
return costFrom(response);
}
Aggregations