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

Borrow proxy with PodOperation behavior #1854

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 26 additions & 24 deletions runtime/altair/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,30 +537,32 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::proxy { .. }))
|| !matches!(c, RuntimeCall::Proxy(..))
}
ProxyType::Borrow => matches!(
c,
RuntimeCall::Loans(pallet_loans::Call::create { .. }) |
RuntimeCall::Loans(pallet_loans::Call::borrow { .. }) |
RuntimeCall::Loans(pallet_loans::Call::repay { .. }) |
RuntimeCall::Loans(pallet_loans::Call::write_off { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_loan_mutation { .. }) |
RuntimeCall::Loans(pallet_loans::Call::close { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_write_off_policy { .. }) |
RuntimeCall::Loans(pallet_loans::Call::update_portfolio_valuation { .. }) |
RuntimeCall::Loans(pallet_loans::Call::propose_transfer_debt { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_transfer_debt { .. }) |
// Borrowers should be able to close and execute an epoch
// in order to get liquidity from repayments in previous epochs.
RuntimeCall::PoolSystem(pallet_pool_system::Call::close_epoch{..}) |
RuntimeCall::PoolSystem(pallet_pool_system::Call::submit_solution{..}) |
RuntimeCall::PoolSystem(pallet_pool_system::Call::execute_epoch{..}) |
RuntimeCall::Utility(pallet_utility::Call::batch_all{..}) |
RuntimeCall::Utility(pallet_utility::Call::batch{..}) |
// Borrowers should be able to swap back and forth between local currencies and their variants
RuntimeCall::TokenMux(pallet_token_mux::Call::burn {..}) |
RuntimeCall::TokenMux(pallet_token_mux::Call::deposit {..}) |
RuntimeCall::TokenMux(pallet_token_mux::Call::match_swap {..})
),
ProxyType::Borrow => {
matches!(
c,
RuntimeCall::Loans(pallet_loans::Call::create { .. }) |
RuntimeCall::Loans(pallet_loans::Call::borrow { .. }) |
RuntimeCall::Loans(pallet_loans::Call::repay { .. }) |
RuntimeCall::Loans(pallet_loans::Call::write_off { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_loan_mutation { .. }) |
RuntimeCall::Loans(pallet_loans::Call::close { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_write_off_policy { .. }) |
RuntimeCall::Loans(pallet_loans::Call::update_portfolio_valuation { .. }) |
RuntimeCall::Loans(pallet_loans::Call::propose_transfer_debt { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_transfer_debt { .. }) |
// Borrowers should be able to close and execute an epoch
// in order to get liquidity from repayments in previous epochs.
RuntimeCall::PoolSystem(pallet_pool_system::Call::close_epoch{..}) |
RuntimeCall::PoolSystem(pallet_pool_system::Call::submit_solution{..}) |
RuntimeCall::PoolSystem(pallet_pool_system::Call::execute_epoch{..}) |
RuntimeCall::Utility(pallet_utility::Call::batch_all{..}) |
RuntimeCall::Utility(pallet_utility::Call::batch{..}) |
// Borrowers should be able to swap back and forth between local currencies and their variants
RuntimeCall::TokenMux(pallet_token_mux::Call::burn {..}) |
RuntimeCall::TokenMux(pallet_token_mux::Call::deposit {..}) |
RuntimeCall::TokenMux(pallet_token_mux::Call::match_swap {..})
) | ProxyType::PodOperation.filter(c)
}
ProxyType::Invest => matches!(
c,
RuntimeCall::Investments(pallet_investments::Call::update_invest_order{..}) |
Expand Down
50 changes: 26 additions & 24 deletions runtime/centrifuge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,30 +671,32 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::proxy { .. }))
|| !matches!(c, RuntimeCall::Proxy(..))
}
ProxyType::Borrow => matches!(
c,
RuntimeCall::Loans(pallet_loans::Call::create { .. }) |
RuntimeCall::Loans(pallet_loans::Call::borrow { .. }) |
RuntimeCall::Loans(pallet_loans::Call::repay { .. }) |
RuntimeCall::Loans(pallet_loans::Call::write_off { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_loan_mutation { .. }) |
RuntimeCall::Loans(pallet_loans::Call::close { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_write_off_policy { .. }) |
RuntimeCall::Loans(pallet_loans::Call::update_portfolio_valuation { .. }) |
RuntimeCall::Loans(pallet_loans::Call::propose_transfer_debt { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_transfer_debt { .. }) |
// Borrowers should be able to close and execute an epoch
// in order to get liquidity from repayments in previous epochs.
RuntimeCall::PoolSystem(pallet_pool_system::Call::close_epoch{..}) |
RuntimeCall::PoolSystem(pallet_pool_system::Call::submit_solution{..}) |
RuntimeCall::PoolSystem(pallet_pool_system::Call::execute_epoch{..}) |
RuntimeCall::Utility(pallet_utility::Call::batch_all{..}) |
RuntimeCall::Utility(pallet_utility::Call::batch{..}) |
// Borrowers should be able to swap back and forth between local currencies and their variants
RuntimeCall::TokenMux(pallet_token_mux::Call::burn {..}) |
RuntimeCall::TokenMux(pallet_token_mux::Call::deposit {..}) |
RuntimeCall::TokenMux(pallet_token_mux::Call::match_swap {..})
),
ProxyType::Borrow => {
matches!(
c,
RuntimeCall::Loans(pallet_loans::Call::create { .. }) |
RuntimeCall::Loans(pallet_loans::Call::borrow { .. }) |
RuntimeCall::Loans(pallet_loans::Call::repay { .. }) |
RuntimeCall::Loans(pallet_loans::Call::write_off { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_loan_mutation { .. }) |
RuntimeCall::Loans(pallet_loans::Call::close { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_write_off_policy { .. }) |
RuntimeCall::Loans(pallet_loans::Call::update_portfolio_valuation { .. }) |
RuntimeCall::Loans(pallet_loans::Call::propose_transfer_debt { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_transfer_debt { .. }) |
// Borrowers should be able to close and execute an epoch
// in order to get liquidity from repayments in previous epochs.
RuntimeCall::PoolSystem(pallet_pool_system::Call::close_epoch{..}) |
RuntimeCall::PoolSystem(pallet_pool_system::Call::submit_solution{..}) |
RuntimeCall::PoolSystem(pallet_pool_system::Call::execute_epoch{..}) |
RuntimeCall::Utility(pallet_utility::Call::batch_all{..}) |
RuntimeCall::Utility(pallet_utility::Call::batch{..}) |
// Borrowers should be able to swap back and forth between local currencies and their variants
RuntimeCall::TokenMux(pallet_token_mux::Call::burn {..}) |
RuntimeCall::TokenMux(pallet_token_mux::Call::deposit {..}) |
RuntimeCall::TokenMux(pallet_token_mux::Call::match_swap {..})
) | ProxyType::PodOperation.filter(c)
}
ProxyType::Invest => matches!(
c,
RuntimeCall::Investments(pallet_investments::Call::update_invest_order{..}) |
Expand Down
50 changes: 26 additions & 24 deletions runtime/development/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,30 +545,32 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::proxy { .. }))
|| !matches!(c, RuntimeCall::Proxy(..))
}
ProxyType::Borrow => matches!(
c,
RuntimeCall::Loans(pallet_loans::Call::create { .. }) |
RuntimeCall::Loans(pallet_loans::Call::borrow { .. }) |
RuntimeCall::Loans(pallet_loans::Call::repay { .. }) |
RuntimeCall::Loans(pallet_loans::Call::write_off { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_loan_mutation { .. }) |
RuntimeCall::Loans(pallet_loans::Call::close { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_write_off_policy { .. }) |
RuntimeCall::Loans(pallet_loans::Call::update_portfolio_valuation { .. }) |
RuntimeCall::Loans(pallet_loans::Call::propose_transfer_debt { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_transfer_debt { .. }) |
// Borrowers should be able to close and execute an epoch
// in order to get liquidity from repayments in previous epochs.
RuntimeCall::PoolSystem(pallet_pool_system::Call::close_epoch { .. }) |
RuntimeCall::PoolSystem(pallet_pool_system::Call::submit_solution { .. }) |
RuntimeCall::PoolSystem(pallet_pool_system::Call::execute_epoch { .. }) |
RuntimeCall::Utility(pallet_utility::Call::batch_all { .. }) |
RuntimeCall::Utility(pallet_utility::Call::batch { .. }) |
// Borrowers should be able to swap back and forth between local currencies and their variants
RuntimeCall::TokenMux(pallet_token_mux::Call::burn {..}) |
RuntimeCall::TokenMux(pallet_token_mux::Call::deposit {..}) |
RuntimeCall::TokenMux(pallet_token_mux::Call::match_swap {..})
),
ProxyType::Borrow => {
matches!(
c,
RuntimeCall::Loans(pallet_loans::Call::create { .. }) |
RuntimeCall::Loans(pallet_loans::Call::borrow { .. }) |
RuntimeCall::Loans(pallet_loans::Call::repay { .. }) |
RuntimeCall::Loans(pallet_loans::Call::write_off { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_loan_mutation { .. }) |
RuntimeCall::Loans(pallet_loans::Call::close { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_write_off_policy { .. }) |
RuntimeCall::Loans(pallet_loans::Call::update_portfolio_valuation { .. }) |
RuntimeCall::Loans(pallet_loans::Call::propose_transfer_debt { .. }) |
RuntimeCall::Loans(pallet_loans::Call::apply_transfer_debt { .. }) |
// Borrowers should be able to close and execute an epoch
// in order to get liquidity from repayments in previous epochs.
RuntimeCall::PoolSystem(pallet_pool_system::Call::close_epoch { .. }) |
RuntimeCall::PoolSystem(pallet_pool_system::Call::submit_solution { .. }) |
RuntimeCall::PoolSystem(pallet_pool_system::Call::execute_epoch { .. }) |
RuntimeCall::Utility(pallet_utility::Call::batch_all { .. }) |
RuntimeCall::Utility(pallet_utility::Call::batch { .. }) |
// Borrowers should be able to swap back and forth between local currencies and their variants
RuntimeCall::TokenMux(pallet_token_mux::Call::burn {..}) |
RuntimeCall::TokenMux(pallet_token_mux::Call::deposit {..}) |
RuntimeCall::TokenMux(pallet_token_mux::Call::match_swap {..})
) | ProxyType::PodOperation.filter(c)
}
ProxyType::Invest => matches!(
c,
RuntimeCall::Investments(pallet_investments::Call::update_invest_order{..}) |
Expand Down
Loading