scrypttest
Advanced tools
Comparing version 0.1.30 to 0.1.31
@@ -125,10 +125,11 @@ 'use strict'; | ||
// sourcePath -> opcodes | ||
function compile(sourcePath) { | ||
// debug: debug/production mode | ||
function compile(sourcePath, debug = true) { | ||
const [astFileName, asmFileName] = getCompiledFilePath(sourcePath); | ||
try { | ||
const cmd = `node "${path.join(__dirname, "../../scryptc/scrypt.js")}" compile "${sourcePath}" --asm --ast --debug`; | ||
const cmd = `node "${path.join(__dirname, '../../scryptc/scrypt.js')}" compile "${sourcePath}" --asm --ast ${debug ? '--debug' : ''}`; | ||
const output = childProcess.execSync(cmd, { cwd: path.dirname(sourcePath) }).toString(); | ||
if (!output.includes('Error')) { | ||
const asmObj = JSON.parse(fs.readFileSync(asmFileName, 'utf8')); | ||
const opcodes = asmObj.output.map(e => e.opcode); | ||
const asmStr = fs.readFileSync(asmFileName, 'utf8'); | ||
const opcodes = debug ? JSON.parse(asmStr).output.map(e => e.opcode) : asmStr.split(' '); | ||
const ast = JSON.parse(fs.readFileSync(astFileName, 'utf8'))[sourcePath]; | ||
@@ -135,0 +136,0 @@ // only for the last main contract |
{ | ||
"name": "scrypttest", | ||
"version": "0.1.30", | ||
"version": "0.1.31", | ||
"description": "testing library for sCrypt projects", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23211
480