Skip to content

Commit

Permalink
Update Node chaincode for v2.5.5 release
Browse files Browse the repository at this point in the history
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
  • Loading branch information
bestbeforetoday committed May 31, 2024
1 parent 3c63eac commit fd7839f
Show file tree
Hide file tree
Showing 34 changed files with 15,987 additions and 10,730 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
root = true

[*]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
max_line_length = 120
indent_style = space
indent_size = 4

[*.{yaml,yml}]
indent_size = 2

[*.html]
indent_size = 2

[*.md]
indent_size = 2
4,110 changes: 4,110 additions & 0 deletions asset-transfer-basic/chaincode-javascript/npm-shrinkwrap.json

Large diffs are not rendered by default.

23 changes: 11 additions & 12 deletions asset-transfer-basic/chaincode-javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"description": "Asset-Transfer-Basic contract implemented in JavaScript",
"main": "index.js",
"engines": {
"node": ">=12",
"npm": ">=5"
"node": ">=18"
},
"scripts": {
"lint": "eslint *.js */**.js",
Expand All @@ -17,18 +16,18 @@
"author": "Hyperledger",
"license": "Apache-2.0",
"dependencies": {
"fabric-contract-api": "^2.0.0",
"fabric-shim": "^2.0.0",
"json-stringify-deterministic": "^1.0.1",
"sort-keys-recursive": "^2.1.2"
"fabric-contract-api": "~2.5.5",
"fabric-shim": "~2.5.5",
"json-stringify-deterministic": "^1.0.0",
"sort-keys-recursive": "^2.1.0"
},
"devDependencies": {
"chai": "^4.1.2",
"eslint": "^4.19.1",
"mocha": "^8.0.1",
"nyc": "^14.1.1",
"sinon": "^6.0.0",
"sinon-chai": "^3.2.0"
"chai": "^4.4.1",
"eslint": "^8.57.0",
"mocha": "^10.4.0",
"nyc": "^15.1.0",
"sinon": "^18.0.0",
"sinon-chai": "^3.7.0"
},
"nyc": {
"exclude": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ describe('Asset Transfer Basic Tests', () => {
expect(ret.length).to.equal(4);

let expected = [
{Record: {ID: 'asset1', Color: 'blue', Size: 5, Owner: 'Robert', AppraisedValue: 100}},
{Record: {ID: 'asset2', Color: 'orange', Size: 10, Owner: 'Paul', AppraisedValue: 200}},
{Record: {ID: 'asset3', Color: 'red', Size: 15, Owner: 'Troy', AppraisedValue: 300}},
{Record: {ID: 'asset4', Color: 'pink', Size: 20, Owner: 'Van', AppraisedValue: 400}}
{ID: 'asset1', Color: 'blue', Size: 5, Owner: 'Robert', AppraisedValue: 100},
{ID: 'asset2', Color: 'orange', Size: 10, Owner: 'Paul', AppraisedValue: 200},
{ID: 'asset3', Color: 'red', Size: 15, Owner: 'Troy', AppraisedValue: 300},
{ID: 'asset4', Color: 'pink', Size: 20, Owner: 'Van', AppraisedValue: 400}
];

expect(ret).to.eql(expected);
Expand All @@ -256,10 +256,10 @@ describe('Asset Transfer Basic Tests', () => {
expect(ret.length).to.equal(4);

let expected = [
{Record: 'non-json-value'},
{Record: {ID: 'asset2', Color: 'orange', Size: 10, Owner: 'Paul', AppraisedValue: 200}},
{Record: {ID: 'asset3', Color: 'red', Size: 15, Owner: 'Troy', AppraisedValue: 300}},
{Record: {ID: 'asset4', Color: 'pink', Size: 20, Owner: 'Van', AppraisedValue: 400}}
'non-json-value',
{ID: 'asset2', Color: 'orange', Size: 10, Owner: 'Paul', AppraisedValue: 200},
{ID: 'asset3', Color: 'red', Size: 15, Owner: 'Troy', AppraisedValue: 300},
{ID: 'asset4', Color: 'pink', Size: 20, Owner: 'Van', AppraisedValue: 400}
];

expect(ret).to.eql(expected);
Expand Down
13 changes: 13 additions & 0 deletions asset-transfer-basic/chaincode-typescript/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import js from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(js.configs.recommended, ...tseslint.configs.strictTypeChecked, {
languageOptions: {
ecmaVersion: 2023,
sourceType: 'module',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: import.meta.dirname,
},
},
});
Loading

0 comments on commit fd7839f

Please sign in to comment.