Skip to content

Commit

Permalink
chore: Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jawoznia committed Oct 14, 2024
1 parent 8da3c12 commit d43909d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sylvia-derive/src/contract/communication/reply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ impl<'a> ReplyData<'a> {
};

if self.payload.len() != new_handler.fields().len() - 1 {
emit_error!(current_method_name.span(), "Mismatched lenght of method parameters.";
emit_error!(current_method_name.span(), "Mismatched quantity of method parameters.";
note = self.handler_id.span() => format!("Both `{}` handlers should have the same number of parameters.", self.handler_id);
note = new_handler.function_name().span() => format!("Previous definition of {} handler.", self.handler_id)
);
Expand Down
6 changes: 4 additions & 2 deletions sylvia/tests/reply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ where
.with_label("noop")
.build()
.remote_instantiated(to_json_binary(&payload)?)?;
// Blocked by https://github.com/CosmWasm/cw-multi-test/pull/216.
// TODO: Blocked by https://github.com/CosmWasm/cw-multi-test/pull/216. Uncomment when new
// MultiTest version is released.
// Payload is not currently forwarded in the MultiTest.
// .remote_instantiated(payload)?;

Expand Down Expand Up @@ -215,7 +216,8 @@ where
&self,
ctx: ReplyCtx<Q>,
data: Option<Binary>,
// Blocked by https://github.com/CosmWasm/cw-multi-test/pull/216.
// TODO: Blocked by https://github.com/CosmWasm/cw-multi-test/pull/216. Uncomment when new
// MultiTest version is released.
// Payload is not currently forwarded in the MultiTest.
// _instantiate_payload: InstantiatePayload,
#[sv::payload] _payload: Binary,
Expand Down
6 changes: 3 additions & 3 deletions sylvia/tests/ui/method_signature/reply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub mod mismatched_params {
}

#[sv::msg(reply, handlers=[on_instantiated], reply_on=failure)]
fn first_reply(
fn second_reply(
&self,
_ctx: ReplyCtx,
_data: Option<Binary>,
Expand All @@ -40,7 +40,7 @@ pub mod mismatched_params {
}
}

pub mod mismatched_param_lenght {
pub mod mismatched_param_arity {
use super::*;

pub struct Contract {}
Expand All @@ -67,7 +67,7 @@ pub mod mismatched_param_lenght {
}

#[sv::msg(reply, handlers=[on_instantiated], reply_on=failure)]
fn first_reply(
fn second_reply(
&self,
_ctx: ReplyCtx,
_data: Option<Binary>,
Expand Down
2 changes: 1 addition & 1 deletion sylvia/tests/ui/method_signature/reply.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ error: Mismatched parameter in reply handlers.
26 | param: String,
| ^^^^^

error: Mismatched lenght of method parameters.
error: Mismatched quantity of method parameters.

= note: Both `on_instantiated` handlers should have the same number of parameters.
= note: Previous definition of on_instantiated handler.
Expand Down

0 comments on commit d43909d

Please sign in to comment.