-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Review fixes #458
chore: Review fixes #458
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#![allow(unused_imports)] | ||
#![allow(unused_imports, unused_variables)] | ||
use sylvia::ctx::{InstantiateCtx, ReplyCtx}; | ||
use sylvia::cw_std::{Binary, Response, StdResult}; | ||
use sylvia::cw_std::{Addr, Binary, Response, StdResult}; | ||
|
||
pub mod mismatched_params { | ||
use super::*; | ||
|
@@ -81,4 +81,48 @@ pub mod mismatched_param_arity { | |
} | ||
} | ||
|
||
pub mod redundant_params { | ||
use super::*; | ||
|
||
pub struct Contract {} | ||
|
||
#[sylvia::contract] | ||
#[sv::features(replies)] | ||
impl Contract { | ||
pub const fn new() -> Self { | ||
Self {} | ||
} | ||
|
||
#[sv::msg(instantiate)] | ||
fn instantiate(&self, _ctx: InstantiateCtx) -> StdResult<Response> { | ||
Ok(Response::new()) | ||
} | ||
|
||
#[sv::msg(reply, reply_on=success)] | ||
fn first_reply( | ||
&self, | ||
_ctx: ReplyCtx, | ||
#[sv::data(opt, raw)] _data: Option<Binary>, | ||
redundant_between1: u32, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add few more combinations:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Good points. Added test cases for the rest. |
||
redudnant_between2: String, | ||
#[sv::payload(raw)] param: String, | ||
redundant_after1: Binary, | ||
redundant_after2: Addr, | ||
) -> StdResult<Response> { | ||
Ok(Response::new()) | ||
} | ||
|
||
#[sv::msg(reply, reply_on=success)] | ||
fn second_reply( | ||
&self, | ||
_ctx: ReplyCtx, | ||
#[sv::data(opt, raw)] _data: Option<Binary>, | ||
#[sv::payload(raw)] param: String, | ||
redundant: Binary, | ||
) -> StdResult<Response> { | ||
Ok(Response::new()) | ||
} | ||
} | ||
} | ||
|
||
fn main() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NO
stands for number here? If so it's quite misleading in this contextThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ye, number of. It is a bit if you don't check the type. I will revert this change.