File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
deku-p/src/core/block_storage/tests Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ let test_200k_block_load env () =
152152let test_200k_block_load env () =
153153 Eio.Switch. run @@ fun sw ->
154154 let block_storage = make_block_storage env sw in
155- let (Block { hash; _ } as block) = block ~default_block_size: 200_000 in
155+ let (Block { hash; level; _ } as block) = block ~default_block_size: 200_000 in
156156 Block_storage. save_block ~block block_storage;
157157 let retrieved_block =
158158 match Block_storage. find_block_by_hash ~block_hash: hash block_storage with
@@ -163,6 +163,16 @@ let test_200k_block_load env () =
163163 ~msg: " hash loaded block is equal to saved block" ~expected: block
164164 ~actual: retrieved_block;
165165
166+ let retrieved_block =
167+ match Block_storage. find_block_by_level ~level block_storage with
168+ | Some json -> Block. t_of_yojson json
169+ | None -> Genesis. block
170+ in
171+
172+ Alcotest. (check' block_testable)
173+ ~msg: " level loaded block is equal to saved block" ~expected: block
174+ ~actual: retrieved_block;
175+
166176 (* TODO: Fail the switch and capture the exception instead *)
167177 let (Block_storage. Storage { worker; _ }) = block_storage in
168178 Parallel.Worker. teardown worker
You can’t perform that action at this time.
0 commit comments