Skip to content

Commit

Permalink
test: Error if entry_points macro received no concrete types
Browse files Browse the repository at this point in the history
  • Loading branch information
jawoznia committed Jul 31, 2024
1 parent d4c94ca commit 5bde982
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions sylvia/tests/ui/macros/entry_points.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use sylvia::cw_std::{Response, StdResult};
use sylvia::types::{CustomMsg, CustomQuery, InstantiateCtx};
use sylvia::{contract, entry_points};

pub struct Contract<E, Q> {
_phantom: std::marker::PhantomData<(E, Q)>,
}

#[entry_points]
#[contract]
#[sv::custom(msg = E, query = Q)]
impl<E, Q> Contract<E, Q>
where
E: CustomMsg + 'static,
Q: CustomQuery + 'static,
{
pub fn new() -> Self {
Self {
_phantom: std::marker::PhantomData,
}
}

#[sv::msg(instantiate)]
fn instantiate(&self, _ctx: InstantiateCtx<Q>) -> StdResult<Response<E>> {
Ok(Response::new())
}
}

fn main() {}

0 comments on commit 5bde982

Please sign in to comment.