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: add overflow checking and test codes for cover edge cases #458

Merged

Conversation

dongsam
Copy link
Contributor

@dongsam dongsam commented Oct 21, 2021

Description

closes: #457


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.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@codecov
Copy link

codecov bot commented Oct 21, 2021

Codecov Report

Merging #458 (d6be8a6) into develop (616985f) will increase coverage by 0.39%.
The diff coverage is 88.63%.

❗ Current head d6be8a6 differs from pull request most recent head 59d7de7. Consider uploading reports for the commit 59d7de7 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #458      +/-   ##
===========================================
+ Coverage    85.09%   85.49%   +0.39%     
===========================================
  Files           23       23              
  Lines         2604     2634      +30     
===========================================
+ Hits          2216     2252      +36     
+ Misses         225      221       -4     
+ Partials       163      161       -2     
Impacted Files Coverage Δ
x/liquidity/keeper/swap.go 62.92% <25.00%> (-1.45%) ⬇️
x/liquidity/keeper/liquidity_pool.go 84.62% <87.50%> (+1.46%) ⬆️
x/liquidity/keeper/batch.go 89.15% <100.00%> (+0.33%) ⬆️
x/liquidity/types/swap.go 79.22% <100.00%> (+0.11%) ⬆️
x/liquidity/types/utils.go 89.06% <100.00%> (+3.64%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 616985f...59d7de7. Read the comment docs.

@dongsam dongsam changed the title test: add test codes for cover edge cases test: add overflow checking and test codes for cover edge cases Oct 22, 2021
@dongsam dongsam marked this pull request as ready for review October 25, 2021 02:18
@dongsam dongsam requested review from hallazzang and jaybxyz October 25, 2021 02:19
x/liquidity/keeper/liquidity_pool.go Outdated Show resolved Hide resolved
x/liquidity/keeper/swap.go Show resolved Hide resolved
x/liquidity/types/swap.go Outdated Show resolved Hide resolved
x/liquidity/types/utils.go Outdated Show resolved Hide resolved
@dongsam dongsam changed the title test: add overflow checking and test codes for cover edge cases Fix: add overflow checking and test codes for cover edge cases Oct 25, 2021
@dongsam dongsam merged commit e0def69 into tendermint:develop Oct 25, 2021
dongsam added a commit that referenced this pull request Oct 25, 2021
* feat: add markdown link checker github workflow

* feat: bump cosmos sdk to v0.44.1

* feat: bump cosmos-sdk to v0.44.2

* fix: Pool Coin Decimal Truncation During Deposit (#446)

* fix: wip poc for reproduce and fix poolcoin truncation

* fix: simplify calculation logic and add more tests

* fix: use equality check in MintingPoolCoinsInvariant

* test: fix expected value

due to the change in deposit logic, expected value in test
also changed

* test: add test for MintingPoolCoinsInvariant

* fix: update deposit truncation logic and simulation ordering

* docs: update changelog and readme

* fix: revert MulTruncate to Mul on Deposit

Co-authored-by: Hanjun Kim <hallazzang@gmail.com>

* Fix: add overflow checking and test codes for cover edge cases (#458)

* test: add testcase for cover small withdrawal case

* test: add test case for CreatePool

* fix: refactor and optimize depleted pool validation

* feat: add overflow checking logic

* chore: add testcase and remove comments

* test: add test code for big deposit

* fix: apply PR suggestions

* fix: add overflow checking logic and test cases

Co-authored-by: Hanjun Kim <hallazzang@gmail.com>
Co-authored-by: typark391 <86215716+typark391@users.noreply.github.com>

Co-authored-by: kogisin <jaybkim2@gmail.com>
Co-authored-by: Hanjun Kim <hallazzang@gmail.com>
Co-authored-by: typark391 <86215716+typark391@users.noreply.github.com>
@dongsam dongsam changed the title Fix: add overflow checking and test codes for cover edge cases fix: add overflow checking and test codes for cover edge cases Oct 25, 2021
dongsam added a commit to b-harvest/liquidity that referenced this pull request Jul 11, 2022
* feat: add markdown link checker github workflow	 9d729d0

* Merge pull request tendermint#453 from b-harvest/kogisin/451-bump-sdk-v0.44.1

feat: bump Cosmos SDK from v0.44.0 to v0.44.1
(cherry picked from commit 9e955b0)

* Merge pull request tendermint#455 from b-harvest/454-bump-sdk-v0.44.2

feat: bump cosmos-sdk to v0.44.2
(cherry picked from commit e118e21)

* fix: Pool Coin Decimal Truncation During Deposit (tendermint#446)

* fix: wip poc for reproduce and fix poolcoin truncation

* fix: simplify calculation logic and add more tests

* fix: use equality check in MintingPoolCoinsInvariant

* test: fix expected value

due to the change in deposit logic, expected value in test
also changed

* test: add test for MintingPoolCoinsInvariant

* fix: update deposit truncation logic and simulation ordering

* docs: update changelog and readme

* fix: revert MulTruncate to Mul on Deposit

Co-authored-by: Hanjun Kim <hallazzang@gmail.com>
(cherry picked from commit 616985f)

* Fix: add overflow checking and test codes for cover edge cases (tendermint#458)

* test: add testcase for cover small withdrawal case

* test: add test case for CreatePool

* fix: refactor and optimize depleted pool validation

* feat: add overflow checking logic

* chore: add testcase and remove comments

* test: add test code for big deposit

* fix: apply PR suggestions

* fix: add overflow checking logic and test cases
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.

test: add testcase for cover edge cases
4 participants