feat: Add ChainId model

Remove to_chain_id helper method

--- don't change below this line ---
ENG-4081 Took 28 minutes
This commit is contained in:
Diana Carvalho
2025-01-30 15:01:53 +00:00
parent 0e70e827a0
commit 089e7d2e0f
4 changed files with 27 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
use alloy_primitives::{aliases::U24, Address, Keccak256, U256};
use alloy_sol_types::SolValue;
use num_bigint::BigUint;
use tycho_core::{models::Chain, Bytes};
use tycho_core::Bytes;
use crate::encoding::errors::EncodingError;
@@ -65,10 +65,3 @@ pub fn percentage_to_uint24(percentage: f64) -> U24 {
let scaled = (percentage / 100.0) * (MAX_UINT24 as f64);
U24::from(scaled.round())
}
pub fn to_chain_id(chain: Chain) -> Result<u64, EncodingError> {
match chain {
Chain::Ethereum => Ok(1),
_ => Err(EncodingError::FatalError("Unsupported chain".to_string())),
}
}