Function hydra_dx_math::lbp::calculate_linear_weights[][src]

pub fn calculate_linear_weights<BlockNumber: CheckedSub + TryInto<u32> + TryInto<u128>>(
    start_x: BlockNumber,
    end_x: BlockNumber,
    start_y: LBPWeight,
    end_y: LBPWeight,
    at: BlockNumber
) -> Result<LBPWeight, MathError>
Expand description

Calculating weight at any given block in an interval using linear interpolation.

  • start_x - beginning of an interval
  • end_x - end of an interval
  • start_y - initial weight
  • end_y - final weight
  • at - block number at which to calculate the weight