use of com.hederahashgraph.api.proto.java.ContractGetRecordsQuery in project hedera-services by hashgraph.
the class GetContractRecordsAnswer method responseGiven.
@Override
public Response responseGiven(Query query, StateView view, ResponseCodeEnum validity, long cost) {
ContractGetRecordsQuery op = query.getContractGetRecords();
ContractGetRecordsResponse.Builder response = ContractGetRecordsResponse.newBuilder();
ResponseType type = op.getHeader().getResponseType();
if (type == COST_ANSWER) {
response.setHeader(costAnswerHeader(NOT_SUPPORTED, 0L));
} else {
response.setHeader(answerOnlyHeader(NOT_SUPPORTED));
}
return Response.newBuilder().setContractGetRecordsResponse(response).build();
}
use of com.hederahashgraph.api.proto.java.ContractGetRecordsQuery in project hedera-services by hashgraph.
the class HapiGetContractRecords method getContractRecordsQuery.
private Query getContractRecordsQuery(HapiApiSpec spec, Transaction payment, boolean costOnly) {
var id = TxnUtils.asContractId(contract, spec);
ContractGetRecordsQuery opQuery = ContractGetRecordsQuery.newBuilder().setHeader(costOnly ? answerCostHeader(payment) : answerHeader(payment)).setContractID(id).build();
return Query.newBuilder().setContractGetRecords(opQuery).build();
}
Aggregations