Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Oct 29, 2024
1 parent cade851 commit e484332
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions crates/e2e-move-tests/src/tests/cosmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,10 @@ fn test_cosmos_move_execute() {

let arg1_hex = hex::encode(arg1.clone());
let arg2_hex = hex::encode(arg2.clone());
let module_addr_hex = module_address.to_hex_literal();
let sender_cosmos_addr =
bech32::encode::<Bech32>(Hrp::parse_unchecked("init"), &sender.into_bytes()).unwrap();
let expected_data = format!("{{\"@type\":\"/initia.move.v1.MsgExecute\",\"args\":[\"{arg1_hex}\",\"{arg2_hex}\"],\"function_name\":\"{function_name}\",\"module_address\":\"{module_address}\",\"module_name\":\"{module_name}\",\"sender\":\"{sender_cosmos_addr}\",\"type_args\":[\"{type_arg1}\",\"{type_arg2}\"]}}");
let expected_data = format!("{{\"@type\":\"/initia.move.v1.MsgExecute\",\"args\":[\"{arg1_hex}\",\"{arg2_hex}\"],\"function_name\":\"{function_name}\",\"module_address\":\"{module_addr_hex}\",\"module_name\":\"{module_name}\",\"sender\":\"{sender_cosmos_addr}\",\"type_args\":[\"{type_arg1}\",\"{type_arg2}\"]}}");

let test_move_execute = (
sender,
Expand Down Expand Up @@ -487,7 +488,8 @@ fn test_cosmos_move_execute_with_json() {

let sender_cosmos_addr =
bech32::encode::<Bech32>(Hrp::parse_unchecked("init"), &sender.into_bytes()).unwrap();
let expected_data = format!("{{\"@type\":\"/initia.move.v1.MsgExecuteJSON\",\"args\":[\"\\\"hello\\\"\",\"\\\"world\\\"\"],\"function_name\":\"{function_name}\",\"module_address\":\"{module_address}\",\"module_name\":\"{module_name}\",\"sender\":\"{sender_cosmos_addr}\",\"type_args\":[\"{type_arg1}\",\"{type_arg2}\"]}}");
let module_addr_hex = module_address.to_hex_literal();
let expected_data = format!("{{\"@type\":\"/initia.move.v1.MsgExecuteJSON\",\"args\":[\"\\\"hello\\\"\",\"\\\"world\\\"\"],\"function_name\":\"{function_name}\",\"module_address\":\"{module_addr_hex}\",\"module_name\":\"{module_name}\",\"sender\":\"{sender_cosmos_addr}\",\"type_args\":[\"{type_arg1}\",\"{type_arg2}\"]}}");

let test_move_execute = (
sender,
Expand Down
2 changes: 1 addition & 1 deletion crates/types/src/cosmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub struct CosmosMessage {
impl Debug for CosmosMessage {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("CosmosMessage")
.field("sender", &self.sender.to_canonical_string())
.field("sender", &self.sender.to_standard_string())
.field(
"data",
&str::from_utf8(&self.data).unwrap_or("<invalid UTF-8>"),
Expand Down

0 comments on commit e484332

Please sign in to comment.