RGB-WG / rgb-core

RGB Core Library: consensus validation for private & scalable client-validated smart contracts on Bitcoin & Lightning
https://spec.rgb.tech
Apache License 2.0
207 stars 52 forks source link

Fix serde text serializations #216

Closed dr-orlovsky closed 6 months ago

dr-orlovsky commented 7 months ago

Alternative to #215 preserving serialization for non-YAML types

codecov[bot] commented 7 months ago

Codecov Report

Attention: Patch coverage is 3.65854% with 79 lines in your changes are missing coverage. Please review.

Project coverage is 15.2%. Comparing base (18e4932) to head (6cd4b1b).

Files Patch % Lines
src/vm/script.rs 0.0% 18 Missing :warning:
src/contract/xchain.rs 0.0% 17 Missing :warning:
src/schema/script.rs 13.3% 13 Missing :warning:
src/contract/data.rs 0.0% 9 Missing :warning:
src/contract/operations.rs 10.0% 9 Missing :warning:
src/validation/logic.rs 0.0% 6 Missing :warning:
src/validation/schema.rs 0.0% 3 Missing :warning:
src/validation/validator.rs 0.0% 2 Missing :warning:
src/contract/seal.rs 0.0% 1 Missing :warning:
src/schema/schema.rs 0.0% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #216 +/- ## ======================================== - Coverage 15.4% 15.2% -0.2% ======================================== Files 33 33 Lines 4196 4256 +60 ======================================== + Hits 646 648 +2 - Misses 3550 3608 +58 ``` | [Flag](https://app.codecov.io/gh/RGB-WG/rgb-core/pull/216/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=RGB-WG) | Coverage Δ | | |---|---|---| | [rust](https://app.codecov.io/gh/RGB-WG/rgb-core/pull/216/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=RGB-WG) | `15.2% <3.7%> (-0.2%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=RGB-WG#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

zoedberg commented 7 months ago

It seems a better approach than https://github.com/RGB-WG/rgb-core/pull/215 but I'm not sure it works because to try it we need to fix usages of XOutpoint. Could you please provide an updated branch for rgb-std (and possibly others)?

dr-orlovsky commented 7 months ago

Will work on that tomorrow morning

dr-orlovsky commented 7 months ago

@zoedberg all downstream crates are updated and do compile. You can test now

zoedberg commented 7 months ago

It seems this hasn't fixed the yaml conversion issue. Inspecting a consignment created with updated libs (from latest rgb-wallet) produces the usual issue:

rgb inspect --format yaml rcv_compose.rgbc 
RGB: command-line wallet for RGB smart contracts
     by LNP/BP Standards Association

Unable to find or parse config file; using config defaults
thread 'main' panicked at cli/src/command.rs:789:56:
unable to present as YAML: Error("serializing nested enums in YAML is not supported yet")