I'm not sure I feel 100% good about what I've done here yet. I'll review again tomorrow, but feel free to rip this apart.
What was previously CreditLineResponse becomes CreditLineValues and is still used internally to do all the math on it, but I added a CreditLineResponse with denom for use with the API:
pub struct CreditLineResponse {
/// Total value of L-Tokens in common_token
pub collateral: Coin,
/// collateral * collateral_ratio
pub credit_line: Coin,
/// Total value of B-Tokens in common_token
pub debt: Coin,
}
And then some helpers for easy validation and moving between the two types.
Should we consider moving all the credit line stuff into utils?
Closes #73
I'm not sure I feel 100% good about what I've done here yet. I'll review again tomorrow, but feel free to rip this apart.
What was previously
CreditLineResponse
becomesCreditLineValues
and is still used internally to do all the math on it, but I added aCreditLineResponse
with denom for use with the API:And then some helpers for easy validation and moving between the two types.
Should we consider moving all the credit line stuff into
utils
?