MCPcopy Create free account
hub / github.com/CashScript/cashscript / countOpcodes

Function countOpcodes

packages/utils/src/script.ts:119–124  ·  view source on GitHub ↗
(script: Script)

Source from the content-addressed store, hash-verified

117}
118
119export function countOpcodes(script: Script): number {
120 return script
121 .filter((opOrData) => typeof opOrData === 'number')
122 .filter((op) => (op as number) > Op.OP_16)
123 .length;
124}
125
126export function calculateBytesize(script: Script): number {
127 return scriptToBytecode(script).byteLength;

Callers 3

constructorMethod · 0.90
runFunction · 0.90
script.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected