Skip to content

Commit 0128b44

Browse files
Seulgi Kimsgkim126
authored andcommitted
Reorder the methods of MemoryDB to correspond to HashDB's
1 parent f54589c commit 0128b44

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

util/memorydb/src/lib.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,6 @@ impl MemoryDB {
174174
}
175175

176176
impl HashDB for MemoryDB {
177-
fn get(&self, key: &H256) -> Option<DBValue> {
178-
if key == &BLAKE_NULL_RLP {
179-
return Some(NULL_RLP.to_vec())
180-
}
181-
182-
match self.data.get(key) {
183-
Some(&(ref d, rc)) if rc > 0 => Some(d.clone()),
184-
_ => None,
185-
}
186-
}
187-
188177
fn keys(&self) -> HashMap<H256, i32> {
189178
self.data
190179
.iter()
@@ -198,6 +187,17 @@ impl HashDB for MemoryDB {
198187
.collect()
199188
}
200189

190+
fn get(&self, key: &H256) -> Option<DBValue> {
191+
if key == &BLAKE_NULL_RLP {
192+
return Some(NULL_RLP.to_vec())
193+
}
194+
195+
match self.data.get(key) {
196+
Some(&(ref d, rc)) if rc > 0 => Some(d.clone()),
197+
_ => None,
198+
}
199+
}
200+
201201
fn contains(&self, key: &H256) -> bool {
202202
if key == &BLAKE_NULL_RLP {
203203
return true

0 commit comments

Comments
 (0)