use of com.hederahashgraph.api.proto.java.TransactionGetRecordQuery in project hedera-services by hashgraph.
the class HapiGetTxnRecord method getRecordQuery.
private Query getRecordQuery(HapiApiSpec spec, Transaction payment, boolean costOnly) {
TransactionID txnId = useDefaultTxnId ? defaultTxnId : explicitTxnId.orElseGet(() -> spec.registry().getTxnId(txn));
if (lookupScheduledFromRegistryId) {
txnId = spec.registry().getTxnId(correspondingScheduledTxnId(creationName.get()));
} else {
if (scheduled) {
txnId = txnId.toBuilder().setScheduled(true).build();
}
}
QueryHeader header;
if (costOnly && omitPaymentHeaderOnCostAnswer) {
header = QueryHeader.newBuilder().setResponseType(COST_ANSWER).build();
} else {
header = costOnly ? answerCostHeader(payment) : answerHeader(payment);
}
TransactionGetRecordQuery getRecordQuery = TransactionGetRecordQuery.newBuilder().setHeader(header).setTransactionID(txnId).setIncludeDuplicates(requestDuplicates).setIncludeChildRecords(requestChildRecords).build();
return Query.newBuilder().setTransactionGetRecord(getRecordQuery).build();
}
Aggregations