lib.rs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. mod contract_tests;
  2. mod error;
  3. mod execute;
  4. pub mod helpers;
  5. pub mod msg;
  6. mod query;
  7. pub mod state;
  8. pub use crate::error::ContractError;
  9. pub use crate::msg::{ExecuteMsg, InstantiateMsg, MintMsg, MinterResponse, QueryMsg};
  10. pub use crate::state::Cw721Contract;
  11. use cosmwasm_std::Empty;
  12. pub type Extension = Option<Empty>;
  13. #[cfg(not(feature = "library"))]
  14. pub mod entry {
  15. use super::*;
  16. use cosmwasm_std::entry_point;
  17. use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult};
  18. // This makes a conscious choice on the various generics used by the contract
  19. #[entry_point]
  20. pub fn instantiate(
  21. deps: DepsMut,
  22. env: Env,
  23. info: MessageInfo,
  24. msg: InstantiateMsg,
  25. ) -> StdResult<Response> {
  26. let tract = Cw721Contract::<Extension, Empty>::default();
  27. tract.instantiate(deps, env, info, msg)
  28. }
  29. #[entry_point]
  30. pub fn execute(
  31. deps: DepsMut,
  32. env: Env,
  33. info: MessageInfo,
  34. msg: ExecuteMsg<Extension>,
  35. ) -> Result<Response, ContractError> {
  36. let tract = Cw721Contract::<Extension, Empty>::default();
  37. tract.execute(deps, env, info, msg)
  38. }
  39. #[entry_point]
  40. pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult<Binary> {
  41. let tract = Cw721Contract::<Extension, Empty>::default();
  42. tract.query(deps, env, msg)
  43. }
  44. }