3 unstable releases
0.2.0 | Nov 7, 2024 |
---|---|
0.1.1 | Nov 7, 2024 |
0.1.0 | Aug 31, 2024 |
#7 in #compat
399 downloads per month
Used in 2 crates
9KB
131 lines
Conversions between ethereum_types
and alloy_primitives
.
use alloy_compat::Compat as _;
// from alloy to ethereum_types
let address = alloy::address!("deadbeefdeadbeefdeadbeefdeadbeef00000000");
let _: eth::Address = address.compat();
// from ethereum_types to alloy
let hash = eth::H256::zero();
let _: alloy::B256 = hash.compat();
// integers are supported
let int = eth::U128::MAX;
assert_eq!(alloy::U128::MAX, int.compat());
lib.rs
:
Conversions between ethereum_types
and alloy_primitives
.
use alloy_compat::Compat as _;
// from alloy to ethereum_types
let address = alloy::address!("deadbeefdeadbeefdeadbeefdeadbeef00000000");
let _: eth::Address = address.compat();
// from ethereum_types to alloy
let hash = eth::H256::zero();
let _: alloy::B256 = hash.compat();
// integers are supported
let int = eth::U128::MAX;
assert_eq!(alloy::U128::MAX, int.compat());
Dependencies
~5.5MB
~100K SLoC