Crate zksync_utils

Source
Expand description

Various helpers used in the ZKsync stack.

Re-exports§

pub use self::misc::*;

Modules§

bytecode
http_with_retries
misc
panic_extractor
time
wait_for_tasks

Structs§

BytesToHexSerde
Used to annotate Vec<u8> fields that you want to serialize like hex-encoded string with prefix Use this struct in annotation like that [serde(with = "BytesToHexSerde::<T>"] where T is concrete prefix type (e.g. SyncBlockPrefix)
ZeroxPrefix
“0x” hex prefix

Traits§

Prefix
Trait for specifying prefix for bytes to hex serialization

Functions§

address_to_h256
address_to_u256
be_bytes_to_safe_address
be_chunks_to_h256_words
be_words_to_bytes
bigdecimal_to_u256
Converts BigDecimal value into the corresponding U256 value.
bytes_to_be_words
bytes_to_chunks
h256_to_account_address
Converts H256 value into the Address
h256_to_u32
Converts h256 value as BE into the u32
h256_to_u256
locate_workspace
Find the location of the current workspace, if this code works in workspace then it will return the correct folder if, it’s binary e.g. in docker container you have to use fallback to another directory The code has been inspired by insta https://github.com/mitsuhiko/insta/blob/master/insta/src/env.rs
u32_to_h256
Converts u32 into the H256 as BE bytes
u256_to_account_address
Converts U256 value into the Address
u256_to_big_decimal
u256_to_bytes_be
Converts U256 value into bytes array
u256_to_h256
workspace_dir_or_current_dir
Returns locate_workspace() output with the “.” fallback.

Type Aliases§

ZeroPrefixHexSerde