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 11, 2024
1 parent 06c5a69 commit 2da70e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sylvia-derive/src/contract/communication/reply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ impl<'a> ReplyData<'a> {
} else if is_failure {
quote! { #sylvia ::cw_std::ReplyOn::Error }
} else {
// This should never happen
// This should never happen.
// We parse only the `Success`, `Failure` and `Always` values which are covered above.
// Handling the `Never` value wouldn't make sense as we would create a dead handler.
quote! { #sylvia ::cw_std::ReplyOn::Never }
}
}
Expand Down
5 changes: 5 additions & 0 deletions sylvia/tests/reply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,11 @@ mod tests {
let last_reply = contract.last_reply().unwrap();
assert_eq!(last_reply, FAILURE_REPLY_ID);

// Should send the cosmos message
contract.send_cosmos_messages().call(&owner).unwrap();
let last_reply = contract.last_reply().unwrap();
assert_eq!(last_reply, ALWAYS_REPLY_ID);

// Should return error if unknown reply ID received
let unknown_reply_id = 42u64;
let err = contract
Expand Down

0 comments on commit 2da70e6

Please sign in to comment.