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

@@ -0,0 +1,20 @@
use tycho_core::models::Chain;
pub struct ChainId(u64);
impl ChainId {
pub fn id(&self) -> u64 {
self.0
}
}
impl From<Chain> for ChainId {
fn from(chain: Chain) -> Self {
match chain {
Chain::Ethereum => ChainId(1),
Chain::ZkSync => ChainId(324),
Chain::Arbitrum => ChainId(42161),
Chain::Starknet => ChainId(0),
}
}
}