BuiltinValueOps
Internal helpers for BuiltinValue operations in CEK machine.
CIP-0153 MaryEraValue implementation.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
BuiltinValueOps.type
Members list
Value members
Concrete methods
Convert Data to BuiltinValue.
Convert Data to BuiltinValue.
Attributes
- Throws
-
BuiltinException
if data is not in the expected format, or validation fails
Insert or update a token amount in a value.
Insert or update a token amount in a value.
If amount is 0, the token is removed. If the inner map becomes empty, the currency is removed.
Attributes
- Throws
-
BuiltinException
if currency or token name exceeds 32 bytes, or quantity overflows 128-bit range
Lookup a token amount in a value.
Lookup a token amount in a value.
Returns 0 if the token is not found.
Attributes
Multiply all amounts in a value by a scalar.
Multiply all amounts in a value by a scalar.
If scalar is 0, returns empty value.
Attributes
- Throws
-
BuiltinException
if any resulting quantity overflows 128-bit range
Convert BuiltinValue to Data representation.
Convert BuiltinValue to Data representation.
Data encoding: Map ByteString (Map ByteString Integer)
Delegates to BuiltinValue.toData.
Attributes
Merge two values, adding amounts for matching tokens.
Merge two values, adding amounts for matching tokens.
Zero-sum tokens are removed. Empty inner maps are removed.
Attributes
- Throws
-
BuiltinException
if any resulting quantity overflows 128-bit range
Check if v1 contains at least the amounts in v2.
Check if v1 contains at least the amounts in v2.
For each token in v2, check that v1 has at least that amount.