-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat:Morpho Blue adaptors #241
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions.
morpho_blue_debt_adaptor_v1::Function::BorrowFromMorphoBlue(p) => { | ||
let market = p.market.unwrap(); | ||
let market = steward_abi::morpho_blue_debt_adaptor_v1::MarketParams { | ||
loan_token: sp_call_parse_address(market.loan_token)?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might be better off defining a single function for converting a MarketParams
message from the market
input since it's copy-pasted everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I tried this, but unfortunately the ABI bindings each create their own version of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess we could define one per adaptor, and that would cut the copy/paste in half. We still want to avoid the unwraps though I think.
) | ||
} | ||
morpho_blue_debt_adaptor_v1::Function::BorrowFromMorphoBlue(p) => { | ||
let market = p.market.unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably shouldn't be calling unwrap
and introducing the possibility of a panic. We can have the market params converting function sanity check that the field is present and return an error otherwise, like the other parse functions do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.