@@ -23,7 +23,7 @@ use sp_runtime::{FixedU128, RuntimeDebug};
2323use sp_std:: prelude:: * ;
2424
2525pub trait LoansApi < CurrencyId , AccountId , Amount > {
26- fn do_mint ( supplier : & AccountId , amount : & Amount ) -> Result < ( ) , DispatchError > ;
26+ fn do_mint ( supplier : & AccountId , amount : & Amount ) -> Result < Amount , DispatchError > ;
2727 fn do_borrow ( borrower : & AccountId , borrow : & Amount ) -> Result < ( ) , DispatchError > ;
2828 fn do_deposit_collateral ( supplier : & AccountId , lend_tokens : & Amount ) -> Result < ( ) , DispatchError > ;
2929 fn do_withdraw_collateral ( supplier : & AccountId , voucher : & Amount ) -> Result < ( ) , DispatchError > ;
@@ -34,6 +34,36 @@ pub trait LoansApi<CurrencyId, AccountId, Amount> {
3434 fn recompute_collateral_amount ( underlying : & Amount ) -> Result < Amount , DispatchError > ;
3535}
3636
37+ impl < CurrencyId , AccountId , Amount > LoansApi < CurrencyId , AccountId , Amount > for ( ) {
38+ fn do_mint ( _: & AccountId , _: & Amount ) -> Result < Amount , DispatchError > {
39+ Err ( DispatchError :: Unavailable )
40+ }
41+ fn do_borrow ( _: & AccountId , _: & Amount ) -> Result < ( ) , DispatchError > {
42+ Err ( DispatchError :: Unavailable )
43+ }
44+ fn do_deposit_collateral ( _: & AccountId , _: & Amount ) -> Result < ( ) , DispatchError > {
45+ Err ( DispatchError :: Unavailable )
46+ }
47+ fn do_withdraw_collateral ( _: & AccountId , _: & Amount ) -> Result < ( ) , DispatchError > {
48+ Err ( DispatchError :: Unavailable )
49+ }
50+ fn do_repay_borrow ( _: & AccountId , _: & Amount ) -> Result < ( ) , DispatchError > {
51+ Err ( DispatchError :: Unavailable )
52+ }
53+ fn do_redeem ( _: & AccountId , _: & Amount , _: & Amount ) -> Result < ( ) , DispatchError > {
54+ Err ( DispatchError :: Unavailable )
55+ }
56+ fn recompute_underlying_amount ( _: & Amount ) -> Result < Amount , DispatchError > {
57+ Err ( DispatchError :: Unavailable )
58+ }
59+ fn underlying_id ( _: CurrencyId ) -> Result < CurrencyId , DispatchError > {
60+ Err ( DispatchError :: Unavailable )
61+ }
62+ fn recompute_collateral_amount ( _: & Amount ) -> Result < Amount , DispatchError > {
63+ Err ( DispatchError :: Unavailable )
64+ }
65+ }
66+
3767pub trait LoansMarketDataProvider < CurrencyId , Balance > {
3868 fn get_market_info ( asset_id : CurrencyId ) -> Result < MarketInfo , DispatchError > ;
3969 fn get_market_status ( asset_id : CurrencyId ) -> Result < MarketStatus < Balance > , DispatchError > ;
0 commit comments