From aa605b673b25d0ef09725f1a00fb0a6235c7ad52 Mon Sep 17 00:00:00 2001 From: Nicholas Ward Date: Mon, 13 Feb 2023 10:47:30 -0800 Subject: [PATCH] flag functions used only in tests --- evm/src/util.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/evm/src/util.rs b/evm/src/util.rs index 55344dcb..6b2ca479 100644 --- a/evm/src/util.rs +++ b/evm/src/util.rs @@ -145,6 +145,7 @@ pub(crate) fn biguint_to_u256(x: BigUint) -> U256 { U256::from_little_endian(&bytes) } +#[cfg(test)] pub(crate) fn le_limbs_to_biguint(x: &[u128]) -> BigUint { BigUint::from_slice( &x.iter() @@ -160,10 +161,12 @@ pub(crate) fn le_limbs_to_biguint(x: &[u128]) -> BigUint { ) } +#[cfg(test)] pub(crate) fn mem_vec_to_biguint(x: &[U256]) -> BigUint { le_limbs_to_biguint(&x.iter().map(|&n| n.try_into().unwrap()).collect_vec()) } +#[cfg(test)] pub(crate) fn biguint_to_le_limbs(x: BigUint) -> Vec { let mut digits = x.to_u32_digits(); @@ -176,6 +179,7 @@ pub(crate) fn biguint_to_le_limbs(x: BigUint) -> Vec { .collect() } +#[cfg(test)] pub(crate) fn biguint_to_mem_vec(x: BigUint) -> Vec { biguint_to_le_limbs(x) .into_iter()