Verify that the declared state equals the fold of the change log.
(&self)
| 130 | |
| 131 | /// Verify that the declared state equals the fold of the change log. |
| 132 | pub fn verify(&self) -> Result<(), ManifestError> { |
| 133 | let computed = Self::fold(&self.changes); |
| 134 | if computed != self.state { |
| 135 | return Err(ManifestError::StateMismatch { |
| 136 | name: self.name.clone(), |
| 137 | declared: self.state.to_base32(), |
| 138 | computed: computed.to_base32(), |
| 139 | }); |
| 140 | } |
| 141 | Ok(()) |
| 142 | } |
| 143 | |
| 144 | /// Serialize to the text wire format. |
| 145 | pub fn to_text(&self) -> String { |