diff --git a/Cargo.lock b/Cargo.lock index e7cff218bd..6606113f7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -460,7 +460,6 @@ dependencies = [ name = "cosmwasm-derive" version = "1.5.8" dependencies = [ - "cosmwasm-std", "syn 1.0.109", ] diff --git a/packages/derive/Cargo.toml b/packages/derive/Cargo.toml index f0722ec99c..a02dd3a0f9 100644 --- a/packages/derive/Cargo.toml +++ b/packages/derive/Cargo.toml @@ -16,10 +16,3 @@ default = [] [dependencies] syn = { version = "1.0", features = ["full"] } - -[dev-dependencies] -# Needed for testing docs -# "What's even more fun, Cargo packages actually can have cyclic dependencies. -# "(a package can have an indirect dev-dependency on itself)" -# https://users.rust-lang.org/t/does-cargo-support-cyclic-dependencies/35666/3 -cosmwasm-std = { path = "../std" } diff --git a/packages/derive/src/lib.rs b/packages/derive/src/lib.rs index 1a0f516f1f..9018439bf7 100644 --- a/packages/derive/src/lib.rs +++ b/packages/derive/src/lib.rs @@ -4,53 +4,7 @@ extern crate syn; use proc_macro::TokenStream; use std::str::FromStr; -/// This attribute macro generates the boilerplate required to call into the -/// contract-specific logic from the entry-points to the Wasm module. -/// -/// It should be added to the contract's init, handle, migrate and query implementations -/// like this: -/// ``` -/// # use cosmwasm_std::{ -/// # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, -/// # Response, QueryResponse, -/// # }; -/// # -/// # type InstantiateMsg = (); -/// # type ExecuteMsg = (); -/// # type QueryMsg = (); -/// -/// #[entry_point] -/// pub fn instantiate( -/// deps: DepsMut, -/// env: Env, -/// info: MessageInfo, -/// msg: InstantiateMsg, -/// ) -> Result { -/// # Ok(Default::default()) -/// } -/// -/// #[entry_point] -/// pub fn execute( -/// deps: DepsMut, -/// env: Env, -/// info: MessageInfo, -/// msg: ExecuteMsg, -/// ) -> Result { -/// # Ok(Default::default()) -/// } -/// -/// #[entry_point] -/// pub fn query( -/// deps: Deps, -/// env: Env, -/// msg: QueryMsg, -/// ) -> Result { -/// # Ok(Default::default()) -/// } -/// ``` -/// -/// where `InstantiateMsg`, `ExecuteMsg`, and `QueryMsg` are contract defined -/// types that implement `DeserializeOwned + JsonSchema`. +// function documented in cosmwasm-std #[proc_macro_attribute] pub fn entry_point(_attr: TokenStream, mut item: TokenStream) -> TokenStream { let cloned = item.clone(); diff --git a/packages/std/src/lib.rs b/packages/std/src/lib.rs index dcf106b96e..9333aeec10 100644 --- a/packages/std/src/lib.rs +++ b/packages/std/src/lib.rs @@ -124,6 +124,51 @@ pub use crate::imports::{ExternalApi, ExternalQuerier, ExternalStorage}; #[cfg(not(target_arch = "wasm32"))] pub mod testing; -// Re-exports - +/// This attribute macro generates the boilerplate required to call into the +/// contract-specific logic from the entry-points to the Wasm module. +/// +/// It should be added to the contract's init, handle, migrate and query implementations +/// like this: +/// ``` +/// # use cosmwasm_std::{ +/// # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, +/// # Response, QueryResponse, +/// # }; +/// # +/// # type InstantiateMsg = (); +/// # type ExecuteMsg = (); +/// # type QueryMsg = (); +/// +/// #[entry_point] +/// pub fn instantiate( +/// deps: DepsMut, +/// env: Env, +/// info: MessageInfo, +/// msg: InstantiateMsg, +/// ) -> Result { +/// # Ok(Default::default()) +/// } +/// +/// #[entry_point] +/// pub fn execute( +/// deps: DepsMut, +/// env: Env, +/// info: MessageInfo, +/// msg: ExecuteMsg, +/// ) -> Result { +/// # Ok(Default::default()) +/// } +/// +/// #[entry_point] +/// pub fn query( +/// deps: Deps, +/// env: Env, +/// msg: QueryMsg, +/// ) -> Result { +/// # Ok(Default::default()) +/// } +/// ``` +/// +/// where `InstantiateMsg`, `ExecuteMsg`, and `QueryMsg` are contract defined +/// types that implement `DeserializeOwned + JsonSchema`. pub use cosmwasm_derive::entry_point;