Skip to content

Commit

Permalink
impl DecodeWithMemTracking for VrfPreOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
serban300 committed Feb 18, 2025
1 parent aad2b6a commit dec7e0a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions substrate/primitives/core/src/bandersnatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,22 @@ pub mod vrf {
}
}

/// `VrfPreOutput` resolves to:
/// ```
/// pub struct Affine<P: SWCurveConfig> {
/// #[doc(hidden)]
/// pub x: P::BaseField,
/// #[doc(hidden)]
/// pub y: P::BaseField,
/// #[doc(hidden)]
/// pub infinity: bool,
/// }
/// ```
/// where each `P::BaseField` contains a `pub struct BigInt<const N: usize>(pub [u64; N]);`
/// Since all these structures are allocated on the stack, we can implement
/// `DecodeWithMemTracking` for `VrfPreOutput`.
impl DecodeWithMemTracking for VrfPreOutput {}

impl EncodeLike for VrfPreOutput {}

impl MaxEncodedLen for VrfPreOutput {
Expand Down

0 comments on commit dec7e0a

Please sign in to comment.