Skip to content

Commit

Permalink
cashflow module
Browse files Browse the repository at this point in the history
  • Loading branch information
lemunozm committed Aug 4, 2023
1 parent cb7b9ce commit 24b7c29
Show file tree
Hide file tree
Showing 7 changed files with 370 additions and 349 deletions.
2 changes: 1 addition & 1 deletion pallets/loans/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ cfg-traits = { path = "../../libs/traits", default-features = false }
cfg-types = { path = "../../libs/types", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, branch = "polkadot-v0.9.38" }

strum = { version = "0.24", default-features = false, features = ["derive"] }
chrono = { version = "0.4", default-features = false }
chronoutil = "0.2"
strum = { version = "0.24", default-features = false, features = ["derive"] }

# Optionals for benchmarking
frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.38" }
Expand Down
4 changes: 2 additions & 2 deletions pallets/loans/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ use crate::{
},
pallet::*,
types::{
cashflow::{InterestPayments, Maturity, PayDownSchedule, RepaymentSchedule},
policy::{WriteOffRule, WriteOffTrigger},
valuation::{DiscountedCashFlow, ValuationMethod},
BorrowRestrictions, InterestPayments, LoanMutation, LoanRestrictions, Maturity,
PayDownSchedule, RepayRestrictions, RepaymentSchedule,
BorrowRestrictions, LoanMutation, LoanRestrictions, RepayRestrictions,
},
};

Expand Down
4 changes: 2 additions & 2 deletions pallets/loans/src/entities/loans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ use super::pricing::{
use crate::{
pallet::{AssetOf, Config, Error, PriceOf},
types::{
cashflow::RepaymentSchedule,
policy::{WriteOffStatus, WriteOffTrigger},
BorrowLoanError, BorrowRestrictions, CloseLoanError, CreateLoanError, LoanMutation,
LoanRestrictions, MutationError, RepaidAmount, RepayLoanError, RepayRestrictions,
RepaymentSchedule,
},
};

Expand Down Expand Up @@ -531,7 +531,7 @@ impl<T: Config> ActiveLoan<T> {

#[cfg(feature = "runtime-benchmarks")]
pub fn set_maturity(&mut self, duration: Moment) {
self.schedule.maturity = crate::types::Maturity::fixed(duration);
self.schedule.maturity = crate::types::cashflow::Maturity::fixed(duration);
}
}

Expand Down
6 changes: 3 additions & 3 deletions pallets/loans/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ use super::{
},
pallet::{ActiveLoans, Error, LastLoanId, PortfolioValuation},
types::{
cashflow::{InterestPayments, Maturity, PayDownSchedule, RepaymentSchedule},
policy::{WriteOffRule, WriteOffStatus, WriteOffTrigger},
valuation::{DiscountedCashFlow, ValuationMethod},
BorrowLoanError, BorrowRestrictions, Change, CloseLoanError, CreateLoanError,
InterestPayments, InternalMutation, LoanMutation, LoanRestrictions, Maturity,
MutationError, PayDownSchedule, RepayLoanError, RepayRestrictions, RepaymentSchedule,
WrittenOffError,
InternalMutation, LoanMutation, LoanRestrictions, MutationError, RepayLoanError,
RepayRestrictions, WrittenOffError,
},
};

Expand Down
Loading

0 comments on commit 24b7c29

Please sign in to comment.