From ba48d783ec759c2b067ba09db693f384bbf7ab17 Mon Sep 17 00:00:00 2001 From: qwerty0789 Date: Wed, 6 Sep 2023 02:21:26 +0545 Subject: [PATCH] fix: address validation for CallServiceMessageRequest decode added --- contracts/cosmwasm-vm/cw-xcall/src/handle_call_message.rs | 2 +- contracts/cosmwasm-vm/cw-xcall/src/send_call_message.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/cosmwasm-vm/cw-xcall/src/handle_call_message.rs b/contracts/cosmwasm-vm/cw-xcall/src/handle_call_message.rs index f286ce552..2f7323659 100644 --- a/contracts/cosmwasm-vm/cw-xcall/src/handle_call_message.rs +++ b/contracts/cosmwasm-vm/cw-xcall/src/handle_call_message.rs @@ -43,7 +43,7 @@ impl<'a> CwCallService<'a> { return Err(ContractError::ProtocolsMismatch); } - let to = request.to(); + let to = deps.api.addr_validate(request.to().as_str())?; if request.protocols().len() > 1 { let key = keccak256(data).to_vec(); diff --git a/contracts/cosmwasm-vm/cw-xcall/src/send_call_message.rs b/contracts/cosmwasm-vm/cw-xcall/src/send_call_message.rs index 98a567d30..8f2a56c85 100644 --- a/contracts/cosmwasm-vm/cw-xcall/src/send_call_message.rs +++ b/contracts/cosmwasm-vm/cw-xcall/src/send_call_message.rs @@ -55,7 +55,7 @@ impl<'a> CwCallService<'a> { let call_request = CallServiceMessageRequest::new( from, - to.account(), + deps.api.addr_validate(to.account().as_str())?, sequence_no, need_response, data.to_vec(),