@@ -22,10 +22,11 @@ use super::original_skeleton_tree::node::OriginalSkeletonNode;
2222use super :: types:: { NodeIndex , SubTreeHeight } ;
2323use crate :: felt:: u256_from_felt;
2424use crate :: patricia_merkle_tree:: errors:: TypesError ;
25+ use crate :: patricia_merkle_tree:: filled_tree:: node_serde:: FACT_LAYOUT_DB_KEY_SEPARATOR ;
2526use crate :: patricia_merkle_tree:: node_data:: errors:: { LeafError , LeafResult } ;
2627use crate :: patricia_merkle_tree:: node_data:: leaf:: LeafWithEmptyKeyContext ;
2728
28- pub ( crate ) const TEST_PREFIX : & [ u8 ] = & [ 0 ] ;
29+ const TEST_PREFIX : & [ u8 ] = & [ 0 ] ;
2930
3031#[ derive( Debug , PartialEq , Clone , Copy , Default , Eq ) ]
3132pub struct MockLeaf ( pub Felt ) ;
@@ -38,6 +39,8 @@ impl HasStaticPrefix for MockLeaf {
3839}
3940
4041impl DBObject for MockLeaf {
42+ const DB_KEY_SEPARATOR : & [ u8 ] = FACT_LAYOUT_DB_KEY_SEPARATOR ;
43+
4144 type DeserializeContext = EmptyDeserializationContext ;
4245
4346 fn serialize ( & self ) -> SerializationResult < DbValue > {
@@ -117,11 +120,19 @@ pub fn create_32_bytes_entry(simple_val: u128) -> [u8; 32] {
117120}
118121
119122fn create_inner_node_patricia_key ( val : Felt ) -> DbKey {
120- create_db_key ( PatriciaPrefix :: InnerNode . into ( ) , & val. to_bytes_be ( ) )
123+ create_db_key (
124+ PatriciaPrefix :: InnerNode . into ( ) ,
125+ FACT_LAYOUT_DB_KEY_SEPARATOR ,
126+ & val. to_bytes_be ( ) ,
127+ )
121128}
122129
123130pub fn create_leaf_patricia_key < L : LeafWithEmptyKeyContext > ( val : u128 ) -> DbKey {
124- create_db_key ( L :: get_static_prefix ( & EmptyKeyContext ) , & U256 :: from ( val) . to_be_bytes ( ) )
131+ create_db_key (
132+ L :: get_static_prefix ( & EmptyKeyContext ) ,
133+ FACT_LAYOUT_DB_KEY_SEPARATOR ,
134+ & U256 :: from ( val) . to_be_bytes ( ) ,
135+ )
125136}
126137
127138fn create_binary_val ( left : Felt , right : Felt ) -> DbValue {
@@ -196,7 +207,11 @@ pub fn create_root_edge_entry(old_root: u128, subtree_height: SubTreeHeight) ->
196207 // Assumes path is 0.
197208 let length = SubTreeHeight :: ACTUAL_HEIGHT . 0 - subtree_height. 0 ;
198209 let new_root = old_root + u128:: from ( length) ;
199- let key = create_db_key ( PatriciaPrefix :: InnerNode . into ( ) , & Felt :: from ( new_root) . to_bytes_be ( ) ) ;
210+ let key = create_db_key (
211+ PatriciaPrefix :: InnerNode . into ( ) ,
212+ FACT_LAYOUT_DB_KEY_SEPARATOR ,
213+ & Felt :: from ( new_root) . to_bytes_be ( ) ,
214+ ) ;
200215 let value = DbValue (
201216 Felt :: from ( old_root)
202217 . to_bytes_be ( )
0 commit comments