Skip to content

Commit 2bb0a0d

Browse files
committed
impl DecodeWithMemTracking for VrfPreOutput
1 parent a41aed0 commit 2bb0a0d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

substrate/primitives/core/src/bandersnatch.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,22 @@ pub mod vrf {
227227
}
228228
}
229229

230+
/// `VrfPreOutput` resolves to:
231+
/// ```
232+
/// pub struct Affine<P: SWCurveConfig> {
233+
/// #[doc(hidden)]
234+
/// pub x: P::BaseField,
235+
/// #[doc(hidden)]
236+
/// pub y: P::BaseField,
237+
/// #[doc(hidden)]
238+
/// pub infinity: bool,
239+
/// }
240+
/// ```
241+
/// where each `P::BaseField` contains a `pub struct BigInt<const N: usize>(pub [u64; N]);`
242+
/// Since none of these structures is allocated on the heap, we don't need any special
243+
/// memory tracking logic. We can simply implement `DecodeWithMemTracking`.
244+
impl DecodeWithMemTracking for VrfPreOutput {}
245+
230246
impl EncodeLike for VrfPreOutput {}
231247

232248
impl MaxEncodedLen for VrfPreOutput {

0 commit comments

Comments
 (0)