Skip to content

Commit

Permalink
feat: add size function to tari script
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi committed Nov 16, 2021
1 parent a5defb7 commit 451dc49
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/script/tari_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ impl TariScript {
}
}

/// Returns the number of script op codes
pub fn size(&self) -> usize {
self.script.len()
}

fn should_execute(&self, opcode: &Opcode, state: &ExecutionState) -> Result<bool, ScriptError> {
use Opcode::*;
match opcode {
Expand Down

0 comments on commit 451dc49

Please sign in to comment.