Closed ueco-jb closed 2 years ago
Mock response for particular account is set through ExecuteMsg::SetCreditLine. I did so, because that was fastest way to use mutable map that's unique per test and set automatically...
Just read the Readme but I agree with this approach. Make such a contract with contract interfaces. It may never make sense outside of tests but let's leverage the infrastructure we have for dealing with state
closes https://github.com/confio/lendex/issues/26
I've created additionaly Credit Agency's mock for market contract multitest in order to avoid circular dependency between market and CA. It contains query
TotalCreditLine
- same as in Credit Agency. This query is called in multitest for all operations that doescan_borrow
orcan_withdraw
checks. Because of that, I had to set through additional helpers arbitrary high credit line and price ratio to 1.0 in tests that now requires it (because of query), but don't actually need those informations.Mock response for particular account is set through
ExecuteMsg::SetCreditLine
. I did so, because that was fastest way to use mutable map that's unique per test and set automatically... I could replace it with some customHashMap
, but then I'd have to resolve issue of access (mutex?), mutability, probably wrap it aroundlazy_static
... Please share your thoughts.