Skip to content

conversions between `ethereum_types` and `alloy_primitives`

Notifications You must be signed in to change notification settings

0xPolygonZero/alloy-compat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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());

About

conversions between `ethereum_types` and `alloy_primitives`

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages