Skip to content

Commit

Permalink
Fix for #21 - allow transactions to have an identifying field (#22)
Browse files Browse the repository at this point in the history
* refactor modelmanager to standadlone module

Signed-off-by: Dan Selman <danscode@selman.org>

* bump versions, fix linting

Signed-off-by: Dan Selman <danscode@selman.org>

* ignore

Signed-off-by: Dan Selman <danscode@selman.org>

* wip

Signed-off-by: Dan Selman <danscode@selman.org>

* wip

Signed-off-by: Dan Selman <danscode@selman.org>

* Update travis build scripts

Signed-off-by: Matt Roberts <code@rbrts.uk>

* Add webpack build
Signed-off-by: Matt Roberts <code@rbrts.uk>

* Update .travis.yml

Signed-off-by: Matt Roberts <code@rbrts.uk>

* replaced logger with debug

Signed-off-by: Dan Selman <danscode@selman.org>

* removed wallet. Some codecov clean up

Signed-off-by: Dan Selman <danscode@selman.org>

* WIP Remove all references to static system model.

Signed-off-by: Matt Roberts <code@rbrts.uk>

* fix changelog

Signed-off-by: Dan Selman <danscode@selman.org>

* Fix xmlschemavisitor. Increase test coverage

Signed-off-by: Matt Roberts <code@rbrts.uk>

* Revert nyc output to text-summary

Signed-off-by: Matt Roberts <code@rbrts.uk>

* Add pkgbump. Fix webpack. Fix missing moment dependency

* Fix version number

* Add system model table (#5)

* WIP
Signed-off-by: Matt Roberts <code@rbrts.uk>

* Client app has to add system models
Signed-off-by: Matt Roberts <code@rbrts.uk>

* Add system model table

Signed-off-by: Matt Roberts <code@rbrts.uk>

* Move composer models from lib to test. Add test for custom system model

Signed-off-by: Matt Roberts <code@rbrts.uk>

* Remove commented code in assetdeclaration

Signed-off-by: Matt Roberts <code@rbrts.uk>

* switch to yarn

Signed-off-by: Dan Selman <danscode@selman.org>

* travis build

Signed-off-by: Dan Selman <danscode@selman.org>

* remove system model gen

Signed-off-by: Dan Selman <danscode@selman.org>

* first published version

Signed-off-by: Dan Selman <danscode@selman.org>

* (doc) update description

Signed-off-by: Dan Selman <danscode@selman.org>

* (chore) update docs

Signed-off-by: Dan Selman <danscode@selman.org>

* (chore) cleaning

Signed-off-by: Dan Selman <danscode@selman.org>

* (chore) publish latest version

Signed-off-by: Dan Selman <danscode@selman.org>

* allow transactions to specify an identifying field #21

Signed-off-by: Dan Selman <danscode@selman.org>

* bump version

Signed-off-by: Dan Selman <danscode@selman.org>
  • Loading branch information
dselman authored Oct 29, 2018
1 parent 359d133 commit fbfa47c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 23 deletions.
4 changes: 0 additions & 4 deletions lib/introspect/transactiondeclaration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
16 changes: 0 additions & 16 deletions test/introspect/transactiondeclaration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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./);
});
});
});

0 comments on commit fbfa47c

Please sign in to comment.