gRPC: Add decoded PlutusData and NativeScript in proto definition#947
gRPC: Add decoded PlutusData and NativeScript in proto definition#947carbolymer merged 9 commits intomasterfrom
Conversation
2a68c4a to
0da56f8
Compare
palas
left a comment
There was a problem hiding this comment.
I think it is all accurate except for the bigint representation, which I am sure you already considered. But I commented on the bits that I found suspicious, even though I think they are all correct
Jimbo4350
left a comment
There was a problem hiding this comment.
This LGTM however you should start implementing round trip tests for your Inject instances and consider having a separate type class for these transformations.
I'll approve once the round trip tests are added.
f857964 to
a345801
Compare
7a9b167 to
97c55d9
Compare
27dd02b to
810f789
Compare
ca99912 to
147cb62
Compare
There was a problem hiding this comment.
hlint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
147cb62 to
a60f3b5
Compare
4caaa17 to
dcf43dd
Compare
768f771 to
ccacd4c
Compare
ab400b4 to
1c90b69
Compare
1c90b69 to
8be0f75
Compare
e1eae2b to
adcef0d
Compare
|
|
||
| // Represents a constructor for Plutus data in Cardano. | ||
| message Constr { | ||
| uint32 tag = 1; |
There was a problem hiding this comment.
Why is there a uint32 field here?
There was a problem hiding this comment.
That's how plutus encodes constructors with different numbers of of attributes. The tag can store values described here https://github.com/IntersectMBO/plutus/blob/fc78c36b545ee287ae8796a0c1a7d04cf31f4cee/plutus-core/plutus-core/src/PlutusCore/Data.hs#L80 and anything larger goes into the second field any_constructor.
| } | ||
|
|
||
| // Represents a big integer for Plutus data in Cardano. | ||
| message BigInt { |
There was a problem hiding this comment.
Can you add a comment explaining the intention behind the 3 different fields here?
There was a problem hiding this comment.
Pushed explanation upstream, I'll pull the changes to our repo later. utxorpc/spec@3a59863 (part of utxorpc/spec#177 )
Changelog
Context
Previously,
NativeScriptandPlutusDatawere omitted in the ReadUtxos query feature:This PR adds decoding of those values to the protobuf type. Using protobuf-defined values instead of CBOR blobs is advantageous, as it lets UTxO RPC consumers work with a single data format.
A rountrip property test is included.
Checklist