Struct DelayedPublicMutableValues
pub struct DelayedPublicMutableValues<T, let INITIAL_DELAY: u64> {
pub svc: ScheduledValueChange<T>,
pub sdc: ScheduledDelayChange<INITIAL_DELAY>,
}
Fields
svc: ScheduledValueChange<T>sdc: ScheduledDelayChange<INITIAL_DELAY>Implementations
impl<let INITIAL_DELAY: u64, T> DelayedPublicMutableValues<T, INITIAL_DELAY>
pub fn new(
svc: ScheduledValueChange<T>,
sdc: ScheduledDelayChange<INITIAL_DELAY>,
) -> Self
Trait implementations
impl<let INITIAL_DELAY: u64, T> Eq for DelayedPublicMutableValues<T, INITIAL_DELAY>
where
T: Eq
where
T: Eq
pub fn eq(_self: Self, _other: Self) -> bool
impl<let INITIAL_DELAY: u64, T> Hash for DelayedPublicMutableValues<T, INITIAL_DELAY>
where
T: Packable
where
T: Packable
pub fn hash(self) -> Field
impl<let INITIAL_DELAY: u64, T> Packable for DelayedPublicMutableValues<T, INITIAL_DELAY>
where
T: Packable
where
T: Packable
DelayedPublicMutableValues is just a wrapper around ScheduledValueChange and ScheduledDelayChange that then allows us to wrap both of these values in WithHash. WithHash allows for efficient read of values in private.
Note that the WithHash optimization does not work in public (due to there being no unconstrained). But we also want to be able to read the values efficiently in public and we want to be able to read each value separately. Reading the values separately is tricky because ScheduledValueChange and ScheduledDelayChange are packed together (sdc and svc.timestamp_of_change are stored in the same slot). For that reason we expose
unpack_value_changeandunpack_delay_changefunctions that can be used to extract the values from the packed representation. This is "hacky" but there is no way around it.