1- use starknet_api:: core:: { ClassHash , ContractAddress , Nonce } ;
1+ use starknet_api:: core:: { ClassHash , Nonce } ;
22use starknet_api:: hash:: HashOutput ;
3+ use starknet_patricia:: db_layout:: TrieType ;
34use starknet_patricia:: patricia_merkle_tree:: node_data:: errors:: LeafResult ;
45use starknet_patricia:: patricia_merkle_tree:: node_data:: leaf:: Leaf ;
56use starknet_patricia_storage:: db_object:: {
@@ -14,7 +15,6 @@ use starknet_types_core::felt::Felt;
1415use crate :: block_committer:: input:: StarknetStorageValue ;
1516use crate :: patricia_merkle_tree:: leaf:: leaf_impl:: ContractState ;
1617use crate :: patricia_merkle_tree:: types:: CompiledClassHash ;
17-
1818// Wrap the leaves types so that we can implement the [DBObject] trait differently in index
1919// layout.
2020#[ derive(
@@ -28,27 +28,6 @@ pub struct IndexLayoutCompiledClassHash(pub CompiledClassHash);
2828#[ derive( Clone , Debug , Default , Eq , PartialEq , derive_more:: From ) ]
2929pub struct IndexLayoutStarknetStorageValue ( pub StarknetStorageValue ) ;
3030
31- // TODO(Ariel): Delete this enum and use `CommitmentType` instead.
32- #[ derive( Debug , PartialEq ) ]
33- pub enum TrieType {
34- ContractsTrie ,
35- ClassesTrie ,
36- StorageTrie ( ContractAddress ) ,
37- }
38-
39- impl TrieType {
40- fn db_prefix ( & self ) -> DbKeyPrefix {
41- match self {
42- TrieType :: ContractsTrie => DbKeyPrefix :: new ( b"CONTRACTS_TREE_PREFIX" . into ( ) ) ,
43- TrieType :: ClassesTrie => DbKeyPrefix :: new ( b"CLASSES_TREE_PREFIX" . into ( ) ) ,
44- TrieType :: StorageTrie ( contract_address) => {
45- let prefix = contract_address. to_bytes_be ( ) . to_vec ( ) ;
46- DbKeyPrefix :: new ( prefix. into ( ) )
47- }
48- }
49- }
50- }
51-
5231macro_rules! impl_has_static_prefix_for_index_layouts {
5332 ( $( $ty: ty) ,* $( , ) ?) => {
5433 $(
0 commit comments