Skip to main content

tempo_primitives/reth_compat/transaction/
tt_authorization.rs

1use crate::transaction::tt_authorization::TempoSignedAuthorization;
2
3impl reth_codecs::Compact for TempoSignedAuthorization {
4    fn to_compact<B>(&self, buf: &mut B) -> usize
5    where
6        B: alloy_rlp::BufMut + AsMut<[u8]>,
7    {
8        use alloy_rlp::Encodable;
9        let start_len = buf.remaining_mut();
10        self.encode(buf);
11        start_len - buf.remaining_mut()
12    }
13
14    fn from_compact(buf: &[u8], len: usize) -> (Self, &[u8]) {
15        use alloy_rlp::Decodable;
16        let mut buf_slice = &buf[..len];
17        let auth = Self::decode(&mut buf_slice).expect("valid RLP encoding");
18        (auth, &buf[len..])
19    }
20}