diff --git a/apps/src/lib/node/ledger/storage/mod.rs b/apps/src/lib/node/ledger/storage/mod.rs index 7a1f44e6f90..d5c6a91abcf 100644 --- a/apps/src/lib/node/ledger/storage/mod.rs +++ b/apps/src/lib/node/ledger/storage/mod.rs @@ -377,7 +377,8 @@ mod tests { "At height {height} will {}", if write_value { "write" } else { "delete" } ); - (BlockHeight::from(height as u64), write_value) + // start from height 1 - 0 is sentinel + (BlockHeight::from(height as u64 + 1), write_value) }); let key = Key::parse("key").expect("cannot parse the key string"); diff --git a/core/src/ledger/storage/mod.rs b/core/src/ledger/storage/mod.rs index c8829f64da8..14ac88fead5 100644 --- a/core/src/ledger/storage/mod.rs +++ b/core/src/ledger/storage/mod.rs @@ -614,8 +614,8 @@ where } } - /// Returns a value from the specified subspace at the given height and the - /// gas cost + /// Returns a value from the specified subspace at the given height or the + /// last committed height when 0 and the gas cost. pub fn read_with_height( &self, key: &Key,