11use katana_genesis:: Genesis ;
22use katana_primitives:: block:: BlockNumber ;
33use katana_primitives:: chain:: ChainId ;
4- use katana_primitives:: env:: VersionedConstantsOverrides ;
54use katana_primitives:: { eth, ContractAddress } ;
65use serde:: { Deserialize , Serialize } ;
76use url:: Url ;
87
98pub mod dev;
9+ pub mod full_node;
1010pub mod rollup;
1111
1212#[ derive( Debug , Clone , PartialEq , Eq ) ]
1313pub enum ChainSpec {
1414 Dev ( dev:: ChainSpec ) ,
1515 Rollup ( rollup:: ChainSpec ) ,
16+ FullNode ( full_node:: ChainSpec ) ,
1617}
1718
1819//////////////////////////////////////////////////////////////
@@ -25,38 +26,45 @@ impl ChainSpec {
2526 Self :: Dev ( dev:: DEV . clone ( ) )
2627 }
2728
29+ /// Creates a new [`ChainSpec`] for Starknet mainnet.
30+ pub fn mainnet ( ) -> Self {
31+ Self :: FullNode ( full_node:: ChainSpec :: mainnet ( ) )
32+ }
33+
34+ /// Creates a new [`ChainSpec`] for Starknet sepolia testnet.
35+ pub fn sepolia ( ) -> Self {
36+ Self :: FullNode ( full_node:: ChainSpec :: sepolia ( ) )
37+ }
38+
2839 pub fn id ( & self ) -> ChainId {
2940 match self {
3041 Self :: Dev ( spec) => spec. id ,
3142 Self :: Rollup ( spec) => spec. id ,
43+ Self :: FullNode ( spec) => spec. id ,
3244 }
3345 }
3446
3547 pub fn genesis ( & self ) -> & Genesis {
3648 match self {
3749 Self :: Dev ( spec) => & spec. genesis ,
3850 Self :: Rollup ( spec) => & spec. genesis ,
51+ Self :: FullNode ( spec) => & spec. genesis ,
3952 }
4053 }
4154
4255 pub fn settlement ( & self ) -> Option < & SettlementLayer > {
4356 match self {
4457 Self :: Dev ( spec) => spec. settlement . as_ref ( ) ,
4558 Self :: Rollup ( spec) => Some ( & spec. settlement ) ,
59+ Self :: FullNode ( spec) => spec. settlement . as_ref ( ) ,
4660 }
4761 }
4862
4963 pub fn fee_contracts ( & self ) -> & FeeContracts {
5064 match self {
5165 Self :: Dev ( spec) => & spec. fee_contracts ,
5266 Self :: Rollup ( spec) => & spec. fee_contracts ,
53- }
54- }
55-
56- pub fn versioned_constants_overrides ( & self ) -> Option < & VersionedConstantsOverrides > {
57- match self {
58- Self :: Dev ( spec) => spec. versioned_constants_overrides . as_ref ( ) ,
59- Self :: Rollup ( spec) => spec. versioned_constants_overrides . as_ref ( ) ,
67+ Self :: FullNode ( spec) => & spec. fee_contracts ,
6068 }
6169 }
6270}
@@ -73,6 +81,12 @@ impl From<rollup::ChainSpec> for ChainSpec {
7381 }
7482}
7583
84+ impl From < full_node:: ChainSpec > for ChainSpec {
85+ fn from ( spec : full_node:: ChainSpec ) -> Self {
86+ Self :: FullNode ( spec)
87+ }
88+ }
89+
7690impl Default for ChainSpec {
7791 fn default ( ) -> Self {
7892 Self :: dev ( )
0 commit comments