Skip to content

Commit

Permalink
Add separate files for evm and bitcoin chain
Browse files Browse the repository at this point in the history
  • Loading branch information
gemcoder21 committed Aug 31, 2023
1 parent d5c194a commit b252f68
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
22 changes: 0 additions & 22 deletions primitives/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,6 @@ pub enum Chain {
OpBNB,
}

#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
#[typeshare(swift = "Equatable, Codable, CaseIterable")]
#[serde(rename_all = "lowercase")]
pub enum BitcoinChain {
Bitcoin,
Doge
}

#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
#[typeshare(swift = "Equatable, Codable, CaseIterable")]
#[serde(rename_all = "lowercase")]
pub enum EVMChain {
Ethereum,
SmartChain,
Polygon,
Arbitrum,
Optimism,
Base,
AvalancheC,
OpBNB,
}

impl PartialEq for Chain {
fn eq(&self, other: &Self) -> bool {
return self.as_str() == other.as_str()
Expand Down
10 changes: 10 additions & 0 deletions primitives/src/chain_bitcoin.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use serde::{Serialize, Deserialize};
use typeshare::typeshare;

#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
#[typeshare(swift = "Equatable, Codable, CaseIterable")]
#[serde(rename_all = "lowercase")]
pub enum BitcoinChain {
Bitcoin,
Doge
}
16 changes: 16 additions & 0 deletions primitives/src/chain_evm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use serde::{Serialize, Deserialize};
use typeshare::typeshare;

#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
#[typeshare(swift = "Equatable, Codable, CaseIterable")]
#[serde(rename_all = "lowercase")]
pub enum EVMChain {
Ethereum,
SmartChain,
Polygon,
Arbitrum,
Optimism,
Base,
AvalancheC,
OpBNB,
}

0 comments on commit b252f68

Please sign in to comment.