From 5bde982cadcc35c304425d71f747434c3a63c0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Wo=C5=BAniak?= Date: Mon, 29 Jul 2024 11:19:01 +0200 Subject: [PATCH] test: Error if `entry_points` macro received no concrete types --- sylvia/tests/ui/macros/entry_points.rs | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sylvia/tests/ui/macros/entry_points.rs diff --git a/sylvia/tests/ui/macros/entry_points.rs b/sylvia/tests/ui/macros/entry_points.rs new file mode 100644 index 00000000..a131966c --- /dev/null +++ b/sylvia/tests/ui/macros/entry_points.rs @@ -0,0 +1,29 @@ +use sylvia::cw_std::{Response, StdResult}; +use sylvia::types::{CustomMsg, CustomQuery, InstantiateCtx}; +use sylvia::{contract, entry_points}; + +pub struct Contract { + _phantom: std::marker::PhantomData<(E, Q)>, +} + +#[entry_points] +#[contract] +#[sv::custom(msg = E, query = Q)] +impl Contract +where + E: CustomMsg + 'static, + Q: CustomQuery + 'static, +{ + pub fn new() -> Self { + Self { + _phantom: std::marker::PhantomData, + } + } + + #[sv::msg(instantiate)] + fn instantiate(&self, _ctx: InstantiateCtx) -> StdResult> { + Ok(Response::new()) + } +} + +fn main() {}