lbry-sdk icon indicating copy to clipboard operation
lbry-sdk copied to clipboard

Reposts with deletions/edits V3

Open moodyjon opened this issue 3 years ago • 1 comments

Context: https://github.com/lbryio/types/issues/49

This based on https://github.com/lbryio/lbry-sdk/pull/3697, but moving away from protobuf.Any. This allows deleting some code to detect unknown extension types and the code to unpack a message from the Any.

I also discovered that there is a well-known type protobuf.Struct which is far more advanced than my StringMap but serves the same purpose. The backbone of protobuf.Struct is a map<string, Value> just like StringMap, but protobuf.Struct can represent any JSON object with numeric fields, bool fields, string fields, list of X fields, object fields, and more. Using this allowed even more simplification.

Definition of google.protobuf.Struct: https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/struct.proto

To see the claim.proto changes go here: https://github.com/moodyjon/types/commits/repost_modify

Hub changes that would index the extension fields are here: https://github.com/lbryio/hub/pull/113

moodyjon avatar Nov 10 '22 22:11 moodyjon

Coverage Status

Coverage decreased (-0.6%) to 56.057% when pulling 4f1d82addd6510c036cf2b671f265c22a133f136 on moodyjon:stringmap_extensions into 6258651650f851190582be69c92cc476289c0bc8 on lbryio:master.

coveralls avatar Nov 10 '22 22:11 coveralls