Search in sources :

Example 51 with Response

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

the class VerifyGetBySolidityIdNotSupported method submitOp.

@Override
protected boolean submitOp(HapiApiSpec spec) {
    GetBySolidityIDQuery.Builder op = GetBySolidityIDQuery.newBuilder();
    Query query = Query.newBuilder().setGetBySolidityID(op).build();
    Response response = spec.clients().getScSvcStub(targetNodeFor(spec), useTls).getBySolidityID(query);
    Assertions.assertEquals(NOT_SUPPORTED, response.getGetBySolidityID().getHeader().getNodeTransactionPrecheckCode());
    return false;
}
Also used : Response(com.hederahashgraph.api.proto.java.Response) Query(com.hederahashgraph.api.proto.java.Query) GetBySolidityIDQuery(com.hederahashgraph.api.proto.java.GetBySolidityIDQuery) GetBySolidityIDQuery(com.hederahashgraph.api.proto.java.GetBySolidityIDQuery)

Example 52 with Response

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

the class VerifyGetStakersNotSupported method submitOp.

@Override
protected boolean submitOp(HapiApiSpec spec) throws Throwable {
    CryptoGetStakersQuery.Builder op = CryptoGetStakersQuery.newBuilder().setAccountID(asAccount("0.0.2"));
    Query query = Query.newBuilder().setCryptoGetProxyStakers(op).build();
    Response response = spec.clients().getCryptoSvcStub(targetNodeFor(spec), useTls).getStakersByAccountID(query);
    Assertions.assertEquals(NOT_SUPPORTED, response.getCryptoGetProxyStakers().getHeader().getNodeTransactionPrecheckCode());
    return false;
}
Also used : Response(com.hederahashgraph.api.proto.java.Response) CryptoGetStakersQuery(com.hederahashgraph.api.proto.java.CryptoGetStakersQuery) Query(com.hederahashgraph.api.proto.java.Query) CryptoGetStakersQuery(com.hederahashgraph.api.proto.java.CryptoGetStakersQuery)

Example 53 with Response

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

the class VerifyGetTokenNftInfosNotSupported method submitOp.

@Override
protected boolean submitOp(HapiApiSpec spec) throws Throwable {
    TokenGetNftInfosQuery.Builder op = TokenGetNftInfosQuery.newBuilder().setTokenID(asToken("0.0.1001"));
    Query query = Query.newBuilder().setTokenGetNftInfos(op).build();
    Response response = spec.clients().getTokenSvcStub(targetNodeFor(spec), useTls).getTokenNftInfos(query);
    Assertions.assertEquals(NOT_SUPPORTED, response.getTokenGetNftInfos().getHeader().getNodeTransactionPrecheckCode());
    return false;
}
Also used : Response(com.hederahashgraph.api.proto.java.Response) TokenGetNftInfosQuery(com.hederahashgraph.api.proto.java.TokenGetNftInfosQuery) Query(com.hederahashgraph.api.proto.java.Query) TokenGetNftInfosQuery(com.hederahashgraph.api.proto.java.TokenGetNftInfosQuery)

Example 54 with Response

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

the class HapiGetTokenNftInfo method lookupCostWith.

@Override
protected long lookupCostWith(HapiApiSpec spec, Transaction payment) throws Throwable {
    Query query = getTokenNftInfoQuery(spec, payment, true);
    Response response = spec.clients().getTokenSvcStub(targetNodeFor(spec), useTls).getTokenNftInfo(query);
    return costFrom(response);
}
Also used : Response(com.hederahashgraph.api.proto.java.Response) Query(com.hederahashgraph.api.proto.java.Query) TokenGetNftInfoQuery(com.hederahashgraph.api.proto.java.TokenGetNftInfoQuery)

Example 55 with Response

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

the class HapiGetTokenNftInfos method lookupCostWith.

@Override
protected long lookupCostWith(HapiApiSpec spec, Transaction payment) throws Throwable {
    Query query = getTokenNftInfosQuery(spec, payment, true);
    Response response = spec.clients().getTokenSvcStub(targetNodeFor(spec), useTls).getTokenNftInfos(query);
    return costFrom(response);
}
Also used : Response(com.hederahashgraph.api.proto.java.Response) Query(com.hederahashgraph.api.proto.java.Query) TokenGetNftInfosQuery(com.hederahashgraph.api.proto.java.TokenGetNftInfosQuery)

Aggregations

Response (com.hederahashgraph.api.proto.java.Response)114 Query (com.hederahashgraph.api.proto.java.Query)96 Test (org.junit.jupiter.api.Test)87 FileGetInfoResponse (com.hederahashgraph.api.proto.java.FileGetInfoResponse)9 ByteString (com.google.protobuf.ByteString)8 ContractCallLocalQuery (com.hederahashgraph.api.proto.java.ContractCallLocalQuery)8 TokenGetNftInfoQuery (com.hederahashgraph.api.proto.java.TokenGetNftInfoQuery)8 TokenGetNftInfoResponse (com.hederahashgraph.api.proto.java.TokenGetNftInfoResponse)8 TransactionGetReceiptResponse (com.hederahashgraph.api.proto.java.TransactionGetReceiptResponse)8 ContractCallLocalResponse (com.hederahashgraph.api.proto.java.ContractCallLocalResponse)7 ContractGetInfoQuery (com.hederahashgraph.api.proto.java.ContractGetInfoQuery)7 ContractGetInfoResponse (com.hederahashgraph.api.proto.java.ContractGetInfoResponse)7 NetworkGetExecutionTimeQuery (com.hederahashgraph.api.proto.java.NetworkGetExecutionTimeQuery)7 NetworkGetExecutionTimeResponse (com.hederahashgraph.api.proto.java.NetworkGetExecutionTimeResponse)7 ResponseCodeEnum (com.hederahashgraph.api.proto.java.ResponseCodeEnum)7 ScheduleGetInfoQuery (com.hederahashgraph.api.proto.java.ScheduleGetInfoQuery)7 ScheduleGetInfoResponse (com.hederahashgraph.api.proto.java.ScheduleGetInfoResponse)7 TokenGetInfoQuery (com.hederahashgraph.api.proto.java.TokenGetInfoQuery)7 TokenGetInfoResponse (com.hederahashgraph.api.proto.java.TokenGetInfoResponse)7 HashMap (java.util.HashMap)7