Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani committed Sep 6, 2024
1 parent 5644b33 commit 68a2f61
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/host/src/kv/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::collections::HashMap;
/// development purposes.
#[derive(Default, Clone, Debug, Eq, PartialEq)]
pub struct MemoryKeyValueStore {
pub store: HashMap<B256, Vec<u8>>,
pub store: HashMap<[u8; 32], Vec<u8>>,
}

impl MemoryKeyValueStore {
Expand All @@ -21,11 +21,11 @@ impl MemoryKeyValueStore {

impl KeyValueStore for MemoryKeyValueStore {
fn get(&self, key: B256) -> Option<Vec<u8>> {
self.store.get(&key).cloned()
self.store.get(&key.0).cloned()
}

fn set(&mut self, key: B256, value: Vec<u8>) -> Result<()> {
self.store.insert(key, value);
self.store.insert(key.0, value);
Ok(())
}
}

0 comments on commit 68a2f61

Please sign in to comment.