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

fix: remove potential runtime panic in x/feegrant #720

Merged
merged 11 commits into from
Oct 19, 2022

Conversation

ulbqb
Copy link
Member

@ulbqb ulbqb commented Oct 17, 2022

Description

I added safe type casting and then removed potential runtime panic.

Motivation and context

Unsafe type casting may cause potential runtime panic.

How has this been tested?

Screenshots (if appropriate):

Checklist:

  • I followed the contributing guidelines and code of conduct.
  • I have added a relevant changelog to CHANGELOG.md
  • I have added tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have updated API documentation client/docs/swagger-ui/swagger.yaml

@ulbqb ulbqb changed the title Remove potential runtime panic Remove potential runtime panic in x/feegrant Oct 17, 2022
@ulbqb ulbqb marked this pull request as ready for review October 17, 2022 07:32
@ulbqb ulbqb requested review from 0Tech, dudong2, zemyblue and tnasu October 17, 2022 07:32
@ulbqb ulbqb changed the title Remove potential runtime panic in x/feegrant fix: remove potential runtime panic in x/feegrant Oct 17, 2022
@codecov
Copy link

codecov bot commented Oct 17, 2022

Codecov Report

Merging #720 (d3573e9) into main (5ed82db) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #720   +/-   ##
=======================================
  Coverage   61.96%   61.96%           
=======================================
  Files         877      877           
  Lines       98764    98813   +49     
=======================================
+ Hits        61200    61233   +33     
- Misses      33955    33980   +25     
+ Partials     3609     3600    -9     
Impacted Files Coverage Δ
x/feegrant/filtered_fee.go 64.00% <100.00%> (+6.25%) ⬆️
x/token/validation.go 87.27% <0.00%> (-3.64%) ⬇️
x/collection/msgs.go 39.81% <0.00%> (-3.15%) ⬇️
x/collection/collection.go 78.57% <0.00%> (-1.79%) ⬇️
x/wasm/keeper/keeper.go 85.80% <0.00%> (-0.37%) ⬇️
x/foundation/client/testutil/query.go 100.00% <0.00%> (ø)
crypto/ledger/ledger_secp256k1.go 52.89% <0.00%> (+0.75%) ⬆️
x/token/msgs.go 34.51% <0.00%> (+2.03%) ⬆️

@ulbqb ulbqb marked this pull request as draft October 17, 2022 10:34
x/feegrant/filtered_fee_test.go Outdated Show resolved Hide resolved
x/feegrant/filtered_fee_test.go Show resolved Hide resolved
@ulbqb ulbqb self-assigned this Oct 18, 2022
@ulbqb ulbqb marked this pull request as ready for review October 19, 2022 02:59
@ulbqb ulbqb requested a review from 0Tech October 19, 2022 02:59
Copy link
Collaborator

@0Tech 0Tech left a comment

Choose a reason for hiding this comment

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

It would be better to provide more meaningful names to the mocks.

x/feegrant/filtered_fee_test.go Outdated Show resolved Hide resolved
@ulbqb ulbqb merged commit 0ade7e4 into Finschia:main Oct 19, 2022
@ulbqb ulbqb deleted the fix/unsafe_cast branch October 19, 2022 07:58
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.

4 participants