Skip to main content

macroonz_compiler/support/
encode.rs

1//! Canonical support-declaration refusal encoding.
2use super::DeclarationError;
3impl DeclarationError {
4    /// Returns canonical bytes.
5    #[must_use]
6    pub fn canonical_bytes(self) -> Vec<u8> {
7        let mut bytes = Vec::new();
8        self.encode_into(&mut bytes);
9        bytes
10    }
11    /// Appends canonical bytes.
12    pub fn encode_into(self, into: &mut Vec<u8>) {
13        into.push(self.slot());
14    }
15}