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

add optional arbitrary impls #1390

Merged
merged 10 commits into from
Jan 16, 2025
Merged

Conversation

tzemanovic
Copy link
Contributor

@tzemanovic tzemanovic commented Jan 9, 2025

Description

This adds Arbitrary impl for some types behind a newly added feature "arbitrary" that can be used for e.g. prop and fuzz testing

Implements the following methods to be used for arbitrary(with = ..)

  • arb_u256
  • arb_uri
  • arb_protobuf_any
  • arb_tendermint_time

PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests. - tested externally in fuzz test txs anoma/namada#3445
  • Linked to GitHub issue. - no issue open
  • Updated code comments and documentation (e.g., docs/). - no relevant docs section
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 0% with 81 lines in your changes missing coverage. Please review.

Project coverage is 67.09%. Comparing base (edb36f7) to head (7f33030).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
ibc-primitives/src/lib.rs 0.00% 7 Missing ⚠️
ibc-apps/ics20-transfer/types/src/amount.rs 0.00% 5 Missing ⚠️
ibc-apps/ics20-transfer/types/src/denom.rs 0.00% 4 Missing ⚠️
ibc-apps/ics721-nft-transfer/types/src/class.rs 0.00% 4 Missing ⚠️
ibc-apps/ics721-nft-transfer/types/src/lib.rs 0.00% 4 Missing ⚠️
ibc-apps/ics721-nft-transfer/types/src/token.rs 0.00% 4 Missing ⚠️
ibc-primitives/src/types/timestamp.rs 0.00% 4 Missing ⚠️
ibc-core/ics04-channel/types/src/msgs/mod.rs 0.00% 2 Missing ⚠️
ibc-core/ics23-commitment/types/src/commitment.rs 0.00% 2 Missing ⚠️
ibc-apps/ics20-transfer/types/src/coin.rs 0.00% 1 Missing ⚠️
... and 44 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1390      +/-   ##
==========================================
- Coverage   67.35%   67.09%   -0.26%     
==========================================
  Files         225      226       +1     
  Lines       22393    22425      +32     
==========================================
- Hits        15082    15047      -35     
- Misses       7311     7378      +67     

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

@tzemanovic tzemanovic marked this pull request as ready for review January 13, 2025 16:01
@rnbguy
Copy link
Collaborator

rnbguy commented Jan 14, 2025

Can you please fix the typos nomal and blackslash to make the CI pass?

@sug0 sug0 mentioned this pull request Jan 15, 2025
7 tasks
arbitrary = [
"ibc-core-client/arbitrary",
"ibc-core-connection/arbitrary",
"ibc-core-commitment-types/arbitrary",
Copy link
Collaborator

Choose a reason for hiding this comment

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

ibc-core-channel/arbitrary is missed. and router too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added ibc-core-channel

Copy link
Collaborator

@rnbguy rnbguy Jan 16, 2025

Choose a reason for hiding this comment

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

@tzemanovic Thanks for correctly adding ibc-core-commitment-types/arbitrary. It looks like, we forgot it for parity-scale-codec 😅 Can you please add it for us? (or give us permission to push commits to your branch)

ibc/Cargo.toml Show resolved Hide resolved
@rnbguy
Copy link
Collaborator

rnbguy commented Jan 16, 2025

I don't have write access to your branch. Can you add --force here to make the CI pass (not sure why the caching not working on CI)

run: cargo binstall --no-confirm cargo-msrv

Copy link
Collaborator

@rnbguy rnbguy left a comment

Choose a reason for hiding this comment

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

🎉

@rnbguy rnbguy added this pull request to the merge queue Jan 16, 2025
Merged via the queue into cosmos:main with commit eb7e079 Jan 16, 2025
13 checks passed
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.

3 participants