From fbfa47c7b0fcee03bb46b083486d49df096fc3bd Mon Sep 17 00:00:00 2001 From: Dan Selman Date: Mon, 29 Oct 2018 08:48:30 +0000 Subject: [PATCH] Fix for #21 - allow transactions to have an identifying field (#22) * refactor modelmanager to standadlone module Signed-off-by: Dan Selman * bump versions, fix linting Signed-off-by: Dan Selman * ignore Signed-off-by: Dan Selman * wip Signed-off-by: Dan Selman * wip Signed-off-by: Dan Selman * Update travis build scripts Signed-off-by: Matt Roberts * Add webpack build Signed-off-by: Matt Roberts * Update .travis.yml Signed-off-by: Matt Roberts * replaced logger with debug Signed-off-by: Dan Selman * removed wallet. Some codecov clean up Signed-off-by: Dan Selman * WIP Remove all references to static system model. Signed-off-by: Matt Roberts * fix changelog Signed-off-by: Dan Selman * Fix xmlschemavisitor. Increase test coverage Signed-off-by: Matt Roberts * Revert nyc output to text-summary Signed-off-by: Matt Roberts * Add pkgbump. Fix webpack. Fix missing moment dependency * Fix version number * Add system model table (#5) * WIP Signed-off-by: Matt Roberts * Client app has to add system models Signed-off-by: Matt Roberts * Add system model table Signed-off-by: Matt Roberts * Move composer models from lib to test. Add test for custom system model Signed-off-by: Matt Roberts * Remove commented code in assetdeclaration Signed-off-by: Matt Roberts * switch to yarn Signed-off-by: Dan Selman * travis build Signed-off-by: Dan Selman * remove system model gen Signed-off-by: Dan Selman * first published version Signed-off-by: Dan Selman * (doc) update description Signed-off-by: Dan Selman * (chore) update docs Signed-off-by: Dan Selman * (chore) cleaning Signed-off-by: Dan Selman * (chore) publish latest version Signed-off-by: Dan Selman * allow transactions to specify an identifying field #21 Signed-off-by: Dan Selman * bump version Signed-off-by: Dan Selman --- lib/introspect/transactiondeclaration.js | 4 ---- package-lock.json | 2 +- package.json | 4 ++-- test/introspect/transactiondeclaration.js | 16 ---------------- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/lib/introspect/transactiondeclaration.js b/lib/introspect/transactiondeclaration.js index 9e117a81da..08aeb10ae0 100644 --- a/lib/introspect/transactiondeclaration.js +++ b/lib/introspect/transactiondeclaration.js @@ -67,10 +67,6 @@ class TransactionDeclaration extends ClassDeclaration { systemTypeDeclared = hasSystemType; } - if (!this.isSystemType() && this.idField && systemTypeDeclared) { - throw new IllegalModelException('Transaction should not specify an identifying field.', this.modelFile, this.ast.location); - } - // perform general validation after specific validation. super.validate(); } diff --git a/package-lock.json b/package-lock.json index a933fadb1b..f0fbd65f9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "composer-concerto", - "version": "0.31.2", + "version": "0.31.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5b1d6bdc81..7ab6947d4e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "composer-concerto", - "version": "0.31.2", - "description": "Hyperledger Composer Concerto", + "version": "0.40.0", + "description": "Concerto", "engines": { "node": ">=8", "npm": ">=5" diff --git a/test/introspect/transactiondeclaration.js b/test/introspect/transactiondeclaration.js index 4d2edb3347..7dc1800eac 100644 --- a/test/introspect/transactiondeclaration.js +++ b/test/introspect/transactiondeclaration.js @@ -59,21 +59,5 @@ describe('TransactionDeclaration', () => { td.validate(); }); - - it('should cover the other error paths', () => { - const model = ` - namespace org.acme - transaction T identified by id{ - o String id - } - `; - - const modelFile = new ModelFile(modelManager, model); - let td = modelFile.getTransactionDeclaration('T'); - - (() => { - td.validate(); - }).should.throw(/Transaction should not specify an identifying field./); - }); }); });