From 22a60f38fda4d35e5722d2a244f9462a7ab8f726 Mon Sep 17 00:00:00 2001 From: Mateusz Galazyn Date: Fri, 3 Jul 2026 18:50:51 +0200 Subject: [PATCH] feat(cardano): make FetchBlock and ReadData single-item operations --- proto/utxorpc/v1/query/query.proto | 10 +++++----- proto/utxorpc/v1/sync/sync.proto | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/proto/utxorpc/v1/query/query.proto b/proto/utxorpc/v1/query/query.proto index b07a363..defa6bb 100644 --- a/proto/utxorpc/v1/query/query.proto +++ b/proto/utxorpc/v1/query/query.proto @@ -150,9 +150,9 @@ message SearchUtxosResponse { optional string next_token = 3; // Token to retrieve the next page of results, absent if there are no more results. } -// Request to get data (as in plural of datum) +// Request to get a datum message ReadDataRequest { - repeated bytes keys = 1; + bytes key = 1; // Hash of the datum to fetch. google.protobuf.FieldMask field_mask = 2; // Field mask to selectively return fields in the response. } @@ -165,9 +165,9 @@ message AnyChainDatum { } } -// Response containing data (as in plural of datum) +// Response containing the requested datum message ReadDataResponse { - repeated AnyChainDatum values = 1; // The value of each datum. + AnyChainDatum value = 1; // The value of the datum. ChainPoint ledger_tip = 2; // The chain point that represent the ledger current position. } @@ -197,7 +197,7 @@ service QueryService { rpc ReadParams(ReadParamsRequest) returns (ReadParamsResponse); // Get overall chain state. rpc ReadUtxos(ReadUtxosRequest) returns (ReadUtxosResponse); // Read specific UTxOs by reference. rpc SearchUtxos(SearchUtxosRequest) returns (SearchUtxosResponse); // Search for UTxO based on a pattern. - rpc ReadData(ReadDataRequest) returns (ReadDataResponse); // Read specific datum by hash + rpc ReadData(ReadDataRequest) returns (ReadDataResponse); // Read a specific datum by hash rpc ReadTx(ReadTxRequest) returns (ReadTxResponse); // Get Txs by chain-specific criteria. rpc ReadGenesis(ReadGenesisRequest) returns (ReadGenesisResponse); // Get the genesis configuration rpc ReadEraSummary(ReadEraSummaryRequest) returns (ReadEraSummaryResponse); // Get the chain era summary diff --git a/proto/utxorpc/v1/sync/sync.proto b/proto/utxorpc/v1/sync/sync.proto index f2ca2fc..bd8e659 100644 --- a/proto/utxorpc/v1/sync/sync.proto +++ b/proto/utxorpc/v1/sync/sync.proto @@ -22,13 +22,13 @@ message AnyChainBlock { // Request to fetch a block by its reference. message FetchBlockRequest { - repeated BlockRef ref = 1; // List of block references. + BlockRef ref = 1; // Block reference to fetch. google.protobuf.FieldMask field_mask = 2; // Field mask to selectively return fields. } -// Response containing the fetched blocks. +// Response containing the fetched block. message FetchBlockResponse { - repeated AnyChainBlock block = 1; // List of fetched blocks. + AnyChainBlock block = 1; // The fetched block. } // Request to dump the block history.