Crate floresta_common

Source
Expand description

§Floresta Common

Provides utility functions, macros and modules to be used in other Floresta crates.

Re-exports§

pub use spsc::Channel;

Modules§

macros
This module has useful macros for usage on other crates.
preludestd
Provides implementation for basic std types, without assuming we have a std library.
service_flags
Non-standard service flags that aren’t in rust-bitcoin yet.
spsc
A no-std Single Producer, Single Consumer channel for unidirectional message exchange between modules. This module don’t use anything from the standard lib and can be easily used in no-std environments. We only use mem::take from core.

Macros§

acchashes
Validates utreexo node hashes at compile time. Requires FromStr and BitcoinNodeHash in scope.
assert_err
Panic if the expression is not Err(_).
assert_ok
Panic if the expression is not Ok(_).
bhash
Validates a block hash at compile time. Requires FromStr and BlockHash in scope.
impl_error_from
Implements the From trait for converting a specific type into an enum variant or struct field.

Structs§

FractionAvg
A simple fraction struct that allows adding numbers to the numerator and denominator

Functions§

get_hash_from_u8
Computes the SHA-256 digest of the byte slice data and returns a Hash from bitcoin_hashes.
get_spk_hash
Computes the SHA-256 digest of a script, reverses its bytes, and returns a Hash from bitcoin_hashes.
parse_descriptorsdescriptors-std or descriptors-no-std
Takes an array of descriptors as String, performs sanity checks on each one and returns list of parsed descriptors.