Skip to content

Commit

Permalink
test/storage: fix block height read test
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Nov 10, 2023
1 parent b83b9ba commit 5443a27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion apps/src/lib/node/ledger/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions core/src/ledger/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5443a27

Please sign in to comment.