@@ -26,7 +26,7 @@ use crate::db::index_db::leaves::{
2626 IndexLayoutContractState ,
2727 IndexLayoutStarknetStorageValue ,
2828} ;
29- use crate :: db:: index_db:: types:: { IndexFilledNode , IndexNodeContext } ;
29+ use crate :: db:: index_db:: types:: { EmptyNodeData , IndexFilledNode , IndexNodeContext } ;
3030use crate :: hash_function:: hash:: TreeHashFunctionImpl ;
3131use crate :: patricia_merkle_tree:: leaf:: leaf_impl:: ContractState ;
3232use crate :: patricia_merkle_tree:: types:: CompiledClassHash ;
@@ -35,7 +35,9 @@ use crate::patricia_merkle_tree::types::CompiledClassHash;
3535///
3636/// Useful for using the same data for computing the hash and creating an index layout leaf
3737/// instance.
38- fn index_leaf_data_from_hash_data < L : Leaf > ( data : NodeData < L , HashOutput > ) -> NodeData < L , ( ) > {
38+ fn index_leaf_data_from_hash_data < L : Leaf > (
39+ data : NodeData < L , HashOutput > ,
40+ ) -> NodeData < L , EmptyNodeData > {
3941 match data {
4042 NodeData :: Binary ( _) | NodeData :: Edge ( _) => {
4143 unreachable ! ( "this helper is intended for leaf-only test data" )
@@ -85,15 +87,15 @@ fn starknet_storage_value_leaf_136_bits() -> IndexLayoutStarknetStorageValue {
8587fn binary_node ( ) -> IndexFilledNode < IndexLayoutContractState > {
8688 IndexFilledNode ( FilledNode {
8789 hash : HashOutput ( Felt :: from ( 1 ) ) ,
88- data : NodeData :: Binary ( BinaryData { left_data : ( ) , right_data : ( ) } ) ,
90+ data : NodeData :: Binary ( BinaryData { left_data : EmptyNodeData , right_data : EmptyNodeData } ) ,
8991 } )
9092}
9193
9294fn edge_node_short_path_len_3 ( ) -> IndexFilledNode < IndexLayoutContractState > {
9395 IndexFilledNode ( FilledNode {
9496 hash : HashOutput ( Felt :: from ( 1 ) ) ,
9597 data : NodeData :: Edge ( EdgeData {
96- bottom_data : ( ) ,
98+ bottom_data : EmptyNodeData ,
9799 // 110, right, right, left
98100 path_to_bottom : PathToBottom :: new (
99101 EdgePath ( U256 :: from ( 6_u128 ) ) ,
@@ -108,7 +110,7 @@ fn edge_node_short_path_len_10() -> IndexFilledNode<IndexLayoutContractState> {
108110 IndexFilledNode ( FilledNode {
109111 hash : HashOutput ( Felt :: from ( 1 ) ) ,
110112 data : NodeData :: Edge ( EdgeData {
111- bottom_data : ( ) ,
113+ bottom_data : EmptyNodeData ,
112114 // 0...0 seven times followed by 110
113115 path_to_bottom : PathToBottom :: new (
114116 EdgePath ( U256 :: from ( 6_u128 ) ) ,
@@ -123,7 +125,7 @@ fn edge_node_path_divisible_by_8() -> IndexFilledNode<IndexLayoutContractState>
123125 IndexFilledNode ( FilledNode {
124126 hash : HashOutput ( Felt :: from ( 1 ) ) ,
125127 data : NodeData :: Edge ( EdgeData {
126- bottom_data : ( ) ,
128+ bottom_data : EmptyNodeData ,
127129 path_to_bottom : PathToBottom :: new (
128130 // 1...1 24 times
129131 EdgePath ( U256 :: from ( ( 1_u128 << 24 ) - 1 ) ) ,
@@ -138,7 +140,7 @@ fn edge_node_path_not_divisible_by_8() -> IndexFilledNode<IndexLayoutContractSta
138140 IndexFilledNode ( FilledNode {
139141 hash : HashOutput ( Felt :: from ( 1 ) ) ,
140142 data : NodeData :: Edge ( EdgeData {
141- bottom_data : ( ) ,
143+ bottom_data : EmptyNodeData ,
142144 // 000 followed by 1...1 19 times
143145 path_to_bottom : PathToBottom :: new (
144146 EdgePath ( U256 :: from ( ( 1_u128 << 19 ) - 1 ) ) ,
@@ -153,7 +155,7 @@ fn edge_node_long_zero_path() -> IndexFilledNode<IndexLayoutContractState> {
153155 IndexFilledNode ( FilledNode {
154156 hash : HashOutput ( Felt :: from ( 1 ) ) ,
155157 data : NodeData :: Edge ( EdgeData {
156- bottom_data : ( ) ,
158+ bottom_data : EmptyNodeData ,
157159 // 0...0 path of length 250
158160 path_to_bottom : PathToBottom :: new (
159161 EdgePath ( U256 :: ZERO ) ,
@@ -168,7 +170,7 @@ fn edge_node_long_non_zero_path() -> IndexFilledNode<IndexLayoutContractState> {
168170 IndexFilledNode ( FilledNode {
169171 hash : HashOutput ( Felt :: from ( 1 ) ) ,
170172 data : NodeData :: Edge ( EdgeData {
171- bottom_data : ( ) ,
173+ bottom_data : EmptyNodeData ,
172174 // 1 followed by 250 zeros path of length 251
173175 path_to_bottom : PathToBottom :: new (
174176 EdgePath ( U256 :: from ( 1u8 ) << 250 ) ,
0 commit comments