@@ -47,6 +47,9 @@ static STARKNET_BLOCK_HASH0: LazyLock<Felt> = LazyLock::new(|| {
4747pub static STARKNET_BLOCK_HASH1 : LazyLock < Felt > = LazyLock :: new ( || {
4848 ascii_as_felt ( "STARKNET_BLOCK_HASH1" ) . expect ( "ascii_as_felt failed for 'STARKNET_BLOCK_HASH1'" )
4949} ) ;
50+ pub static STARKNET_BLOCK_HASH2 : LazyLock < Felt > = LazyLock :: new ( || {
51+ ascii_as_felt ( "STARKNET_BLOCK_HASH2" ) . expect ( "ascii_as_felt failed for 'STARKNET_BLOCK_HASH2'" )
52+ } ) ;
5053pub static STARKNET_GAS_PRICES0 : LazyLock < Felt > = LazyLock :: new ( || {
5154 ascii_as_felt ( "STARKNET_GAS_PRICES0" ) . expect ( "ascii_as_felt failed for 'STARKNET_GAS_PRICES0'" )
5255} ) ;
@@ -56,13 +59,15 @@ pub static STARKNET_GAS_PRICES0: LazyLock<Felt> = LazyLock::new(|| {
5659pub enum BlockHashVersion {
5760 V0_13_2 ,
5861 V0_13_4 ,
62+ V0_14_3 ,
5963}
6064
6165impl From < BlockHashVersion > for StarknetVersion {
6266 fn from ( value : BlockHashVersion ) -> Self {
6367 match value {
6468 BlockHashVersion :: V0_13_2 => StarknetVersion :: V0_13_2 ,
6569 BlockHashVersion :: V0_13_4 => StarknetVersion :: V0_13_4 ,
70+ BlockHashVersion :: V0_14_3 => StarknetVersion :: V0_14_3 ,
6671 }
6772 }
6873}
@@ -76,8 +81,10 @@ impl TryFrom<StarknetVersion> for BlockHashVersion {
7681 } else if value < Self :: V0_13_4 . into ( ) {
7782 // Starknet versions 0.13.2 and 0.13.3 both have the same block hash mechanism.
7883 Ok ( Self :: V0_13_2 )
79- } else {
84+ } else if value < Self :: V0_14_3 . into ( ) {
8085 Ok ( Self :: V0_13_4 )
86+ } else {
87+ Ok ( Self :: V0_14_3 )
8188 }
8289 }
8390}
@@ -90,6 +97,7 @@ impl From<BlockHashVersion> for BlockHashConstant {
9097 match block_hash_version {
9198 BlockHashVersion :: V0_13_2 => * STARKNET_BLOCK_HASH0 ,
9299 BlockHashVersion :: V0_13_4 => * STARKNET_BLOCK_HASH1 ,
100+ BlockHashVersion :: V0_14_3 => * STARKNET_BLOCK_HASH2 ,
93101 }
94102 }
95103}
0 commit comments