Module zebra_chain::amount

source ·
Expand description

Strongly-typed zatoshi amounts that prevent under/overflows.

The Amount type is parameterized by a Constraint implementation that declares the range of allowed values. In contrast to regular arithmetic operations, which return values, arithmetic on Amounts returns Results.

Modules§

  • Randomised test case generation for amounts.

Structs§

  • A runtime validated type for representing amounts of zatoshis
  • Marker type for Amount that allows negative values.
  • Marker type for Amount that requires negative or zero values.
  • Marker type for Amount that requires nonnegative values.

Enums§

  • Errors that can be returned when validating Amounts

Constants§

Traits§

  • A trait for defining constraints on Amount

Type Aliases§

  • The result of an amount operation.