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

Return error instead of overriding that with "unhealthy" in readers #598

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

mateusz-sekara
Copy link
Contributor

Downstream functions should return errors when errors are returned when calling RPC.
Otherwise, ChainHealthcheck will mark incorrectly chain as unhealthy.

@mateusz-sekara mateusz-sekara requested a review from a team as a code owner March 8, 2024 15:53
@mateusz-sekara mateusz-sekara changed the title Return error instead of overriding that with "unhealthy" metric Return error instead of overriding that with "unhealthy" in readers Mar 8, 2024
Copy link
Collaborator

@connorwstein connorwstein left a comment

Choose a reason for hiding this comment

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

easy to add a test?

@mateusz-sekara
Copy link
Contributor Author

easy to add a test?

There is no easy way to mock contracts, but I will create a task to add test for that

@mateusz-sekara mateusz-sekara merged commit 71d4531 into ccip-develop Mar 8, 2024
66 of 67 checks passed
@mateusz-sekara mateusz-sekara deleted the commit-store-reader-fix branch March 8, 2024 16:18
mateusz-sekara added a commit that referenced this pull request Mar 8, 2024
…598)

Downstream functions should return errors when errors are returned when
calling RPC.
Otherwise, ChainHealthcheck will mark incorrectly chain as unhealthy.
@makramkd
Copy link
Contributor

makramkd commented Mar 9, 2024

There is no easy way to mock contracts, but I will create a task to add test for that

If by mock contracts you mean mock the gethwrappers, it is pretty straightforward. abigen generates an interface that we can mock with mockery. See e.g

//go:generate mockery --quiet --dir ./generated/evm_2_evm_onramp/ --name EVM2EVMOnRampInterface --output ./mocks/ --outpkg mock_contracts --case=underscore

asoliman92 pushed a commit that referenced this pull request Jul 31, 2024
…598)

Downstream functions should return errors when errors are returned when
calling RPC.
Otherwise, ChainHealthcheck will mark incorrectly chain as unhealthy.
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