Skip to content
New issue

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

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

Already on GitHub? # to your account

Support currencies in openleadr-wire (#54) #69

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

joshuathayer
Copy link
Contributor

Hi! This addresses #54.

In the issue it's left open whether to add currency support via a crate or by manually maintaining the list of current currencies listed here. The iso_currency crate seems popular (65k recent downloads) and maintained (last updated three months ago), and easy enough to integrate, so I opted to use it. I'd be happy to copy/paste the enum from that crate if you'd rather maintain it manually.

Also added a couple simple tests demonstrating serde for the currency field in EventPayloadDesciptor.

Signed-off-by: Joshua Thayer <joshuamilesthayer@gmail.com>
Copy link

codecov bot commented Nov 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.50%. Comparing base (aa74877) to head (6fef8e6).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #69      +/-   ##
==========================================
+ Coverage   81.40%   81.50%   +0.10%     
==========================================
  Files          42       42              
  Lines        5495     5521      +26     
==========================================
+ Hits         4473     4500      +27     
+ Misses       1022     1021       -1     

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

@pohlm01 pohlm01 linked an issue Nov 11, 2024 that may be closed by this pull request
Copy link
Member

@pohlm01 pohlm01 left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your PR. I think the crate you are proposing looks nice and even if maintaining our own list is not a lot of work, we would most likely miss relevant updates to currencies in the world that Dependabot can provide to us though this crate.
In addition to the minor comment I left in the code, please make sure Clippy is also happy. Other than that, your code looks good to me.
Let me know if you have any further questions, either related to this PR or other issues you might want to contribute to.

openleadr-wire/Cargo.toml Outdated Show resolved Hide resolved
Signed-off-by: Joshua Thayer <joshuamilesthayer@gmail.com>
@joshuathayer
Copy link
Contributor Author

@pohlm01 thanks for the review. I've fixed up those changes, take a look when you can!

It seems like #53 might be a good next issue, though I suspect I'll have a couple questions.

@pohlm01 pohlm01 enabled auto-merge November 13, 2024 07:46
@pohlm01 pohlm01 added this pull request to the merge queue Nov 13, 2024
Merged via the queue into OpenLEADR:main with commit a0d0128 Nov 13, 2024
14 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate currencies
2 participants