@@ -8,10 +8,16 @@ use starknet_patricia_storage::db_object::{
88 DBObject ,
99 EmptyDeserializationContext ,
1010 EmptyKeyContext ,
11+ HasDynamicPrefix ,
1112 HasStaticPrefix ,
1213} ;
1314use starknet_patricia_storage:: errors:: { DeserializationError , SerializationError } ;
14- use starknet_patricia_storage:: storage_trait:: { DbKeyPrefix , DbValue } ;
15+ use starknet_patricia_storage:: storage_trait:: {
16+ create_db_key_no_separator,
17+ DbKey ,
18+ DbKeyPrefix ,
19+ DbValue ,
20+ } ;
1521use starknet_types_core:: felt:: Felt ;
1622
1723use crate :: block_committer:: input:: StarknetStorageValue ;
@@ -107,6 +113,11 @@ impl_leaf_for_wrappers!(
107113
108114impl DBObject for IndexLayoutContractState {
109115 type DeserializeContext = EmptyDeserializationContext ;
116+
117+ fn get_db_key ( & self , key_context : & Self :: KeyContext , suffix : & [ u8 ] ) -> DbKey {
118+ create_db_key_no_separator ( self . get_prefix ( key_context) , suffix)
119+ }
120+
110121 fn serialize ( & self ) -> Result < DbValue , SerializationError > {
111122 serialize_felts ( & [ self . 0 . class_hash . 0 , self . 0 . storage_root_hash . 0 , self . 0 . nonce . 0 ] )
112123 }
@@ -133,6 +144,10 @@ impl DBObject for IndexLayoutContractState {
133144impl DBObject for IndexLayoutCompiledClassHash {
134145 type DeserializeContext = EmptyDeserializationContext ;
135146
147+ fn get_db_key ( & self , key_context : & Self :: KeyContext , suffix : & [ u8 ] ) -> DbKey {
148+ create_db_key_no_separator ( self . get_prefix ( key_context) , suffix)
149+ }
150+
136151 fn serialize ( & self ) -> Result < DbValue , SerializationError > {
137152 serialize_felts ( & [ self . 0 . 0 ] )
138153 }
@@ -150,6 +165,10 @@ impl DBObject for IndexLayoutCompiledClassHash {
150165impl DBObject for IndexLayoutStarknetStorageValue {
151166 type DeserializeContext = EmptyDeserializationContext ;
152167
168+ fn get_db_key ( & self , key_context : & Self :: KeyContext , suffix : & [ u8 ] ) -> DbKey {
169+ create_db_key_no_separator ( self . get_prefix ( key_context) , suffix)
170+ }
171+
153172 fn serialize ( & self ) -> Result < DbValue , SerializationError > {
154173 serialize_felts ( & [ self . 0 . 0 ] )
155174 }
0 commit comments