Skip to content

Commit

Permalink
Correct txn get
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabaNerve committed Nov 30, 2023
1 parent 566b1b4 commit 3f04bbd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion common/db/src/parity_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ pub struct Transaction<'a>(&'a Arc<ParityDb>, Vec<(u8, Vec<u8>, Option<Vec<u8>>)

impl Get for Transaction<'_> {
fn get(&self, key: impl AsRef<[u8]>) -> Option<Vec<u8>> {
self.0.get(key)
let mut res = self.0.get(&key);
for change in &self.1 {
if change.1 == key.as_ref() {
res = change.2.clone();
}
}
res
}
}
impl DbTxn for Transaction<'_> {
Expand Down

0 comments on commit 3f04bbd

Please sign in to comment.