pub struct SidecarReceipt { /* private fields */ }Expand description
Immutable signed receipt. A zero policy commitment represents no supplied policy reference; authority decides whether that is permissible.
Implementations§
Source§impl SidecarReceipt
impl SidecarReceipt
pub fn sign( sidecar: &[u8; 768], payload: &[u8], payload_byte_budget: usize, policy_commitment: [u8; 32], chain_id: [u8; 32], sequence: u64, previous: Option<[u8; 32]>, signing_key: &SigningKey, ) -> Result<Self, SidecarReceiptError>
pub const fn signer(&self) -> &[u8; 32]
pub const fn sidecar_digest(&self) -> &[u8; 32]
pub const fn payload_digest(&self) -> &[u8; 32]
pub const fn policy_commitment(&self) -> &[u8; 32]
pub const fn chain_id(&self) -> &[u8; 32]
pub const fn previous(&self) -> &[u8; 32]
pub const fn sequence(&self) -> u64
Sourcepub fn verify_signature(
&self,
sidecar: &[u8; 768],
payload: &[u8],
payload_byte_budget: usize,
) -> Result<(), SidecarReceiptError>
pub fn verify_signature( &self, sidecar: &[u8; 768], payload: &[u8], payload_byte_budget: usize, ) -> Result<(), SidecarReceiptError>
Checks bytes and signature only. It grants no policy authority.
Sourcepub fn checkpoint(&self) -> [u8; 32]
pub fn checkpoint(&self) -> [u8; 32]
Hash of this complete signed receipt for the next chain position. This does not prove that earlier receipts are available or were authorized.
pub fn encode(&self, out: &mut [u8]) -> Result<usize, SidecarReceiptError>
Sourcepub fn decode(input: &[u8]) -> Result<Self, SidecarReceiptError>
pub fn decode(input: &[u8]) -> Result<Self, SidecarReceiptError>
Structural decoding only; callers must verify bytes and authority.
Trait Implementations§
Source§impl Clone for SidecarReceipt
impl Clone for SidecarReceipt
impl Copy for SidecarReceipt
Source§impl Debug for SidecarReceipt
impl Debug for SidecarReceipt
impl Eq for SidecarReceipt
Source§impl PartialEq for SidecarReceipt
impl PartialEq for SidecarReceipt
impl StructuralPartialEq for SidecarReceipt
Auto Trait Implementations§
impl Freeze for SidecarReceipt
impl RefUnwindSafe for SidecarReceipt
impl Send for SidecarReceipt
impl Sync for SidecarReceipt
impl Unpin for SidecarReceipt
impl UnsafeUnpin for SidecarReceipt
impl UnwindSafe for SidecarReceipt
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more