Skip to content

Generate Into<*Ref> for references to variants #2

@michaelsproul

Description

@michaelsproul
// FIXME(altair): generate these impls in superstruct
impl<'a, T: EthSpec> From<&'a BeaconStateBase<T>> for BeaconStateRef<'a, T> {
    fn from(inner: &BeaconStateBase<T>) -> Self {
        BeaconStateRef::Base(inner)
    }
}

impl<'a, T: EthSpec> From<&'a BeaconStateAltair<T>> for BeaconStateRef<'a, T> {
    fn from(inner: &BeaconStateAltair<T>) -> Self {
        BeaconStateRef::Altair(inner)
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions