use of com.hederahashgraph.api.proto.java.Query in project hedera-services by hashgraph.
the class HapiGetScheduleInfo method submitWith.
@Override
protected void submitWith(HapiApiSpec spec, Transaction payment) throws Throwable {
Query query = getScheduleInfoQuery(spec, payment, false);
response = spec.clients().getScheduleSvcStub(targetNodeFor(spec), useTls).getScheduleInfo(query);
if (verboseLoggingOn) {
log.info("Info for '" + schedule + "': " + response.getScheduleGetInfo().getScheduleInfo());
}
}
use of com.hederahashgraph.api.proto.java.Query in project hedera-services by hashgraph.
the class HapiGetVersionInfo method submitWith.
@Override
protected void submitWith(HapiApiSpec spec, Transaction payment) {
Query query = getVersionInfoQuery(spec, payment, false);
response = spec.clients().getNetworkSvcStub(targetNodeFor(spec), useTls).getVersionInfo(query);
var info = response.getNetworkGetVersionInfo();
if (verboseLoggingOn) {
log.info("Versions :: HAPI protobufs @ " + asReadable(info.getHapiProtoVersion()) + ", Hedera Services @ " + asReadable(info.getHederaServicesVersion()));
}
if (yahcliLogger) {
COMMON_MESSAGES.info("Versions :: HAPI protobufs @ " + asReadable(info.getHapiProtoVersion()) + ", Hedera Services @ " + asReadable(info.getHederaServicesVersion()));
}
}
use of com.hederahashgraph.api.proto.java.Query in project hedera-services by hashgraph.
the class HapiGetVersionInfo method lookupCostWith.
@Override
protected long lookupCostWith(HapiApiSpec spec, Transaction payment) throws Throwable {
Query query = getVersionInfoQuery(spec, payment, true);
Response response = spec.clients().getNetworkSvcStub(targetNodeFor(spec), useTls).getVersionInfo(query);
return costFrom(response);
}
use of com.hederahashgraph.api.proto.java.Query in project hedera-services by hashgraph.
the class UsageBasedFeeCalculatorTest method setup.
@BeforeEach
private void setup() throws Throwable {
view = mock(StateView.class);
query = mock(Query.class);
payerKey = complexKey.asJKey();
exchange = mock(HbarCentExchange.class);
signedTxn = newSignedCryptoCreate().balance(balance).payerKt(complexKey).txnValidStart(at).get();
accessor = new SignedTxnAccessor(signedTxn);
usagePrices = mock(UsagePricesProvider.class);
given(usagePrices.activePrices(accessor)).willReturn(currentPrices);
correctOpEstimator = mock(TxnResourceUsageEstimator.class);
incorrectOpEstimator = mock(TxnResourceUsageEstimator.class);
correctQueryEstimator = mock(QueryResourceUsageEstimator.class);
incorrectQueryEstimator = mock(QueryResourceUsageEstimator.class);
autoRenewCalcs = mock(AutoRenewCalcs.class);
pricedUsageCalculator = mock(PricedUsageCalculator.class);
txnUsageEstimators = (Map<HederaFunctionality, List<TxnResourceUsageEstimator>>) mock(Map.class);
subject = new UsageBasedFeeCalculator(autoRenewCalcs, exchange, mock(AutoCreationLogic.class), usagePrices, new NestedMultiplierSource(), pricedUsageCalculator, Set.of(incorrectQueryEstimator, correctQueryEstimator), txnUsageEstimators);
}
use of com.hederahashgraph.api.proto.java.Query in project hedera-services by hashgraph.
the class HapiGetTopicInfo method lookupCostWith.
@Override
protected long lookupCostWith(HapiApiSpec spec, Transaction payment) throws Throwable {
Query query = getTopicInfoQuery(spec, payment, true);
Response response = spec.clients().getConsSvcStub(targetNodeFor(spec), useTls).getTopicInfo(query);
return costFrom(response);
}
Aggregations