osmosis-labs/osmosis-rust

Add test to ensure new fields added does not break existing serialization

iboss-ptk opened this issue · 0 comments

For example:

#[derive(
    Clone,
    PartialEq,
    Eq,
    ::prost::Message,
    serde::Serialize,
    serde::Deserialize,
    schemars::JsonSchema,
    CosmwasmExt,
)]
#[proto_message(type_url = "/osmosis.lockup.MsgBeginUnlockingResponse")]
pub struct MsgBeginUnlockingResponse {
    #[prost(bool, tag = "1")]
    pub success: bool,
++    #[prost(uint64, tag = "2")]
++    pub unlocking_lock_id: u64,
}

serialize with unlocking_lock_id: u64 then deserialize without it should not error and retain success: bool.