Skip to content

Conversation

@vaporif
Copy link
Contributor

@vaporif vaporif commented Aug 21, 2025

Description

Reduced code duplication


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Wrote unit and integration tests.
  • Added relevant natspec and godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

@codecov
Copy link

codecov bot commented Aug 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.86%. Comparing base (4c60bcf) to head (2bfba10).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #684   +/-   ##
=======================================
  Coverage   99.86%   99.86%           
=======================================
  Files          17       17           
  Lines         767      767           
=======================================
  Hits          766      766           
  Misses          1        1           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gjermundgaraba gjermundgaraba removed their request for review October 8, 2025 14:48
Copy link
Member

@srdtrk srdtrk left a comment

Choose a reason for hiding this comment

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

Thanks for this. I added my comments

/// Returns a `Status` error if any transaction ID is not exactly 32 bytes
#[inline]
#[allow(clippy::result_large_err)]
pub fn parse_eth_tx_hashes(tx_ids: Vec<Vec<u8>>) -> Result<Vec<[u8; 32]>, Status> {
Copy link
Member

Choose a reason for hiding this comment

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

Isn't it better to return TxHash?

.into_iter()
.map(Hash::try_from)
.collect::<Result<Vec<_>, _>>()
.map_err(|e| Status::from_error(e.into()))
Copy link
Member

Choose a reason for hiding this comment

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

probably should use to_tonic_status from above.

.map_err(|tx| format!("invalid tx hash: {tx:?}"))
})
.collect::<Result<Vec<[u8; 32]>, _>>()
.map_err(|e| Status::from_error(e.into()))
Copy link
Member

Choose a reason for hiding this comment

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

ditto: probably should use to_tonic_status

///
/// Returns a `ClientState` with default trust level, max clock drift, and the provided proof specs
#[must_use]
pub fn build_tendermint_client_state(
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this function should also take trust_level: Option<Fraction> and max_clock_drift: Option<Duration>.

And if these fields are None, then we use the default values?

unused_crate_dependencies
)]

use tendermint as _;
Copy link
Member

Choose a reason for hiding this comment

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

what does this do?

Comment on lines +11 to +13
use ics23 as _;
use tendermint as _;

Copy link
Member

Choose a reason for hiding this comment

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

are these needed?

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.

2 participants