Skip to content

Conversation

@egasimus
Copy link
Contributor

Hi! 🙇 This PR enables deriving the Serialize trait for three of the structs that we expose through our bleeding-edge client library, @fadroma/namada.

Right now we decode these by manually building js_sys::Object instances, but this requires us to explicitly name each field, hence it is not future-proof against the struct fields changing. As we migrate towards automatic JSON serialization using serde_json, we've found that not all SDK structs derive serde::Serialize. Hence, this 🙏

this would enable our client library `@fadroma/namada` to automatically convert the response from `/vp/pos/pos_params` without having to explicitly list every field (see https://github.com/hackbg/fadroma/blob/e7d5d551f818a6441ef54309a2517792b03ee7d3/packages/namada/src/decode.rs#L201-L223)
this would enable @fadroma/namada to automatically serialize the response from `/vp/governance/parameters` to JSON without having to explicitly list each field (see https://github.com/hackbg/fadroma/blob/e7d5d551f818a6441ef54309a2517792b03ee7d3/packages/namada/src/decode.rs#L201-L223)
@codecov
Copy link

codecov bot commented Aug 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.02%. Comparing base (cc0a448) to head (2af1972).
Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3702   +/-   ##
=======================================
  Coverage   68.01%   68.02%           
=======================================
  Files         330      330           
  Lines      116209   116209           
=======================================
+ Hits        79041    79051   +10     
+ Misses      37168    37158   -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@brentstone
Copy link
Collaborator

can you run make fmt and then add a changelog using unclog? See https://github.com/anoma/namada/blob/main/CONTRIBUTING.md

@cwgoes cwgoes requested a review from Fraccaman August 27, 2024 08:26
@Fraccaman
Copy link
Collaborator

ah nice catch about the changelog docs, but it would be better to split them into another PR. Could you drop c4ef91dea01c06ccda8284b54a190f147aa6b315 ?

@egasimus
Copy link
Contributor Author

@Fraccaman fixed?

@brentstone brentstone added the merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass label Aug 29, 2024
mergify bot added a commit that referenced this pull request Aug 29, 2024
@mergify mergify bot merged commit f92adcf into namada-net:main Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants