Commit Graph

3 Commits

Author SHA1 Message Date
Derrick Lee
8593d26c24
Add private Earn vault with allowed depositors (#1289)
* Add IsPrivateVault and AllowedDepositors to types

* Check if account is allowed to deposit
2022-09-12 10:29:35 -07:00
Derrick Lee
b5e162a930
Update Earn vaults to use sdk.Dec shares (#1283)
* Change vault supply to shares

* Update deposit shares

* Use shares instead of supplied

* Update tests, fix share calculation

* Pass hard and savings keeper as pointer to earn keeper

* Update remaining failing test

* Add different share price test, fix comment for share price

* Add shares amount to events

* Additional share tests, use share to asset conversion for withdraw amount

* Update VaultTotalValue test

* Use sdk.Dec for vault shares instead of sdk.Int

* Add test for expensive 20:1 shares

* Update ConvertToShares comment for division, remove redundant test

* Add vault share tests
2022-09-12 09:23:26 -07:00
Derrick Lee
ed9991d44a
Add Init/ExportGenesis for Earn module (#1280)
* Add vault and vault shares to genesis

* Fix error and denoms

* Update init and export genesis with correct data

* Fix total supply genesis check, remove legacy test for enum errors

* Add vault slice validate tests

* Update denom validation, add additional test
2022-07-28 10:01:30 -07:00