-
Notifications
You must be signed in to change notification settings - Fork 161
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
feat: integrate leverage simulations #657
Conversation
Codecov Report
@@ Coverage Diff @@
## main #657 +/- ##
==========================================
+ Coverage 47.87% 47.90% +0.02%
==========================================
Files 64 64
Lines 9426 9441 +15
==========================================
+ Hits 4513 4523 +10
- Misses 4646 4650 +4
- Partials 267 268 +1
|
My hero <3 |
Note: gotta finish this off by adding funds to your random accounts on startup. Currently all simulated operations are working with zero spendable coins, which makes them useless even if the test is passing. Note sure if this will do it, but something to that effect is needed. |
tests/simulation/state.go
Outdated
// add some leverage supported assets to accounts that already have nonzero balances | ||
for i, balance := range bankState.Balances { | ||
fundedBalance := balance | ||
for _, t := range leverageState.Registry { | ||
fund := sdk.NewInt64Coin(t.BaseDenom, 100) | ||
fundedBalance.Coins = fundedBalance.Coins.Add(fund) | ||
bankState.Supply = bankState.Supply.Add(fund) | ||
} | ||
bankState.Balances[i] = fundedBalance | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this covers the nonzero initial balance issue
Note: Now that nonzero amounts are being used, transactions are failing when asset USD values are needed for tokens that the (simulated) oracle module doesn't have at a given moment. Need to check oracle sim's initial accept list, then either modify it to contain the three test tokens in leverage simulation or reduce leverage sim to just use |
@toteki should we close this for the time being? |
Yeah, that'll help de-clutter. |
Description
closes: #644
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change