Skip to content

Commit

Permalink
add H64
Browse files Browse the repository at this point in the history
  • Loading branch information
sekisamu committed Nov 26, 2019
1 parent a0da00e commit d52614e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions primitive-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ construct_uint! {
pub struct U512(8);
}

construct_fixed_hash! {
/// Fixed-size uninterpreted hash type with 8 bytes (64 bits) size.
pub struct H64(8);
}

construct_fixed_hash! {
/// Fixed-size uninterpreted hash type with 20 bytes (160 bits) size.
pub struct H160(20);
Expand All @@ -60,6 +65,7 @@ mod serde {
impl_uint_serde!(U256, 4);
impl_uint_serde!(U512, 8);

impl_fixed_hash_serde!(H64, 8);
impl_fixed_hash_serde!(H160, 20);
impl_fixed_hash_serde!(H256, 32);
impl_fixed_hash_serde!(H512, 64);
Expand All @@ -74,6 +80,7 @@ mod codec {
impl_uint_codec!(U256, 4);
impl_uint_codec!(U512, 8);

impl_fixed_hash_codec!(H64, 8);
impl_fixed_hash_codec!(H160, 20);
impl_fixed_hash_codec!(H256, 32);
impl_fixed_hash_codec!(H512, 64);
Expand All @@ -88,6 +95,7 @@ mod rlp {
impl_uint_rlp!(U256, 4);
impl_uint_rlp!(U512, 8);

impl_fixed_hash_rlp!(H64, 8);
impl_fixed_hash_rlp!(H160, 20);
impl_fixed_hash_rlp!(H256, 32);
impl_fixed_hash_rlp!(H512, 64);
Expand Down

0 comments on commit d52614e

Please sign in to comment.