Add new inflation feature-ids (#13671)

* Add new inflation feature-ids, and full_inflation default values

* Compute inflation start from full_inflation activation

* Include pico_inflation in inflation start computation

* Add full-inflation constructor

* Align inflation taper with rewards accrual start and catch overflow edge case
This commit is contained in:
Tyera Eulberg
2020-11-20 09:54:41 -07:00
committed by GitHub
parent 11e92f0c9f
commit c75d97e3f2
3 changed files with 184 additions and 11 deletions

View File

@@ -69,6 +69,17 @@ impl Inflation {
Self::new_fixed(0.0001) // 0.01% inflation
}
pub fn full() -> Self {
Self {
initial: DEFAULT_INITIAL,
terminal: DEFAULT_TERMINAL,
taper: DEFAULT_TAPER,
foundation: 0.0,
foundation_term: 0.0,
__unused: 0.0,
}
}
/// inflation rate at year
pub fn total(&self, year: f64) -> f64 {
assert!(year >= 0.0);