public static void Encode(Span <byte> span, BeaconBlock container) { if (span.Length != Ssz.BeaconBlockLength(container)) { ThrowTargetLength <BeaconBlock>(span.Length, Ssz.BeaconBlockLength(container)); } int offset = 0; Encode(span, container, ref offset); }
public static void Encode(Span <byte> span, BeaconBlock container) { if (span.Length != Ssz.BeaconBlockLength(container)) { ThrowTargetLength <BeaconBlock>(span.Length, Ssz.BeaconBlockLength(container)); } int offset = 0; Encode(span, container.Slot, ref offset); Encode(span, container.ParentRoot, ref offset); Encode(span, container.StateRoot, ref offset); Encode(span, Ssz.BeaconBlockDynamicOffset, ref offset); Encode(span, container.Signature, ref offset); Encode(span.Slice(offset), container.Body); }
public static int SignedBeaconBlockLength(SignedBeaconBlock container) { return(SignedBeaconBlockDynamicOffset + Ssz.BeaconBlockLength(container.Message)); }