Skip to content

Commit

Permalink
fix: patch valid source check
Browse files Browse the repository at this point in the history
  • Loading branch information
gcranju committed Jul 5, 2024
1 parent 98dd4b1 commit 0d2cf98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions contracts/cosmwasm-vm/cw-xcall/src/handle_call_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,12 @@ impl<'a> CwCallService<'a> {
if protocols.contains(source) {
return Ok(true);
}
let default_conn = self.get_default_connection(store, src_net)?;
Ok(source.clone() == default_conn)
if protocols.len() == 0 {
let default_conn = self.get_default_connection(store, src_net)?;
Ok(source.clone() == default_conn)
} else {
Ok(false)
}
}

pub fn handle_error(
Expand Down
2 changes: 1 addition & 1 deletion contracts/cosmwasm-vm/cw-xcall/src/types/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl CSMessageRequest {
}

pub fn as_bytes(&self) -> Vec<u8> {
rlp::encode(self.clone()).to_vec()
rlp::encode(self).to_vec()
}
}

Expand Down

0 comments on commit 0d2cf98

Please sign in to comment.