pub struct IceProposal<'a> { /* private fields */ }Expand description
An ICE proposal — pre-simulation handle carrying the
underlying IceActionProposal plus the issued_at_ms
stamp pinned at construction.
Per the plan’s locked decision #4 a Self::simulate call
must precede commit. The type-state split enforces this at
compile time: IceProposal does not expose commit;
only a successful simulate() returns a
SimulatedIceProposal whose commit is callable. A
caller that wants to commit must thread the proposal through
simulate() first — the type system rejects the alternative.
Both IceProposal and SimulatedIceProposal are Send + Sync
(no Cell / RefCell interior mutability), so callers can
move them across tokio::spawn boundaries freely.
Implementations§
Source§impl<'a> IceProposal<'a>
impl<'a> IceProposal<'a>
Sourcepub fn action(&self) -> &IceActionProposal
pub fn action(&self) -> &IceActionProposal
Borrow the underlying IceActionProposal.
Sourcepub fn issued_at_ms(&self) -> u64
pub fn issued_at_ms(&self) -> u64
Milliseconds-since-UNIX_EPOCH stamp pinned at
construction. Operators participating in the multi-sig
flow read this from the SimulatedIceProposal (after
simulating); the value is identical because simulate()
preserves it.
Sourcepub async fn simulate(self) -> Result<SimulatedIceProposal<'a>, IceError>
pub async fn simulate(self) -> Result<SimulatedIceProposal<'a>, IceError>
Pre-execution preview. Runs the substrate’s pure
simulator against the runtime’s latest snapshot and
returns a SimulatedIceProposal holding the result.
The returned type is the only place
SimulatedIceProposal::commit can be called — the
type-state pattern enforces locked decision #4 at
compile time.