use of com.hederahashgraph.api.proto.java.Response in project hedera-services by hashgraph.
the class HapiGetContractInfo method lookupCostWith.
@Override
protected long lookupCostWith(HapiApiSpec spec, Transaction payment) throws Throwable {
Query query = getContractInfoQuery(spec, payment, true);
Response response = spec.clients().getScSvcStub(targetNodeFor(spec), useTls).getContractInfo(query);
return costFrom(response);
}
use of com.hederahashgraph.api.proto.java.Response in project hedera-services by hashgraph.
the class HapiGetContractRecords method lookupCostWith.
@Override
protected long lookupCostWith(HapiApiSpec spec, Transaction payment) throws Throwable {
Query query = getContractRecordsQuery(spec, payment, true);
Response response = spec.clients().getScSvcStub(targetNodeFor(spec), useTls).getTxRecordByContractID(query);
return costFrom(response);
}
use of com.hederahashgraph.api.proto.java.Response in project hedera-services by hashgraph.
the class HapiGetExecTime method lookupCostWith.
@Override
protected long lookupCostWith(HapiApiSpec spec, Transaction payment) throws Throwable {
Query query = getExecTimesQuery(spec, payment, true);
Response response = spec.clients().getNetworkSvcStub(targetNodeFor(spec), useTls).getExecutionTime(query);
return costFrom(response);
}
use of com.hederahashgraph.api.proto.java.Response in project hedera-services by hashgraph.
the class HapiGetFileInfo method lookupCostWith.
@Override
protected long lookupCostWith(HapiApiSpec spec, Transaction payment) throws Throwable {
Query query = getFileInfoQuery(spec, payment, true);
Response response = spec.clients().getFileSvcStub(targetNodeFor(spec), useTls).getFileInfo(query);
return costFrom(response);
}
use of com.hederahashgraph.api.proto.java.Response in project hedera-services by hashgraph.
the class ContractCallLocalAnswerTest method noCopyPasteErrors.
@Test
void noCopyPasteErrors() throws Throwable {
// given:
Query query = validQuery(COST_ANSWER, fee);
// when:
Response response = subject.responseGiven(query, view, INSUFFICIENT_TX_FEE, fee);
// then:
assertEquals(HederaFunctionality.ContractCallLocal, subject.canonicalFunction());
assertEquals(paymentTxn, subject.extractPaymentFrom(query).get().getSignedTxnWrapper());
assertTrue(subject.needsAnswerOnlyCost(query));
assertFalse(subject.requiresNodePayment(query));
assertEquals(INSUFFICIENT_TX_FEE, subject.extractValidityFrom(response));
}
Aggregations