Merge branch 'release/v1.1.0' into feature/validator-api-tests

This commit is contained in:
benedettadavico
2022-11-07 17:36:21 +01:00
3 changed files with 6 additions and 6 deletions
@@ -82,7 +82,7 @@ impl FromStr for PledgeCap {
impl Default for PledgeCap {
fn default() -> Self {
PledgeCap::Absolute(Uint128::from(100_000_000_000u128))
PledgeCap::Percent(Percent::from_percentage_value(10).expect("This can never fail!"))
}
}
@@ -105,7 +105,7 @@ impl VestingAccount for Account {
}
fn get_end_time(&self) -> Timestamp {
self.periods[(self.num_vesting_periods() - 1) as usize].end_time()
self.periods[(self.num_vesting_periods() - 1)].end_time()
}
fn get_original_vesting(&self) -> OriginalVestingResponse {
@@ -133,7 +133,7 @@ impl VestingAccount for Account {
let start_time = match period {
Period::Before => 0,
Period::After => u64::MAX,
Period::In(idx) => self.periods[idx as usize].start_time,
Period::In(idx) => self.periods[idx].start_time,
};
let coin = self.total_delegations_at_timestamp(storage, start_time)?;
@@ -179,7 +179,7 @@ impl VestingAccount for Account {
let start_time = match period {
Period::Before => 0,
Period::After => u64::MAX,
Period::In(idx) => self.periods[idx as usize].start_time,
Period::In(idx) => self.periods[idx].start_time,
};
let amount = if let Some(bond) = self
+2 -2
View File
@@ -15,7 +15,7 @@ pub struct VestingPeriod {
impl VestingPeriod {
pub fn end_time(&self) -> Timestamp {
Timestamp::from_seconds(self.start_time + self.period_seconds as u64)
Timestamp::from_seconds(self.start_time + self.period_seconds)
}
}
@@ -26,7 +26,7 @@ pub fn populate_vesting_periods(
let mut periods = Vec::with_capacity(vesting_spec.num_periods() as usize);
for i in 0..vesting_spec.num_periods() {
let period = VestingPeriod {
start_time: start_time + i as u64 * vesting_spec.period_seconds(),
start_time: start_time + i * vesting_spec.period_seconds(),
period_seconds: vesting_spec.period_seconds(),
};
periods.push(period);