pub trait ScriptUnlocker {
    fn match_args(&self, args: &[u8]) -> bool;
    fn unlock(
        &self,
        tx: &TransactionView,
        script_group: &ScriptGroup,
        tx_dep_provider: &dyn TransactionDependencyProvider
    ) -> Result<TransactionView, UnlockError>; fn fill_placeholder_witness(
        &self,
        tx: &TransactionView,
        script_group: &ScriptGroup,
        tx_dep_provider: &dyn TransactionDependencyProvider
    ) -> Result<TransactionView, UnlockError>; fn is_unlocked(
        &self,
        _tx: &TransactionView,
        _script_group: &ScriptGroup,
        _tx_dep_provider: &dyn TransactionDependencyProvider
    ) -> Result<bool, UnlockError> { ... } fn clear_placeholder_witness(
        &self,
        tx: &TransactionView,
        _script_group: &ScriptGroup
    ) -> Result<TransactionView, UnlockError> { ... } }
Expand description

Script unlock logic:

  • Parse the script.args
  • Sign the transaction
  • Put extra unlock information into transaction (e.g. SMT proof in omni-lock case)

Required Methods§

Add signature or other information to witnesses, when the script is already unlocked should reset the witness instead.

Fill a placehodler witness before balance the transaction capacity

Provided Methods§

Check if the script group is already unlocked

Implementors§