Skip to content

Commit

Permalink
fixup! storage write/delete options for inclusion in merkle tree and …
Browse files Browse the repository at this point in the history
…diffs
  • Loading branch information
tzemanovic committed Jan 19, 2024
1 parent 2971c2f commit 3b9c227
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
10 changes: 6 additions & 4 deletions crates/namada/src/vm/host_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2561,26 +2561,28 @@ where
&mut self,
key: &Key,
data: impl AsRef<[u8]>,
_action: WriteOpts,
action: WriteOpts,
) -> Result<(), namada_state::StorageError> {
let write_log = unsafe { self.write_log.get() };
let (gas, _size_diff) = write_log
.write(key, data.as_ref().to_vec())
.write_with_opts(key, data.as_ref().to_vec(), action)
.into_storage_result()?;
ibc_tx_charge_gas(self, gas)
}

fn delete_with_opts(
&mut self,
key: &Key,
_action: WriteOpts,
action: WriteOpts,
) -> Result<(), namada_state::StorageError> {
if key.is_validity_predicate().is_some() {
return Err(TxRuntimeError::CannotDeleteVp).into_storage_result();
}

let write_log = unsafe { self.write_log.get() };
let (gas, _size_diff) = write_log.delete(key).into_storage_result()?;
let (gas, _size_diff) = write_log
.delete_with_opts(key, action)
.into_storage_result()?;
ibc_tx_charge_gas(self, gas)
}
}
Expand Down
12 changes: 6 additions & 6 deletions wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3b9c227

Please sign in to comment.