Search in sources :

Example 11 with ResponseType

use of com.hederahashgraph.api.proto.java.ResponseType in project hedera-services by hashgraph.

the class GetTokenNftInfosAnswer method responseGiven.

@Override
public Response responseGiven(Query query, StateView view, ResponseCodeEnum validity, long cost) {
    TokenGetNftInfosQuery op = query.getTokenGetNftInfos();
    TokenGetNftInfosResponse.Builder response = TokenGetNftInfosResponse.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().setTokenGetNftInfos(response).build();
}
Also used : TokenGetNftInfosQuery(com.hederahashgraph.api.proto.java.TokenGetNftInfosQuery) TokenGetNftInfosResponse(com.hederahashgraph.api.proto.java.TokenGetNftInfosResponse) ResponseType(com.hederahashgraph.api.proto.java.ResponseType)

Example 12 with ResponseType

use of com.hederahashgraph.api.proto.java.ResponseType in project hedera-services by hashgraph.

the class GetBySolidityIdAnswer method responseGiven.

@Override
public Response responseGiven(Query query, StateView view, ResponseCodeEnum validity, long cost) {
    GetBySolidityIDQuery op = query.getGetBySolidityID();
    ResponseType type = op.getHeader().getResponseType();
    GetBySolidityIDResponse.Builder response = GetBySolidityIDResponse.newBuilder();
    if (type == COST_ANSWER) {
        response.setHeader(costAnswerHeader(NOT_SUPPORTED, 0L));
    } else {
        response.setHeader(answerOnlyHeader(NOT_SUPPORTED));
    }
    return Response.newBuilder().setGetBySolidityID(response).build();
}
Also used : GetBySolidityIDResponse(com.hederahashgraph.api.proto.java.GetBySolidityIDResponse) GetBySolidityIDQuery(com.hederahashgraph.api.proto.java.GetBySolidityIDQuery) ResponseType(com.hederahashgraph.api.proto.java.ResponseType)

Aggregations

ResponseType (com.hederahashgraph.api.proto.java.ResponseType)12 AccountID (com.hederahashgraph.api.proto.java.AccountID)1 ConsensusGetTopicInfoQuery (com.hederahashgraph.api.proto.java.ConsensusGetTopicInfoQuery)1 ConsensusGetTopicInfoResponse (com.hederahashgraph.api.proto.java.ConsensusGetTopicInfoResponse)1 ContractGetRecordsQuery (com.hederahashgraph.api.proto.java.ContractGetRecordsQuery)1 ContractGetRecordsResponse (com.hederahashgraph.api.proto.java.ContractGetRecordsResponse)1 CryptoGetInfoQuery (com.hederahashgraph.api.proto.java.CryptoGetInfoQuery)1 CryptoGetInfoResponse (com.hederahashgraph.api.proto.java.CryptoGetInfoResponse)1 CryptoGetLiveHashQuery (com.hederahashgraph.api.proto.java.CryptoGetLiveHashQuery)1 CryptoGetLiveHashResponse (com.hederahashgraph.api.proto.java.CryptoGetLiveHashResponse)1 CryptoGetStakersQuery (com.hederahashgraph.api.proto.java.CryptoGetStakersQuery)1 CryptoGetStakersResponse (com.hederahashgraph.api.proto.java.CryptoGetStakersResponse)1 FileGetContentsResponse (com.hederahashgraph.api.proto.java.FileGetContentsResponse)1 FileGetInfoResponse (com.hederahashgraph.api.proto.java.FileGetInfoResponse)1 GetBySolidityIDQuery (com.hederahashgraph.api.proto.java.GetBySolidityIDQuery)1 GetBySolidityIDResponse (com.hederahashgraph.api.proto.java.GetBySolidityIDResponse)1 TokenGetAccountNftInfosQuery (com.hederahashgraph.api.proto.java.TokenGetAccountNftInfosQuery)1 TokenGetAccountNftInfosResponse (com.hederahashgraph.api.proto.java.TokenGetAccountNftInfosResponse)1 TokenGetNftInfosQuery (com.hederahashgraph.api.proto.java.TokenGetNftInfosQuery)1 TokenGetNftInfosResponse (com.hederahashgraph.api.proto.java.TokenGetNftInfosResponse)1