Skip to content

Commit

Permalink
chore(cicero) Switch to latest Ergo 0.21.3 and Markdown Transform 0.12.4
Browse files Browse the repository at this point in the history
Signed-off-by: Jerome Simeon <[email protected]>
  • Loading branch information
jeromesimeon committed Aug 11, 2020
1 parent 54e0b5d commit 2f6c2dc
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 66 deletions.
84 changes: 42 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions packages/cicero-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@
},
"dependencies": {
"@accordproject/concerto-core": "0.82.8",
"@accordproject/ergo-compiler": "0.21.2",
"@accordproject/ergo-engine": "0.21.2",
"@accordproject/markdown-common": "^0.12.3",
"@accordproject/markdown-cicero": "^0.12.3",
"@accordproject/markdown-html": "^0.12.3",
"@accordproject/markdown-slate": "^0.12.3",
"@accordproject/markdown-template": "^0.12.3",
"@accordproject/ergo-compiler": "0.21.3",
"@accordproject/ergo-engine": "0.21.3",
"@accordproject/markdown-common": "^0.12.4",
"@accordproject/markdown-cicero": "^0.12.4",
"@accordproject/markdown-html": "^0.12.4",
"@accordproject/markdown-slate": "^0.12.4",
"@accordproject/markdown-template": "^0.12.4",
"axios": "0.19.0",
"debug": "4.1.0",
"ietf-language-tag-regex": "0.0.5",
Expand Down
11 changes: 1 addition & 10 deletions packages/cicero-core/src/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const ParserManager = require('@accordproject/markdown-template').ParserManager;
const crypto = require('crypto');
const stringify = require('json-stable-stringify');
const LogicManager = require('@accordproject/ergo-compiler').LogicManager;
const Script = require('@accordproject/ergo-compiler/lib/script');
const TemplateLoader = require('./templateloader');
const TemplateSaver = require('./templatesaver');

Expand Down Expand Up @@ -63,15 +62,7 @@ class Template {
if (this.getMetadata().getRuntime() === 'ergo') {
this.getLogicManager().compileLogicSync(true);
} else {
// XXX This should be moved to the logic manager -JS
const scriptManager = this.getLogicManager().getScriptManager();
const mainScript = scriptManager.getCombinedScripts();
if (mainScript) {
const script = new Script(this.getModelManager(), 'main.js', '.js', mainScript, null);
const contractName = script.getContractName();
if (contractName) { this.getLogicManager().setContractName(contractName); }
scriptManager.compiledScript = script;
}
this.getLogicManager().registerCompiledLogicSync();
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/cicero-core/test/clause.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ describe('Clause', () => {
try {
await Template.fromDirectory('./test/data/bad-binding', options);
} catch (err) {
err.message.should.equal('Unknown property articipant');
err.message.should.equal('Unknown property: articipant File text/grammar.tem.md line -1 column -1');
}
});

it('should fail to create a clause for a template with a wrongly typed boolean binding', async function() {
try {
await Template.fromDirectory('./test/data/bad-boolean-binding', options);
} catch (err) {
err.message.should.equal('An if block can only be used with a boolean property. Property participant has type Participant File text/grammar.tem.md line 1 column 7');
err.message.should.equal('Conditional template not on a boolean property: participant File text/grammar.tem.md line -1 column -1');
}
});

Expand Down Expand Up @@ -381,7 +381,7 @@ Expected: 'I'm active' or 'I'm inactive'`);
try {
await Template.fromDirectory('./test/data/block-ifelse-error', options);
} catch (err) {
err.message.should.eql('An if block can only be used with a boolean property. Property isActive has type Double File text/grammar.tem.md line 1 column 7');
err.message.should.eql('Conditional template not on a boolean property: isActive File text/grammar.tem.md line -1 column -1');
}
});

Expand Down
4 changes: 2 additions & 2 deletions packages/cicero-core/test/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,11 @@ In case of delayed delivery except for Force Majeure cases, the Seller shall pay
});

it('should throw an error for property that is not declared', () => {
return Template.fromDirectory('./test/data/bad-property', options).should.be.rejectedWith('Unknown property currency');
return Template.fromDirectory('./test/data/bad-property', options).should.be.rejectedWith('Unknown property: currency');
});

it('should throw an error for clause property that is not declared', () => {
return Template.fromDirectory('./test/data/bad-copyright-license', options).should.be.rejectedWith('Unknown property badPaymentClause');
return Template.fromDirectory('./test/data/bad-copyright-license', options).should.be.rejectedWith('Unknown property: badPaymentClause');
});

it('should create an archive for a template with two Ergo modules', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cicero-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
"dependencies": {
"@accordproject/cicero-core": "0.21.2",
"@accordproject/ergo-engine": "0.21.2",
"@accordproject/ergo-engine": "0.21.3",
"moment-mini": "2.22.1"
},
"license-check-config": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cicero-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"dependencies": {
"@accordproject/cicero-core": "0.21.2",
"@accordproject/cicero-engine": "0.21.2",
"@accordproject/ergo-test": "0.21.2",
"@accordproject/ergo-test": "0.21.3",
"chai": "4.2.0",
"chai-things": "0.2.0",
"cucumber": "5.1.0"
Expand Down

0 comments on commit 2f6c2dc

Please sign in to comment.