Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(abci): Add serde default for Event::type #1416

Merged
merged 4 commits into from
May 29, 2024

Conversation

penso
Copy link
Contributor

@penso penso commented Apr 27, 2024

Fixes #1415

  • Referenced an issue explaining the need for the change
  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Added entry in .changelog/

@@ -18,7 +18,7 @@ pub struct Event {
///
/// Tendermint calls this the `type`, but we use `kind` to avoid confusion
/// with Rust types and follow Rust conventions.
#[serde(rename = "type")]
#[serde(rename = "type", default)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is an optimal solution, because it's recreating the data format by hand rather than deriving it from the source of truth (the proto messages). See #1415 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went for the shortest fix to an immediate issue. But anyone else, please feel free to fix it differently.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go with this fix for now since we are already re-creating the data format by hand everywhere in tendermint-rs.

Maybe we can address this whole thing at once and move to ProtoJSON in a follow-up PR or in cometbft-rs.

@codecov-commenter
Copy link

Codecov Report

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

Project coverage is 59.5%. Comparing base (99ed0b9) to head (90ddb0a).
Report is 10 commits behind head on main.

❗ Current head 90ddb0a differs from pull request most recent head 775d001. Consider uploading reports for the commit 775d001 to get more accurate results

Files Patch % Lines
rpc/tests/dydx_fixtures.rs 97.2% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1416     +/-   ##
=======================================
- Coverage   60.1%   59.5%   -0.6%     
=======================================
  Files        271     272      +1     
  Lines      26221   26795    +574     
=======================================
+ Hits       15768   15963    +195     
- Misses     10453   10832    +379     

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

@romac romac changed the title Fix optional Event.type fix(abci): Add serde default for Event::type May 29, 2024
@romac romac merged commit ec37ad2 into informalsystems:main May 29, 2024
22 checks passed
@penso penso deleted the add-dydx-fixtures branch September 24, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deserialization of abci::Event fails
4 participants