Add impl to converto from U256 to [u8; 32]
This commit is contained in:
parent
97ecf175c8
commit
d3c335e7f7
|
@ -1369,4 +1369,12 @@ macro_rules! impl_quickcheck_arbitrary_for_uint {
|
||||||
}
|
}
|
||||||
|
|
||||||
construct_uint!(U256, 4);
|
construct_uint!(U256, 4);
|
||||||
construct_uint!(U512, 8);
|
construct_uint!(U512, 8);
|
||||||
|
|
||||||
|
impl From<U256> for [u8; 32] {
|
||||||
|
fn from(number: U256) -> Self {
|
||||||
|
let mut arr = [0u8; 32];
|
||||||
|
number.to_big_endian(&mut arr);
|
||||||
|
arr
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue