Module amount

Module 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§

arbitrary
Randomised test case generation for amounts.

Structs§

Amount
A runtime validated type for representing amounts of zatoshis
DeferredPoolBalanceChange
Represents a change to the deferred pool balance from a coinbase transaction.
NegativeAllowed
Marker type for Amount that allows negative values.
NegativeOrZero
Marker type for Amount that requires negative or zero values.
NonNegative
Marker type for Amount that requires nonnegative values.

Enums§

Error
Errors that can be returned when validating Amounts.

Constants§

COIN
Number of zatoshis in 1 ZEC
MAX_MONEY
The maximum zatoshi amount.

Traits§

Constraint
A trait for defining constraints on Amount

Type Aliases§

Result
The result of an amount operation.