diff --git a/packages/std/src/results/submessages.rs b/packages/std/src/results/submessages.rs index 6fc49865b2..5b29bd1908 100644 --- a/packages/std/src/results/submessages.rs +++ b/packages/std/src/results/submessages.rs @@ -595,4 +595,29 @@ mod tests { } ); } + + #[test] + fn reply_serialization_cosmwasm_1() { + // json coming from wasmvm 1.5.0 + let json = r#"{"id":1234,"result":{"ok":{"events":[{"type":"message","attributes":[{"key":"signer","value":"caller-addr"}]}],"data":"Zm9vYmFy"}}}"#; + + let reply: Reply = from_json(json).unwrap(); + assert_eq!(reply.id, 1234); + assert_eq!(reply.payload, Binary::default()); + assert_eq!( + reply.result, + SubMsgResult::Ok(SubMsgResponse { + data: Some(Binary::from_base64("Zm9vYmFy").unwrap()), + events: vec![Event { + ty: "message".to_string(), + attributes: vec![Attribute { + key: "signer".to_string(), + value: "caller-addr".to_string() + }] + }], + msg_responses: vec![] + }) + ); + assert_eq!(reply.gas_used, 0); + } }