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 <[email protected]>

* bump versions, fix linting

Signed-off-by: Dan Selman <[email protected]>

* ignore

Signed-off-by: Dan Selman <[email protected]>

* wip

Signed-off-by: Dan Selman <[email protected]>

* wip

Signed-off-by: Dan Selman <[email protected]>

* Update travis build scripts

Signed-off-by: Matt Roberts <[email protected]>

* Add webpack build
Signed-off-by: Matt Roberts <[email protected]>

* Update .travis.yml

Signed-off-by: Matt Roberts <[email protected]>

* replaced logger with debug

Signed-off-by: Dan Selman <[email protected]>

* removed wallet. Some codecov clean up

Signed-off-by: Dan Selman <[email protected]>

* WIP Remove all references to static system model.

Signed-off-by: Matt Roberts <[email protected]>

* fix changelog

Signed-off-by: Dan Selman <[email protected]>

* Fix xmlschemavisitor. Increase test coverage

Signed-off-by: Matt Roberts <[email protected]>

* Revert nyc output to text-summary

Signed-off-by: Matt Roberts <[email protected]>

* Add pkgbump. Fix webpack. Fix missing moment dependency

* Fix version number

* Add system model table (#5)

* WIP
Signed-off-by: Matt Roberts <[email protected]>

* Client app has to add system models
Signed-off-by: Matt Roberts <[email protected]>

* Add system model table

Signed-off-by: Matt Roberts <[email protected]>

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

Signed-off-by: Matt Roberts <[email protected]>

* Remove commented code in assetdeclaration

Signed-off-by: Matt Roberts <[email protected]>

* switch to yarn

Signed-off-by: Dan Selman <[email protected]>

* travis build

Signed-off-by: Dan Selman <[email protected]>

* remove system model gen

Signed-off-by: Dan Selman <[email protected]>

* first published version

Signed-off-by: Dan Selman <[email protected]>

* (doc) update description

Signed-off-by: Dan Selman <[email protected]>

* (chore) update docs

Signed-off-by: Dan Selman <[email protected]>

* (chore) cleaning

Signed-off-by: Dan Selman <[email protected]>

* (chore) publish latest version

Signed-off-by: Dan Selman <[email protected]>

* allow transactions to specify an identifying field #21

Signed-off-by: Dan Selman <[email protected]>

* bump version

Signed-off-by: Dan Selman <[email protected]>
  • 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.