tendermint / farming

Farming is a Cosmos SDK module that implements farming functionality
Apache License 2.0
20 stars 15 forks source link

fix: use spendable coins not balance, avoid nil slice, sim, budget #252

Closed dongsam closed 2 years ago

dongsam commented 2 years ago

Description

closes: #251

Tasks


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.

dongsam commented 2 years ago

Great work! LGTM other than the following question.

In keeper/genesis.go, i see GetAllBalances is used in both InitGenesis and ExportGenesis. Am I understanding correctly that the function must be used to include all the account balances?

@kogisin That's right, unlike using SpendableCoins elsewhere accompanied by Send, Genesis uses GetAllBalances because it is for verification, not send, and the vesting locked amount of export and init varies depending on the block time, which can break the invariant of SpendableCoins.