From 3b9c227ee10adafba9a2c14bac34fb7341bc45c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Zemanovi=C4=8D?= Date: Fri, 19 Jan 2024 09:42:01 +0000 Subject: [PATCH] fixup! storage write/delete options for inclusion in merkle tree and diffs --- crates/namada/src/vm/host_env.rs | 10 ++++++---- wasm/Cargo.lock | 12 ++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/crates/namada/src/vm/host_env.rs b/crates/namada/src/vm/host_env.rs index 234ff3e0548..9141e39b48a 100644 --- a/crates/namada/src/vm/host_env.rs +++ b/crates/namada/src/vm/host_env.rs @@ -2561,11 +2561,11 @@ 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) } @@ -2573,14 +2573,16 @@ where 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) } } diff --git a/wasm/Cargo.lock b/wasm/Cargo.lock index c77cca3cd63..2beec6e8a7a 100644 --- a/wasm/Cargo.lock +++ b/wasm/Cargo.lock @@ -393,9 +393,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bitvec" @@ -3058,7 +3058,7 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", "redox_syscall", ] @@ -3402,7 +3402,6 @@ name = "namada_core" version = "0.30.1" dependencies = [ "bech32 0.8.1", - "bitflags 2.4.1", "borsh", "borsh-ext", "chrono", @@ -3674,6 +3673,7 @@ dependencies = [ name = "namada_storage" version = "0.30.1" dependencies = [ + "bitflags 2.4.2", "borsh", "itertools 0.10.5", "namada_core", @@ -4517,7 +4517,7 @@ checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.4.1", + "bitflags 2.4.2", "lazy_static", "num-traits", "rand 0.8.5", @@ -5065,7 +5065,7 @@ version = "0.38.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys",