From 8a45cd95353ae9fe1286dbc4fcd36faaa66c9f82 Mon Sep 17 00:00:00 2001 From: Chuyan Zhang Date: Sun, 19 Nov 2023 01:03:19 -0800 Subject: Layer 1 test not passing --- src/block_device/memory_disk.rs | 4 ++-- src/block_device/mod.rs | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/block_device') diff --git a/src/block_device/memory_disk.rs b/src/block_device/memory_disk.rs index 3876736..0639d3e 100644 --- a/src/block_device/memory_disk.rs +++ b/src/block_device/memory_disk.rs @@ -9,9 +9,9 @@ pub struct MemoryDisk { } impl MemoryDisk { - pub fn new() -> Self { + pub fn new(block_number: usize) -> Self { Self { - arena: RefCell::new(vec![0u8; BLOCK_SIZE * 16384]), + arena: RefCell::new(vec![0u8; BLOCK_SIZE * block_number]), } } } diff --git a/src/block_device/mod.rs b/src/block_device/mod.rs index c7e1362..a8fd8b7 100644 --- a/src/block_device/mod.rs +++ b/src/block_device/mod.rs @@ -1,6 +1,5 @@ /// Abstracts for block devices. /// Currently only a mock memory disk. - pub mod memory_disk; pub const BLOCK_SIZE: usize = 4096; pub trait BlockDevice { -- cgit v1.2.3-70-g09d2