Skip to content

Commit

Permalink
queries: fix unused import in wasm build
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic authored and juped committed Oct 31, 2022
1 parent a966969 commit 89fd030
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions shared/src/ledger/queries/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<u8> = (with_options storage_value),

// Raw storage access - prefix iterator
( "prefix" / [storage_key: storage::Key] )
-> Vec<PrefixValue> = (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"))]
Expand Down

0 comments on commit 89fd030

Please sign in to comment.