From 89fd030491386b8628969bcc6a95debf16f7c66c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Zemanovi=C4=8D?= Date: Mon, 31 Oct 2022 15:54:52 +0100 Subject: [PATCH] queries: fix unused import in wasm build --- shared/src/ledger/queries/shell.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/shared/src/ledger/queries/shell.rs b/shared/src/ledger/queries/shell.rs index 62f32c0f87b..559a9590150 100644 --- a/shared/src/ledger/queries/shell.rs +++ b/shared/src/ledger/queries/shell.rs @@ -6,10 +6,12 @@ use crate::ledger::queries::{require_latest_height, EncodedResponseQuery}; use crate::ledger::storage::{DBIter, StorageHasher, DB}; use crate::ledger::storage_api::{self, ResultExt, StorageRead}; use crate::types::storage::{self, Epoch, PrefixValue}; +#[cfg(all(feature = "wasm-runtime", feature = "ferveo-tpke"))] use crate::types::transaction::TxResult; #[cfg(all(feature = "wasm-runtime", feature = "ferveo-tpke"))] use crate::types::transaction::{DecryptedTx, TxType}; +#[cfg(all(feature = "wasm-runtime", feature = "ferveo-tpke"))] router! {SHELL, // Epoch of the last committed block ( "epoch" ) -> Epoch = epoch, @@ -30,6 +32,24 @@ router! {SHELL, -> bool = storage_has_key, } +#[cfg(not(all(feature = "wasm-runtime", feature = "ferveo-tpke")))] +router! {SHELL, + // Epoch of the last committed block + ( "epoch" ) -> Epoch = epoch, + + // Raw storage access - read value + ( "value" / [storage_key: storage::Key] ) + -> Vec = (with_options storage_value), + + // Raw storage access - prefix iterator + ( "prefix" / [storage_key: storage::Key] ) + -> Vec = (with_options storage_prefix), + + // Raw storage access - is given storage key present? + ( "has_key" / [storage_key: storage::Key] ) + -> bool = storage_has_key, +} + // Handlers: #[cfg(all(feature = "wasm-runtime", feature = "ferveo-tpke"))]