Documentation ¶
Index ¶
Constants ¶
View Source
const QuantityInvalidText = "(invalid)"
QuantityInvalidText is the textual representation of an invalid Quantity.
Variables ¶
View Source
var ( // ContextKeyGenesisHash is the key to retrieve the Genesis document's hash // value from a context. ContextKeyGenesisHash = contextKey("genesis/hash") // ContextKeyTokenSymbol is the key to retrieve the token's ticker symbol // value from a context. ContextKeyTokenSymbol = contextKey("staking/token-symbol") // ContextKeyTokenValueExponent is the key to retrieve the token's value // base-10 exponent from a context. ContextKeyTokenValueExponent = contextKey("staking/token-value-exponent") // ContextKeyTokenValueSign is the key to retrieve the token's value sign // from a context. ContextKeyTokenValueSign = contextKey("staking/token-value-sign") // ContextKeyCommissionScheduleIndex is the key to retrieve the rate (bound) // index in a commission schedule (amendment). ContextKeyCommissionScheduleIndex = contextKey("staking/commission-schedule-index") )
Functions ¶
Types ¶
type PrettyPrinter ¶
type PrettyPrinter interface { // PrettyPrint writes a pretty-printed representation of the type // to the given writer. PrettyPrint(ctx context.Context, prefix string, w io.Writer) // PrettyType returns a representation of the type that can be used for pretty printing. PrettyType() (interface{}, error) }
PrettyPrinter is an interface for types that know how to pretty print themselves (e.g., to be displayed in a CLI).
type Quantity ¶ added in v0.2100.0
type Quantity struct {
// contains filtered or unexported fields
}
Quantity is a quantity.Quantity wrapper for pretty-printing.
Operations over it never return an error, but just record that the Quantity has become invalid.
func NewFromQuanQuantity ¶ added in v0.2100.0
NewFromQuanQuantity creates a new Quantity from a given quantity.Quantity object.
func NewQuantity ¶ added in v0.2100.0
func NewQuantity() (q Quantity)
NewQuantity creates a new Quantity, initialized to zero.
Click to show internal directories.
Click to hide internal directories.