osmosis-labs / osmosis-rust

Rust libraries for osmosis
Apache License 2.0
59 stars 52 forks source link

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

Closed iboss-ptk closed 1 year ago

iboss-ptk commented 1 year ago

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.