* add additional tests that attempt to borrow funds from the insolvent market(should fail), and attempt to borrow funds from the not insolvent market (it will fail, but shouldn't). The not insolvent market should continue to processs borrows
* remove unused code
* make tests less specific for string contains
* add new get total reserves for denoms functionality
* start utilizing GetTotalReservesForDenoms in ValidateBorrow
* update tests for Borrow to not fail when borrowing from an insolvent market
* use get total reseves in GetTotalReservesForDenoms for reusability
* refactor GetTotalReservesForDenoms to GetTotalReservesByCoinDenoms for more clarity
* change the structure for new and old tests and add more verbosity for other tests
* remove print
* remove unneeded code
* add paren
* adjust structure again after initial PR
* remove duplicate test case with invalid test name, and update to use error contains in places where it was validating if true for strings contains
* no need for keeper method
* add additional tests that attempt to borrow funds from the insolvent market(should fail), and attempt to borrow funds from the not insolvent market (it will fail, but shouldn't). The not insolvent market should continue to processs borrows
* remove unused code
* make tests less specific for string contains
* change the structure for new and old tests and add more verbosity for other tests
* remove print
* remove unneeded code
* add paren
* remove duplicate test case with invalid test name, and update to use error contains in places where it was validating if true for strings contains
---------
Co-authored-by: Sam Sheffield <sam.sheffield@kavalabs.io>
Module reserve represents fractional balances, so it should be hidden to consumers to not have a misleading total balance that doubles the fractional balances. This modifies GetBalance() and SpendableCoin() to always return zero coins when fetching the reserve address balance for fractional amounts.
Change GetBalance() to return full balances instead of spendable to align behavior with x/bank. Add SpendableCoin() method with support of akava for use in x/evm.
Emits the **total** akava amount for both ukava and akava send/mint/burns. If both akava,ukava are sent (not possible via x/evm nor cosmos messages but still an edge case), then the sum is emitted. No other denoms are emitted by x/precisebank as they will be emitted by the underlying x/bank
Fix reserve minting an extra coin when the recipient module both carries fractional over to integer balance AND remainder is insufficient. Adjusts fractional carry to simply send from reserve, instead of doing an additional mint. Add invariant to ensure reserve matches exactly with fractional balances + remainder, failing on both insufficient and excess funds.