@@ -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 ;
@@ -105,6 +111,11 @@ impl_leaf_for_wrappers!(
105111
106112impl DBObject for IndexLayoutContractState {
107113 type DeserializeContext = EmptyDeserializationContext ;
114+
115+ fn get_db_key ( & self , key_context : & Self :: KeyContext , suffix : & [ u8 ] ) -> DbKey {
116+ create_db_key_no_separator ( self . get_prefix ( key_context) , suffix)
117+ }
118+
108119 fn serialize ( & self ) -> Result < DbValue , SerializationError > {
109120 serialize_felts ( & [ self . 0 . class_hash . 0 , self . 0 . storage_root_hash . 0 , self . 0 . nonce . 0 ] )
110121 }
@@ -131,6 +142,10 @@ impl DBObject for IndexLayoutContractState {
131142impl DBObject for IndexLayoutCompiledClassHash {
132143 type DeserializeContext = EmptyDeserializationContext ;
133144
145+ fn get_db_key ( & self , key_context : & Self :: KeyContext , suffix : & [ u8 ] ) -> DbKey {
146+ create_db_key_no_separator ( self . get_prefix ( key_context) , suffix)
147+ }
148+
134149 fn serialize ( & self ) -> Result < DbValue , SerializationError > {
135150 serialize_felts ( & [ self . 0 . 0 ] )
136151 }
@@ -148,6 +163,10 @@ impl DBObject for IndexLayoutCompiledClassHash {
148163impl DBObject for IndexLayoutStarknetStorageValue {
149164 type DeserializeContext = EmptyDeserializationContext ;
150165
166+ fn get_db_key ( & self , key_context : & Self :: KeyContext , suffix : & [ u8 ] ) -> DbKey {
167+ create_db_key_no_separator ( self . get_prefix ( key_context) , suffix)
168+ }
169+
151170 fn serialize ( & self ) -> Result < DbValue , SerializationError > {
152171 serialize_felts ( & [ self . 0 . 0 ] )
153172 }
0 commit comments