Skip to content

Commit

Permalink
fix: signable msg encoding updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sherpalden committed Dec 10, 2024
1 parent db3f811 commit e90a4e1
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions contracts/cosmwasm-vm/cw-cluster-connection/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,7 @@ impl SignableMsg {

encoded_bytes.extend(self.conn_sn.to_string().as_bytes());

// Encode `data` as hex string without 0x prefix
let data_hex_string: String = self
.data
.iter()
.map(|byte| format!("{:02x}", byte))
.collect();
encoded_bytes.extend(data_hex_string.as_bytes());
encoded_bytes.extend(self.data.to_vec());

encoded_bytes.extend(self.dst_network.as_bytes());

Expand All @@ -82,8 +76,7 @@ pub fn test_signable_msg_utf8_bytes() {
dst_network: "archway".to_string(),
};

let expected_encoded_hex_str =
"3078322e69636f6e3132383638363536633663366661726368776179".to_string();
let expected_encoded_hex_str = "3078322e69636f6e31323868656c6c6f61726368776179".to_string();
let expected_encoded_bytes = hex::decode(expected_encoded_hex_str).unwrap();

assert_eq!(
Expand Down

0 comments on commit e90a4e1

Please sign in to comment.