From f82998df4f5709e976df80ac7aa73a3827405787 Mon Sep 17 00:00:00 2001 From: Jerome Simeon Date: Mon, 18 Mar 2019 22:42:15 -0400 Subject: [PATCH] (fix) Use relative path in engine file names Signed-off-by: Jerome Simeon --- package-lock.json | 27 ++++++++++------------ packages/ergo-cli/extracted/ergotopcore.js | 2 +- packages/ergo-engine/test/engine.js | 8 +++---- packages/ergo-engine/test/workload.json | 2 +- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index b3d3f3665..0d1477e55 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2460,24 +2460,16 @@ } }, "handlebars": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.0.tgz", - "integrity": "sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.1.tgz", + "integrity": "sha512-3Zhi6C0euYZL5sM0Zcy7lInLXKQ+YLcF/olbN010mzGQ4XVm50JeyBnMqofHh696GrciGruC7kCcApPDJvVgwA==", "requires": { - "async": "^2.5.0", + "neo-async": "^2.6.0", "optimist": "^0.6.1", "source-map": "^0.6.1", "uglify-js": "^3.1.4" }, "dependencies": { - "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", - "requires": { - "lodash": "^4.17.11" - } - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -4082,9 +4074,9 @@ "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==" }, "moment": { - "version": "2.22.2", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", - "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=" + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", + "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" }, "moment-mini": { "version": "2.22.1", @@ -4129,6 +4121,11 @@ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" }, + "neo-async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", + "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==" + }, "next-tick": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", diff --git a/packages/ergo-cli/extracted/ergotopcore.js b/packages/ergo-cli/extracted/ergotopcore.js index 234c53c9c..0ca18f4df 100644 --- a/packages/ergo-cli/extracted/ergotopcore.js +++ b/packages/ergo-cli/extracted/ergotopcore.js @@ -21830,7 +21830,7 @@ i=ev(c[1]);var B=si(function(a){return a},i);hc(hb,ap(afw,ap(mT,afv)));function D(d,c,b){var a=afx(c,fM(b));return{"out":a[1].toString(),"ctx":a[2]}}var -E={"initRCtxt":B,"version":mT.toString(),"buildate":"Mar 16, 2019","runLine":agp(D)};return ago(0).ergotop=E},afL=function(d,a){var +E={"initRCtxt":B,"version":mT.toString(),"buildate":"Mar 18, 2019","runLine":agp(D)};return ago(0).ergotop=E},afL=function(d,a){var b=d[3];if(a[1]===jP)return new oW(mS(b,a[2]).toString());function c(l){var diff --git a/packages/ergo-engine/test/engine.js b/packages/ergo-engine/test/engine.js index 8faa43e1c..a3e59f2b9 100644 --- a/packages/ergo-engine/test/engine.js +++ b/packages/ergo-engine/test/engine.js @@ -65,12 +65,12 @@ describe('Execute ES6', () => { for (let i = 0; i < ergo.length; i++) { const ergoFile = Path.resolve(__dirname, dir, ergo[i]); const ergoContent = Fs.readFileSync(ergoFile, 'utf8'); - templateLogic.addLogicFile(ergoContent,ergoFile); + templateLogic.addLogicFile(ergoContent, Path.join(dir, ergo[i])); } for (let i = 0; i < models.length; i++) { const ctoFile = Path.resolve(__dirname, dir, models[i]); const ctoContent = Fs.readFileSync(ctoFile, 'utf8'); - templateLogic.addModelFile(ctoContent,ctoFile); + templateLogic.addModelFile(ctoContent, Path.join(dir, models[i])); } templateLogic.setContractName(contractName); const contractJson = JSON.parse(Fs.readFileSync(Path.resolve(__dirname, dir, contract), 'utf8')); @@ -157,12 +157,12 @@ describe('Execute ES5', () => { for (let i = 0; i < ergo.length; i++) { const ergoFile = Path.resolve(__dirname, dir, ergo[i]); const ergoContent = Fs.readFileSync(ergoFile, 'utf8'); - templateLogic.addLogicFile(ergoContent,ergoFile); + templateLogic.addLogicFile(ergoContent, Path.join(dir, ergo[i])); } for (let i = 0; i < models.length; i++) { const ctoFile = Path.resolve(__dirname, dir, models[i]); const ctoContent = Fs.readFileSync(ctoFile, 'utf8'); - templateLogic.addModelFile(ctoContent,ctoFile); + templateLogic.addModelFile(ctoContent, Path.join(dir, models[i])); } const contractJson = JSON.parse(Fs.readFileSync(Path.resolve(__dirname, dir, contract), 'utf8')); if (state === null) { diff --git a/packages/ergo-engine/test/workload.json b/packages/ergo-engine/test/workload.json index bd30ec636..f2d64569a 100644 --- a/packages/ergo-engine/test/workload.json +++ b/packages/ergo-engine/test/workload.json @@ -118,7 +118,7 @@ "clauseName": "helloworld", "currentTime": "2019-01-01T16:34:00-05:00", "expected": { - "error": "Parse error (at file /Users/jeromesimeon/git/ergo/packages/ergo-engine/test/examples/bad-logic/logic.ergo line 17 col 20). \ncontract HelloWorld ovr TemplateModel {\n ^^^ " + "error": "Parse error (at file examples/bad-logic/logic.ergo line 17 col 20). \ncontract HelloWorld ovr TemplateModel {\n ^^^ " } } ] \ No newline at end of file