Skip to content
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

Merged
merged 19 commits into from
Jan 26, 2024
Merged

feat:Morpho Blue adaptors #241

merged 19 commits into from
Jan 26, 2024

Conversation

cbrit
Copy link
Member

@cbrit cbrit commented Jan 25, 2024

No description provided.

@cbrit cbrit changed the base branch from main to collin/new-cellar-2.5-functions January 25, 2024 04:00
@cbrit cbrit marked this pull request as ready for review January 25, 2024 04:00
Copy link
Contributor

@EricBolten EricBolten left a 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)?,
Copy link
Contributor

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.

Copy link
Member Author

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

Copy link
Contributor

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();
Copy link
Contributor

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.

@cbrit cbrit changed the base branch from collin/new-cellar-2.5-functions to 3.x-main January 26, 2024 19:52
Copy link
Contributor

@EricBolten EricBolten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@EricBolten EricBolten merged commit b2d8606 into 3.x-main Jan 26, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants