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:
@@ -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())),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user