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 in UpdateWithdrawalRecordsForSlash #789

Merged
merged 4 commits into from
Dec 10, 2023

Conversation

joe-bowman
Copy link
Contributor

1. Summary

Fixes #607

  • Add defensive checks against overflows
  • Add tests
  • Move UpdateWithdrawalRecordsForSlash to withdrawal_record.go

2.Type of change

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

3. Implementation details

Throw an error on if slashing will cause distAmount or record.Amount to be negative.

Copy link

codecov bot commented Nov 18, 2023

Codecov Report

Merging #789 (8f45b1b) into main (a8a541d) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #789      +/-   ##
==========================================
+ Coverage   61.96%   61.99%   +0.02%     
==========================================
  Files         172      172              
  Lines       14028    14038      +10     
==========================================
+ Hits         8693     8703      +10     
  Misses       4596     4596              
  Partials      739      739              
Flag Coverage Δ
unittests 61.99% <100.00%> (+0.02%) ⬆️

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

Files Coverage Δ
x/interchainstaking/keeper/keeper.go 68.34% <ø> (-1.00%) ⬇️
x/interchainstaking/keeper/withdrawal_record.go 89.65% <100.00%> (+1.98%) ⬆️

Copy link
Contributor

@faddat faddat left a comment

Choose a reason for hiding this comment

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

lgtm

@faddat faddat merged commit e95ec7d into main Dec 10, 2023
12 checks passed
@joe-bowman joe-bowman deleted the 607-defensive-checks branch December 19, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants