Esempio n. 1
0
        public virtual Task <QueryResponse> GetQueryResultAsync(string channelId, string txId, string collection, string query, ByteString metadata, CancellationToken token = default(CancellationToken))
        {
            GetQueryResult gsr = new GetQueryResult {
                Query = query, Collection = collection
            };

            if (metadata != null)
            {
                gsr.Metadata = metadata;
            }
            return(InvokeQueryResponseMessageAsync(channelId, txId, ChaincodeMessage.Types.Type.GetQueryResult, gsr.ToByteString(), token));
        }
        public Task <StateQueryIterator> HandleGetQueryResult(
            string collection,
            string query,
            string channelId,
            string txId
            )
        {
            var payload = new GetQueryResult
            {
                Query      = query,
                Collection = collection
            };

            return(CreateMessageAndListen <StateQueryIterator>(MessageMethod.GetQueryResult,
                                                               ChaincodeMessage.Types.Type.GetQueryResult, payload, channelId, txId));
        }