(bytecode: Uint8Array)
| 51 | } |
| 52 | |
| 53 | export 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 | |
| 65 | export function asmToBytecode(asm: string): Uint8Array { |
| 66 | // Remove any duplicate whitespace |
no outgoing calls
no test coverage detected