Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cardano-rpc/proto/utxorpc/v1alpha/cardano/cardano.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ message TxOutput {
Script script = 5; // Script associated with the output.
}

// TODO u5c: new type - https://github.com/utxorpc/spec/pull/167
message AddressArray {
repeated bytes items = 1;
}

// TODO u5c: replaced plutus_data with just bytes
message Datum {
bytes hash = 1; // Hash of this datum as seen on-chain
Expand Down
11 changes: 3 additions & 8 deletions cardano-rpc/proto/utxorpc/v1alpha/query/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ message TxoRef {
}

message TxoRefArray {
// TODO u5c: changed to repeated
// TODO u5c: changed to repeated - https://github.com/utxorpc/spec/pull/167
repeated TxoRef items = 1;
}

Expand All @@ -44,11 +44,6 @@ message ReadParamsResponse {
ChainPoint ledger_tip = 2; // The chain point that represent the ledger current position.
}

// TODO u5c: new type
message AddressArray {
repeated bytes items = 1;
}

// An evenlope that holds an UTxO from any of compatible chains
message AnyUtxoData {
bytes native_bytes = 1; // Original bytes as defined by the chain
Expand All @@ -60,10 +55,10 @@ message AnyUtxoData {

// Request to get specific UTxOs
message ReadUtxosRequest {
// TODO u5c: new oneof
// TODO u5c: new oneof - https://github.com/utxorpc/spec/pull/167
oneof query_args {
TxoRefArray txoRefs = 1; // Array of Tx Output references
AddressArray addresses = 2; // Array of addresses
utxorpc.v1alpha.cardano.AddressArray cardano_addresses = 2; // Array of addresses
}
google.protobuf.FieldMask field_mask = 3; // Field mask to selectively return fields.
}
Expand Down
4 changes: 2 additions & 2 deletions cardano-rpc/proto/utxorpc/v1alpha/submit/submit.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ message SubmitTxRequest {
repeated AnyChainTx tx = 1; // List of transactions to submit.
}

// TODO u5c: new type
// TODO u5c: new type - https://github.com/utxorpc/spec/pull/163
message TxSubmitResult {
oneof result {
bytes ref = 1; // Transaction references.
Expand All @@ -23,7 +23,7 @@ message TxSubmitResult {
}

// Response containing references to the submitted transactions.
// TODO u5c: changed type
// TODO u5c: changed type - https://github.com/utxorpc/spec/pull/163
message SubmitTxResponse {
repeated TxSubmitResult results = 1; // List of either transaction references or error messages.
}
Expand Down
2 changes: 2 additions & 0 deletions cardano-rpc/src/Cardano/Rpc/Proto/Api/UtxoRpc/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import Network.GRPC.Common.Protobuf
import Proto.Utxorpc.V1alpha.Cardano.Cardano
import Proto.Utxorpc.V1alpha.Cardano.Cardano_Fields hiding
( hash
, items
, values
, vec'items
, vec'values
)
import Proto.Utxorpc.V1alpha.Query.Query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ readUtxosMethod req = do
if
| Just txoRefs <- req ^. #maybe'txoRefs ->
QueryUTxOByTxIn . fromList <$> mapM txoRefToTxIn (txoRefs ^. #items)
| Just addressesProto <- req ^. #maybe'addresses ->
| Just addressesProto <- req ^. #maybe'cardanoAddresses ->
QueryUTxOByAddress . fromList <$> mapM readAddress (addressesProto ^. #items)
| otherwise -> pure QueryUTxOWhole

Expand Down
Loading