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

Function bytecodeToScript

packages/utils/src/script.ts:53–63  ·  view source on GitHub ↗
(bytecode: Uint8Array)

Source from the content-addressed store, hash-verified

51}
52
53export function bytecodeToScript(bytecode: Uint8Array): Script {
54 // Convert the bytecode to AuthenticationInstructions
55 const instructions = decodeAuthenticationInstructions(bytecode);
56
57 // Convert the AuthenticationInstructions to script elements
58 const script = instructions.map((instruction) => (
59 'data' in instruction ? instruction.data : instruction.opcode
60 ));
61
62 return script;
63}
64
65export function asmToBytecode(asm: string): Uint8Array {
66 // Remove any duplicate whitespace

Callers 4

Location.test.tsFile · 0.90
script.test.tsFile · 0.85
asmToScriptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected