Skip to content

Commit ebbf71d

Browse files
committed
Stop checking the AllowedConversion generators in order to achieve performance.
1 parent f7692e3 commit ebbf71d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

crates/shielded_token/src/conversion.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::collections::BTreeMap;
66
#[cfg(any(feature = "multicore", test))]
77
use masp_primitives::asset_type::AssetType;
88
#[cfg(any(feature = "multicore", test))]
9-
use masp_primitives::convert::AllowedConversion;
9+
use masp_primitives::convert::{AllowedConversion, UncheckedAllowedConversion};
1010
#[cfg(any(feature = "multicore", test))]
1111
use masp_primitives::transaction::components::I128Sum as MaspAmount;
1212
use namada_controller::PDController;
@@ -529,7 +529,8 @@ where
529529
S: StorageWrite + StorageRead + WithConversionState,
530530
{
531531
let conversion_key_prefix = masp_conversion_key_prefix();
532-
let mut conversion_updates = BTreeMap::new();
532+
let mut conversion_updates =
533+
BTreeMap::<_, UncheckedAllowedConversion>::new();
533534
// Read conversion updates from storage and store them in a map
534535
for conv_result in iter_prefix_with_filter_map(
535536
storage,
@@ -556,7 +557,7 @@ where
556557
);
557558
continue;
558559
};
559-
leaf.conversion = conv;
560+
leaf.conversion = conv.0;
560561
}
561562
// Delete the updates now that they have been applied
562563
storage.delete_prefix(&conversion_key_prefix)?;

examples/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ masp_proofs = { workspace = true, default-features = false, features = [
3434
"download-params",
3535
] }
3636
namada_apps_lib = { workspace = true, features = ["migrations"] }
37-
namada_core = { workspace = true, default-features = false }
37+
namada_core = { workspace = true }
3838
namada_macros = { workspace = true }
3939
namada_migrations = { workspace = true, features = ["masp"] }
4040
namada_parameters = { workspace = true }

0 commit comments

Comments
 (0)