sdk/rust: Remove `expiration_time` from `GuardianSetInfo`

This field doesn't actually appear in `GuardianSetUpgrade` governance
messages and was already being skipped by serde so just remove it
completely.  Contracts that need to keep track of this information can
encapsulate the `GuardianSetInfo` inside another struct that has an
`expiration_time` field.
This commit is contained in:
Chirantan Ekbote 2022-12-27 16:20:13 +09:00 committed by Chirantan Ekbote
parent 3a1dd9eccd
commit e05176c9be
3 changed files with 0 additions and 7 deletions

View File

@ -541,7 +541,6 @@ mod test {
0xeb, 0x15, 0xe8, 0x0c, 0x9a, 0x99, 0xc8, 0x34, 0x8d, 0xeb, 0x15, 0xe8, 0x0c, 0x9a, 0x99, 0xc8, 0x34, 0x8d,
]), ]),
], ],
expiration_time: 0,
}, },
}, },
}, },

View File

@ -65,10 +65,6 @@ pub struct Amount(pub [u8; 32]);
pub struct GuardianSetInfo { pub struct GuardianSetInfo {
/// The set of guardians public keys, in Ethereum's compressed format. /// The set of guardians public keys, in Ethereum's compressed format.
pub addresses: Vec<GuardianAddress>, pub addresses: Vec<GuardianAddress>,
/// How long after a GuardianSet change before this set is expired.
#[serde(skip)]
pub expiration_time: u64,
} }
impl GuardianSetInfo { impl GuardianSetInfo {
@ -112,7 +108,6 @@ mod test {
for (count, quorum) in tests { for (count, quorum) in tests {
let gs = GuardianSetInfo { let gs = GuardianSetInfo {
addresses: vec![Default::default(); count], addresses: vec![Default::default(); count],
expiration_time: 0,
}; };
assert_eq!(quorum, gs.quorum()); assert_eq!(quorum, gs.quorum());

View File

@ -308,7 +308,6 @@ mod tests {
struct GuardianSetInfo<'a> { struct GuardianSetInfo<'a> {
#[serde(borrow)] #[serde(borrow)]
addresses: Cow<'a, [GuardianAddress<'a>]>, addresses: Cow<'a, [GuardianAddress<'a>]>,
expiration_time: u64,
} }
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]