pub struct Transition {
pub transition_id: u16,
pub owned_inputs: Vec<StateRef>,
pub owned_outputs: Vec<StateAssignment>,
pub global_updates: Vec<GlobalState>,
pub metadata: Vec<Metadata>,
pub validation_script: Vec<u8>,
pub signatures: Vec<Vec<u8>>,
}Expand description
A contract transition
A transition consumes existing state, executes validation logic (bytecode), and produces new state. It is authorized by consuming a single-use seal.
Fields§
§transition_id: u16Unique transition ID (defined by the schema)
owned_inputs: Vec<StateRef>Owned state inputs being consumed
owned_outputs: Vec<StateAssignment>Owned state outputs being created
global_updates: Vec<GlobalState>Global state updates
metadata: Vec<Metadata>Transition metadata
validation_script: Vec<u8>Validation bytecode (e.g., AluVM)
signatures: Vec<Vec<u8>>Authorizing signatures
Implementations§
Source§impl Transition
impl Transition
Sourcepub fn new(
transition_id: u16,
owned_inputs: Vec<StateRef>,
owned_outputs: Vec<StateAssignment>,
global_updates: Vec<GlobalState>,
metadata: Vec<Metadata>,
validation_script: Vec<u8>,
signatures: Vec<Vec<u8>>,
) -> Self
pub fn new( transition_id: u16, owned_inputs: Vec<StateRef>, owned_outputs: Vec<StateAssignment>, global_updates: Vec<GlobalState>, metadata: Vec<Metadata>, validation_script: Vec<u8>, signatures: Vec<Vec<u8>>, ) -> Self
Create a new transition
Sourcepub fn consumed_seals(&self) -> Vec<SealRef>
pub fn consumed_seals(&self) -> Vec<SealRef>
Get all seals consumed by this transition (from owned inputs)
Sourcepub fn assigned_seals(&self) -> Vec<SealRef>
pub fn assigned_seals(&self) -> Vec<SealRef>
Get all seals that receive new state from this transition
Sourcepub fn is_genesis_like(&self) -> bool
pub fn is_genesis_like(&self) -> bool
Check if this transition has no inputs (genesis-like transition)
Sourcepub fn is_destructive(&self) -> bool
pub fn is_destructive(&self) -> bool
Check if this transition destroys all state (no outputs)
Sourcepub fn to_dag_node(&self) -> DAGNode
pub fn to_dag_node(&self) -> DAGNode
Convert to a DAG node for backwards compatibility
Trait Implementations§
Source§impl Clone for Transition
impl Clone for Transition
Source§fn clone(&self) -> Transition
fn clone(&self) -> Transition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Transition
impl Debug for Transition
Source§impl<'de> Deserialize<'de> for Transition
impl<'de> Deserialize<'de> for Transition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for Transition
impl PartialEq for Transition
Source§impl Serialize for Transition
impl Serialize for Transition
impl Eq for Transition
impl StructuralPartialEq for Transition
Auto Trait Implementations§
impl Freeze for Transition
impl RefUnwindSafe for Transition
impl Send for Transition
impl Sync for Transition
impl Unpin for Transition
impl UnsafeUnpin for Transition
impl UnwindSafe for Transition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more