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

Defensive checks callbacks #875

Merged
merged 3 commits into from
Dec 12, 2023
Merged

Defensive checks callbacks #875

merged 3 commits into from
Dec 12, 2023

Conversation

joe-bowman
Copy link
Contributor

1. Summary

Fixes #842

Adds additional check to avoid nil pointer.

2.Type of change

  • Bug fix (non-breaking change which fixes an issue)

Copy link

codecov bot commented Dec 11, 2023

Codecov Report

Merging #875 (1df1e99) into main (bd797bc) will decrease coverage by 0.04%.
The diff coverage is 14.28%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #875      +/-   ##
==========================================
- Coverage   61.93%   61.89%   -0.04%     
==========================================
  Files         172      172              
  Lines       14051    14052       +1     
==========================================
- Hits         8703     8698       -5     
- Misses       4606     4612       +6     
  Partials      742      742              
Flag Coverage Δ
unittests 61.89% <14.28%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
x/interchainquery/keeper/msg_server.go 52.63% <100.00%> (-2.93%) ⬇️
x/interchainstaking/keeper/callbacks.go 57.82% <0.00%> (-0.29%) ⬇️
x/participationrewards/keeper/callbacks.go 43.89% <0.00%> (-0.30%) ⬇️

@joe-bowman joe-bowman merged commit fb10791 into main Dec 12, 2023
11 of 13 checks passed
@joe-bowman joe-bowman deleted the defensive-checks-callbacks branch December 12, 2023 10:44
@@ -49,6 +49,9 @@ func (k *Keeper) CallbackHandler() Callbacks {

// Call calls callback handler.
func (c Callbacks) Call(ctx sdk.Context, id string, args []byte, query icqtypes.Query) error {
if c.Has(id) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this should be negated. arse.

Copy link
Contributor

Choose a reason for hiding this comment

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

like !if ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants