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

Add simulation #108

Merged

Conversation

defihyung
Copy link
Contributor

@defihyung defihyung commented Feb 17, 2021

Add simulation package

  • Store decoders
  • Randomized genesis
  • Randomized parameters
  • Random weighted operations
  • Random proposal contents - this is not needed for liquidity module
  • Add simulation commands in Makefile

Update

The following issues will be tackled in the other PRs.

@codecov
Copy link

codecov bot commented Feb 17, 2021

Codecov Report

Merging #108 (38f774f) into develop-milestone2 (695626a) will decrease coverage by 19.06%.
The diff coverage is 70.27%.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           develop-milestone2     #108       +/-   ##
=======================================================
- Coverage               80.11%   61.05%   -19.07%     
=======================================================
  Files                      18       26        +8     
  Lines                    1836     3035     +1199     
=======================================================
+ Hits                     1471     1853      +382     
- Misses                    192      980      +788     
- Partials                  173      202       +29     
Impacted Files Coverage Δ
app/app.go 0.86% <0.00%> (ø)
app/test_helpers.go 0.00% <0.00%> (ø)
x/liquidity/genesis.go 100.00% <ø> (+25.00%) ⬆️
x/liquidity/keeper/invariants.go 94.73% <ø> (ø)
x/liquidity/types/keys.go 100.00% <ø> (ø)
x/liquidity/keeper/swap.go 67.63% <50.00%> (-9.11%) ⬇️
x/liquidity/module.go 51.11% <50.00%> (ø)
x/liquidity/types/params.go 66.92% <51.78%> (-15.79%) ⬇️
x/liquidity/types/swap.go 81.42% <70.83%> (-5.15%) ⬇️
x/liquidity/keeper/store.go 88.81% <71.42%> (-0.44%) ⬇️
... and 22 more

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 c9979f9...837f98b. Read the comment docs.

@dongsam dongsam self-requested a review February 17, 2021 03:12
@defihyung defihyung force-pushed the brandon/add-simulation branch from 7ade359 to 17f1f55 Compare February 17, 2021 11:52
@defihyung defihyung force-pushed the brandon/add-simulation branch from 17f1f55 to 0a4b447 Compare February 17, 2021 12:36
@defihyung defihyung marked this pull request as ready for review February 22, 2021 07:36
@defihyung defihyung force-pushed the brandon/add-simulation branch from e6511d6 to 5948344 Compare February 24, 2021 02:19
@defihyung
Copy link
Contributor Author

@dongsam reviewed and we discussed offline and received great feedback about how this should be designed and improved in a way to simulate hundreds and thoudsands of simulated tests. It's ready for another review now.

Copy link
Contributor

@dongsam dongsam left a comment

Choose a reason for hiding this comment

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

Thanks for the work!
It looks good to me 👍

could you please apply comments and add commands for simulation on Makefile like this with sim_test.go on liquidity/app/ for to run independent simulation tests.

After the review, I think it would be helpful not to use force-push as much as possible.

x/liquidity/module.go Outdated Show resolved Hide resolved
x/liquidity/simulation/decoder.go Outdated Show resolved Hide resolved
x/liquidity/simulation/decoder.go Outdated Show resolved Hide resolved
x/liquidity/simulation/genesis.go Outdated Show resolved Hide resolved
x/liquidity/simulation/genesis.go Outdated Show resolved Hide resolved
x/liquidity/simulation/operations.go Outdated Show resolved Hide resolved
@dongsam dongsam closed this Feb 25, 2021
@dongsam dongsam deleted the branch tendermint:develop-milestone2 February 25, 2021 15:32
@dongsam dongsam reopened this Feb 25, 2021
@dongsam dongsam merged commit 1903c29 into tendermint:develop-milestone2 Mar 3, 2021
@defihyung
Copy link
Contributor Author

defihyung commented Mar 3, 2021

The following issues will be tackled in the other PRs.

@defihyung defihyung deleted the brandon/add-simulation branch March 29, 2021 05:56
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.

2 participants