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:
20
src/encoding/evm/models.rs
Normal file
20
src/encoding/evm/models.rs
Normal 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),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user