Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
hide api_doc module behind cfg(doc)
  • Loading branch information
agryaznov committed Jan 5, 2023
commit 1af74cc74a7171c73f5a05f6ef3305e304ea617c
1 change: 1 addition & 0 deletions frame/contracts/proc-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ fn expand_env(def: &mut EnvDef, docs: bool) -> TokenStream2 {
/// Every function described in this module's sub module's traits uses this sub module's identifier
/// as its imported module name. The identifier of the function is the function's imported name.
/// According to the [WASM spec of imports](https://webassembly.github.io/spec/core/text/modules.html#text-import).
#[cfg(doc)]
pub mod api_doc {
#docs
}
Expand Down
5 changes: 4 additions & 1 deletion frame/contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,12 @@ pub use crate::{
migration::Migration,
pallet::*,
schedule::{HostFnWeights, InstructionWeights, Limits, Schedule},
wasm::{api_doc, Determinism},
wasm::Determinism,
};

#[cfg(doc)]
pub use crate::wasm::api_doc;

type CodeHash<T> = <T as frame_system::Config>::Hash;
type TrieId = BoundedVec<u8, ConstU32<128>>;
type BalanceOf<T> =
Expand Down
5 changes: 4 additions & 1 deletion frame/contracts/src/wasm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ mod runtime;
pub use crate::wasm::code_cache::reinstrument;
pub use crate::wasm::{
prepare::TryInstantiate,
runtime::{api_doc, CallFlags, Environment, ReturnCode, Runtime, RuntimeCosts},
runtime::{CallFlags, Environment, ReturnCode, Runtime, RuntimeCosts},
};

#[cfg(doc)]
pub use crate::wasm::runtime::api_doc;

use crate::{
exec::{ExecResult, Executable, ExportedFunction, Ext},
gas::GasMeter,
Expand Down