Skip to main content

read_ratio_arg

Function read_ratio_arg 

Source
pub fn read_ratio_arg<T>(
    caller: &mut Caller<'_, T>,
    arg: Option<Rooted<StructRef>>,
) -> Result<Option<(i64, i64)>>
Expand description

Reads a $ratio arg ref into its (numer, denom) components. None returns for a null ref; a zero denominator is rejected as a structured trap so callers never divide by zero. Mirrors read_commodity_arg for the dimensionless Scalar stratum (a draft-split amount).