Module utils
Expand description
Common Ethereum utilities.
Structs§
- Simple
Keccak-256
hasher. - Ethereum unit. Always less than
77
.
Enums§
- This enum holds the numeric types that a possible to be returned by
parse_units
and that are taken byformat_units
. - Error type for
Unit
-related operations.
Constants§
- The prefix used for hashing messages according to EIP-191.
Functions§
- Allocates memory on the heap then places
x
into it, returning an error if the allocation fails. - Constructs a new box with uninitialized contents on the heap, returning an error if the allocation fails.
- Hash a message according to EIP-191 (version
0x01
). - Constructs a message according to EIP-191 (version
0x01
). - Formats the given number of Wei as an Ether amount.
- Formats the given number of Wei as the given unit.
- Simple interface to the
Keccak-256
hash function. - Converts the input to a U256 and converts from Ether to Wei.
- Parses a decimal number and multiplies it with 10^units.
- Tries to collect the elements of an iterator into a
Vec
. - Tries to create a
Vec
with the given capacity.