From fde20af965b4b30ce3de1e5cc2cb8239622e7658 Mon Sep 17 00:00:00 2001 From: "Mark S. Lewis" Date: Mon, 2 Mar 2020 14:03:41 +0000 Subject: [PATCH] Add migration scenario test (#10) Runs against the result of `npm pack` to give some confidence that the published module will work. Signed-off-by: Mark S. Lewis --- .gitignore | 1 + .npmignore | 3 + azure-pipelines.yml | 19 +- jest.config.js | 10 +- package-lock.json | 224 +++++++++++------- package.json | 10 +- runScenario.sh | 20 ++ scenario/.gitignore | 2 + scenario/jest.config.js | 5 + scenario/package.json | 18 ++ scenario/test/Migrate.spec.ts | 96 ++++++++ ...c825e3b9823582ddebc4b3c39ee9cd493712c-priv | 5 + ...2c825e3b9823582ddebc4b3c39ee9cd493712c-pub | 4 + scenario/wallet/user1/user1 | 1 + ...e00e54008883449b7411a05ad7882ee1f1aab-priv | 5 + ...7e00e54008883449b7411a05ad7882ee1f1aab-pub | 4 + scenario/wallet/user2/user2 | 1 + src/IdentityConverter.ts | 2 +- 18 files changed, 329 insertions(+), 101 deletions(-) create mode 100755 runScenario.sh create mode 100644 scenario/.gitignore create mode 100644 scenario/jest.config.js create mode 100644 scenario/package.json create mode 100644 scenario/test/Migrate.spec.ts create mode 100644 scenario/wallet/user1/8ee3f5bf29b8a30a038c38c5fc2c825e3b9823582ddebc4b3c39ee9cd493712c-priv create mode 100644 scenario/wallet/user1/8ee3f5bf29b8a30a038c38c5fc2c825e3b9823582ddebc4b3c39ee9cd493712c-pub create mode 100644 scenario/wallet/user1/user1 create mode 100644 scenario/wallet/user2/00d1b0fa0256847ecc75b3ff087e00e54008883449b7411a05ad7882ee1f1aab-priv create mode 100644 scenario/wallet/user2/00d1b0fa0256847ecc75b3ff087e00e54008883449b7411a05ad7882ee1f1aab-pub create mode 100644 scenario/wallet/user2/user2 diff --git a/.gitignore b/.gitignore index 155567d..fac287a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules dist *.tsbuildinfo coverage +*.tgz diff --git a/.npmignore b/.npmignore index a0dad6b..3fe2e6a 100644 --- a/.npmignore +++ b/.npmignore @@ -6,3 +6,6 @@ test jest.config.js coverage azure-pipelines.yml +scenario +*.tgz +*.sh diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b7f0255..fffc8c0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,12 +17,12 @@ stages: jobs: - job: Test - displayName: Test with + displayName: Test with Node.js strategy: matrix: - 'Node.js 10': + '10': versionSpec: '10.x' - 'Node.js 12': + '12': versionSpec: '12.x' steps: @@ -30,10 +30,15 @@ stages: - task: NodeTool@0 inputs: versionSpec: "$(versionSpec)" - displayName: 'Install Node.js' + displayName: Install Node.js - - script: npm install - displayName: 'npm install' + - script: | + npm install + npm run compile + displayName: Build - script: npm test - displayName: 'Run tests' + displayName: Unit test + + - script: npm run scenario + displayName: Scenario test diff --git a/jest.config.js b/jest.config.js index 2358d68..d4d7e82 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,9 @@ module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - collectCoverage: true + preset: "ts-jest", + testEnvironment: "node", + collectCoverage: true, + testPathIgnorePatterns: [ + "/node_modules/", + "/scenario/" + ] }; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8e96582..366193e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "fabric-wallet-migration", - "version": "0.0.5", + "version": "0.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -869,8 +869,7 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "base": { "version": "0.11.2", @@ -956,7 +955,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1256,8 +1254,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "convert-source-map": { "version": "1.7.0", @@ -1925,8 +1922,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "2.1.2", @@ -1981,7 +1977,6 @@ "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -2026,22 +2021,26 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, "ansi-regex": { "version": "2.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "aproba": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true }, "are-we-there-yet": { "version": "1.1.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "dev": true, "requires": { "delegates": "^1.0.0", @@ -2050,12 +2049,14 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, "brace-expansion": { "version": "1.1.11", - "bundled": true, + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -2064,32 +2065,38 @@ }, "chownr": { "version": "1.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.2.tgz", + "integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==", "dev": true }, "code-point-at": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, "concat-map": { "version": "0.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true }, "core-util-is": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, "debug": { "version": "3.2.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { "ms": "^2.1.1" @@ -2097,22 +2104,26 @@ }, "deep-extend": { "version": "0.6.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true }, "delegates": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true }, "detect-libc": { "version": "1.0.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true }, "fs-minipass": { "version": "1.2.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.6.tgz", + "integrity": "sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ==", "dev": true, "requires": { "minipass": "^2.2.1" @@ -2120,12 +2131,14 @@ }, "fs.realpath": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, "gauge": { "version": "2.7.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "requires": { "aproba": "^1.0.3", @@ -2140,7 +2153,8 @@ }, "glob": { "version": "7.1.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -2153,12 +2167,14 @@ }, "has-unicode": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true }, "iconv-lite": { "version": "0.4.24", - "bundled": true, + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" @@ -2166,7 +2182,8 @@ }, "ignore-walk": { "version": "3.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "requires": { "minimatch": "^3.0.4" @@ -2174,7 +2191,8 @@ }, "inflight": { "version": "1.0.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { "once": "^1.3.0", @@ -2183,17 +2201,20 @@ }, "inherits": { "version": "2.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "ini": { "version": "1.3.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { "number-is-nan": "^1.0.0" @@ -2201,12 +2222,14 @@ }, "isarray": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "minimatch": { "version": "3.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -2214,12 +2237,14 @@ }, "minimist": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, "minipass": { "version": "2.3.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", + "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "dev": true, "requires": { "safe-buffer": "^5.1.2", @@ -2228,7 +2253,8 @@ }, "minizlib": { "version": "1.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", + "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", "dev": true, "requires": { "minipass": "^2.2.1" @@ -2236,7 +2262,8 @@ }, "mkdirp": { "version": "0.5.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { "minimist": "0.0.8" @@ -2244,19 +2271,22 @@ "dependencies": { "minimist": { "version": "0.0.8", - "bundled": true, + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true } } }, "ms": { "version": "2.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "needle": { "version": "2.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/needle/-/needle-2.4.0.tgz", + "integrity": "sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg==", "dev": true, "requires": { "debug": "^3.2.6", @@ -2266,7 +2296,8 @@ }, "node-pre-gyp": { "version": "0.13.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.13.0.tgz", + "integrity": "sha512-Md1D3xnEne8b/HGVQkZZwV27WUi1ZRuZBij24TNaZwUPU3ZAFtvT6xxJGaUVillfmMKnn5oD1HoGsp2Ftik7SQ==", "dev": true, "requires": { "detect-libc": "^1.0.2", @@ -2283,7 +2314,8 @@ }, "nopt": { "version": "4.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "requires": { "abbrev": "1", @@ -2292,12 +2324,14 @@ }, "npm-bundled": { "version": "1.0.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", + "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", "dev": true }, "npm-packlist": { "version": "1.4.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.4.tgz", + "integrity": "sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw==", "dev": true, "requires": { "ignore-walk": "^3.0.1", @@ -2306,7 +2340,8 @@ }, "npmlog": { "version": "4.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "requires": { "are-we-there-yet": "~1.1.2", @@ -2317,17 +2352,20 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, "object-assign": { "version": "4.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, "once": { "version": "1.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { "wrappy": "1" @@ -2335,17 +2373,20 @@ }, "os-homedir": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, "os-tmpdir": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, "osenv": { "version": "0.1.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "requires": { "os-homedir": "^1.0.0", @@ -2354,17 +2395,20 @@ }, "path-is-absolute": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, "process-nextick-args": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, "rc": { "version": "1.2.8", - "bundled": true, + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "requires": { "deep-extend": "^0.6.0", @@ -2375,7 +2419,8 @@ }, "readable-stream": { "version": "2.3.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -2389,7 +2434,8 @@ }, "rimraf": { "version": "2.7.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "requires": { "glob": "^7.1.3" @@ -2397,37 +2443,44 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "safer-buffer": { "version": "2.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "sax": { "version": "1.2.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true }, "semver": { "version": "5.7.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, "set-blocking": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, "signal-exit": { "version": "3.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, "string-width": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { "code-point-at": "^1.0.0", @@ -2437,7 +2490,8 @@ }, "string_decoder": { "version": "1.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -2445,7 +2499,8 @@ }, "strip-ansi": { "version": "3.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -2453,12 +2508,14 @@ }, "strip-json-comments": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, "tar": { "version": "4.4.10", - "bundled": true, + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.10.tgz", + "integrity": "sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA==", "dev": true, "requires": { "chownr": "^1.1.1", @@ -2472,12 +2529,14 @@ }, "util-deprecate": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, "wide-align": { "version": "1.1.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, "requires": { "string-width": "^1.0.2 || 2" @@ -2485,12 +2544,14 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "yallist": { "version": "3.0.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", "dev": true } } @@ -2675,7 +2736,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -2684,8 +2744,7 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ini": { "version": "1.3.5", @@ -3788,7 +3847,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4154,7 +4212,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -4254,8 +4311,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-key": { "version": "2.0.1", @@ -4680,7 +4736,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, "requires": { "glob": "^7.1.3" } @@ -5789,8 +5844,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { "version": "3.0.3", diff --git a/package.json b/package.json index 57fa603..0f42f12 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,10 @@ "main": "index.js", "types": "index.d.ts", "scripts": { - "clean": "rm -rf dist", - "compile": "tsc --project .", - "prepack": "npm run clean && npm run compile && npm test", - "test": "jest test" + "clean": "rm -rf dist *.tgz", + "compile": "tsc", + "scenario": "./runScenario.sh", + "test": "jest" }, "repository": { "type": "git", @@ -30,7 +30,7 @@ "fabric-network": "^1.4.7", "jest": "^25.1.0", "ts-jest": "^25.2.1", - "typescript": "^3.8.2" + "typescript": "^3.8.3" }, "dependencies": { "rimraf": "^3.0.2", diff --git a/runScenario.sh b/runScenario.sh new file mode 100755 index 0000000..1b613e0 --- /dev/null +++ b/runScenario.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -eu -o pipefail + +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd ) + +createPackFile() { + local packFile + packFile=$( npm pack ) + targetFile=$( echo "${packFile}" | sed -e 's/[^-]*\.tgz$/dev.tgz/' ) + mv "${packFile}" "${targetFile}" +} + +scenarioTest() { + npm install + npm test +} + +( cd "${DIR}" && createPackFile ) +( cd "${DIR}/scenario" && scenarioTest ) diff --git a/scenario/.gitignore b/scenario/.gitignore new file mode 100644 index 0000000..66ae216 --- /dev/null +++ b/scenario/.gitignore @@ -0,0 +1,2 @@ +package-lock.json + diff --git a/scenario/jest.config.js b/scenario/jest.config.js new file mode 100644 index 0000000..2f84062 --- /dev/null +++ b/scenario/jest.config.js @@ -0,0 +1,5 @@ +module.exports = { + preset: "ts-jest", + testEnvironment: "node", + rootDir: "./test" +}; \ No newline at end of file diff --git a/scenario/package.json b/scenario/package.json new file mode 100644 index 0000000..9f2455f --- /dev/null +++ b/scenario/package.json @@ -0,0 +1,18 @@ +{ + "name": "scenario", + "version": "1.0.0", + "private": true, + "description": "", + "main": "index.js", + "scripts": { + "test": "jest" + }, + "author": "", + "license": "Apache-2.0", + "devDependencies": { + "fabric-network": "^2.0.0-beta.3", + "fabric-wallet-migration": "file:../fabric-wallet-migration-dev.tgz", + "jest": "^25.1.0", + "typescript": "^3.8.3" + } +} diff --git a/scenario/test/Migrate.spec.ts b/scenario/test/Migrate.spec.ts new file mode 100644 index 0000000..0e7c3cc --- /dev/null +++ b/scenario/test/Migrate.spec.ts @@ -0,0 +1,96 @@ +/** + * SPDX-License-Identifier: Apache-2.0 + */ + +import { WalletStores } from "fabric-wallet-migration"; +import { Wallet, Wallets, Identity, X509Identity } from "fabric-network"; + +import fs = require("fs"); +import os = require("os"); +import path = require("path"); +import util = require("util"); +import _rimraf = require("rimraf"); +const rimraf = util.promisify(_rimraf); + +const oldWalletPath = path.resolve(__dirname, "..", "wallet"); + +async function createTempDir() { + const prefix = path.join(os.tmpdir(), "wallet-"); + return await fs.promises.mkdtemp(prefix); +} + +describe("Wallet migration", () => { + let walletPath: string; + let wallet: Wallet; + + beforeAll(async () => { + walletPath = await createTempDir(); + await migrate(); + wallet = await Wallets.newFileSystemWallet(walletPath); + }); + + afterAll(async () => { + await rimraf(walletPath); + }); + + async function migrate() { + const walletStore = WalletStores.newFileSystemWalletStore(oldWalletPath); + const oldWallet = new Wallet(walletStore); + + const newWallet = await Wallets.newFileSystemWallet(walletPath); + + const migratedLabels: string[] = []; + const identityLabels = await oldWallet.list(); + for (const label of identityLabels) { + const identity = await oldWallet.get(label); + if (identity) { + await newWallet.put(label, identity); + migratedLabels.push(label); + } + } + + return migratedLabels; + } + + async function getAll() { + const identities = new Map(); + + const labels = await wallet.list(); + for (const label of labels) { + const identity = await wallet.get(label); + if (identity) { + identities.set(label, identity); + } + } + + return identities; + } + + it("has expected labels", async () => { + const labels = await wallet.list(); + expect(labels).toEqual(["user1", "user2"]); + }); + + it("contains X.509 identities", async () => { + const identities = await getAll(); + identities.forEach((identity) => { + expect(identity.type).toEqual("X.509"); + }); + }); + + it("identities have non-empty certificates", async () => { + const identities = await getAll(); + identities.forEach((identity) => { + const x509Identity = identity as X509Identity; + expect(x509Identity.credentials.certificate).toMatch(/.+/); + }); + }); + + it("identities have non-empty private keys", async () => { + const identities = await getAll(); + identities.forEach((identity) => { + const x509Identity = identity as X509Identity; + expect(x509Identity.credentials.privateKey).toMatch(/.+/); + }); + }); +}); diff --git a/scenario/wallet/user1/8ee3f5bf29b8a30a038c38c5fc2c825e3b9823582ddebc4b3c39ee9cd493712c-priv b/scenario/wallet/user1/8ee3f5bf29b8a30a038c38c5fc2c825e3b9823582ddebc4b3c39ee9cd493712c-priv new file mode 100644 index 0000000..955d389 --- /dev/null +++ b/scenario/wallet/user1/8ee3f5bf29b8a30a038c38c5fc2c825e3b9823582ddebc4b3c39ee9cd493712c-priv @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgyzr9w9VY9qI3koXq +Ovxz4chsz16obqzKdRG0cKUpvUyhRANCAAQ3HCLhuIk/ZKOUrTJblTfTbPrYEcEp +GiHtmkUcswGiEIk0Z8kzp4zgMKPvFoOjukht4dhk/+eDMFAvLa12ER41 +-----END PRIVATE KEY----- diff --git a/scenario/wallet/user1/8ee3f5bf29b8a30a038c38c5fc2c825e3b9823582ddebc4b3c39ee9cd493712c-pub b/scenario/wallet/user1/8ee3f5bf29b8a30a038c38c5fc2c825e3b9823582ddebc4b3c39ee9cd493712c-pub new file mode 100644 index 0000000..d482f37 --- /dev/null +++ b/scenario/wallet/user1/8ee3f5bf29b8a30a038c38c5fc2c825e3b9823582ddebc4b3c39ee9cd493712c-pub @@ -0,0 +1,4 @@ +-----BEGIN PUBLIC KEY----- +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENxwi4biJP2SjlK0yW5U302z62BHB +KRoh7ZpFHLMBohCJNGfJM6eM4DCj7xaDo7pIbeHYZP/ngzBQLy2tdhEeNQ== +-----END PUBLIC KEY----- diff --git a/scenario/wallet/user1/user1 b/scenario/wallet/user1/user1 new file mode 100644 index 0000000..e50ea6a --- /dev/null +++ b/scenario/wallet/user1/user1 @@ -0,0 +1 @@ +{"name":"user1","mspid":"Org1MSP","roles":null,"affiliation":"","enrollmentSecret":"","enrollment":{"signingIdentity":"8ee3f5bf29b8a30a038c38c5fc2c825e3b9823582ddebc4b3c39ee9cd493712c","identity":{"certificate":"-----BEGIN CERTIFICATE-----\nMIICWTCCAf+gAwIBAgIUSKAUBU+/6sqUHKjxbbH/ZvkkgAUwCgYIKoZIzj0EAwIw\nfzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNh\nbiBGcmFuY2lzY28xHzAdBgNVBAoTFkludGVybmV0IFdpZGdldHMsIEluYy4xDDAK\nBgNVBAsTA1dXVzEUMBIGA1UEAxMLZXhhbXBsZS5jb20wHhcNMjAwMjI0MTUzNzAw\nWhcNMjEwMjIzMTU0MjAwWjBdMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGgg\nQ2Fyb2xpbmExFDASBgNVBAoTC0h5cGVybGVkZ2VyMQ8wDQYDVQQLEwZjbGllbnQx\nDjAMBgNVBAMTBWFkbWluMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENxwi4biJ\nP2SjlK0yW5U302z62BHBKRoh7ZpFHLMBohCJNGfJM6eM4DCj7xaDo7pIbeHYZP/n\ngzBQLy2tdhEeNaN7MHkwDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwHQYD\nVR0OBBYEFCBh9T6woSaKdCYc3xp0b2fHqGDaMB8GA1UdIwQYMBaAFBdnQj2qnoI/\nxMUdn1vDmdG1nEgQMBkGA1UdEQQSMBCCDmRvY2tlci1kZXNrdG9wMAoGCCqGSM49\nBAMCA0gAMEUCIQDvXlen/JmnziTlKKhVu/zpIk+LbtdsJv6xlf4AXzjfSgIgRQ94\nurE2nabbhBB8QDIyI7+vnXLNPbT7OneAefxnUI4=\n-----END CERTIFICATE-----"}}} diff --git a/scenario/wallet/user2/00d1b0fa0256847ecc75b3ff087e00e54008883449b7411a05ad7882ee1f1aab-priv b/scenario/wallet/user2/00d1b0fa0256847ecc75b3ff087e00e54008883449b7411a05ad7882ee1f1aab-priv new file mode 100644 index 0000000..f8801a2 --- /dev/null +++ b/scenario/wallet/user2/00d1b0fa0256847ecc75b3ff087e00e54008883449b7411a05ad7882ee1f1aab-priv @@ -0,0 +1,5 @@ +-----BEGIN PRIVATE KEY----- +MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgvUT1OcbWZO8Mu9Il +PGMhpFMsT63gGKIbN6EH0M5aw3OhRANCAARnkEt2rIASwyCYBFlDs8xT27v7YMoq +ktBB435jO3AgtOLsvcQjnIMHTkEHVU4M4NTpKmCVT8Yy/zS9B21AcWhN +-----END PRIVATE KEY----- diff --git a/scenario/wallet/user2/00d1b0fa0256847ecc75b3ff087e00e54008883449b7411a05ad7882ee1f1aab-pub b/scenario/wallet/user2/00d1b0fa0256847ecc75b3ff087e00e54008883449b7411a05ad7882ee1f1aab-pub new file mode 100644 index 0000000..1233d97 --- /dev/null +++ b/scenario/wallet/user2/00d1b0fa0256847ecc75b3ff087e00e54008883449b7411a05ad7882ee1f1aab-pub @@ -0,0 +1,4 @@ +-----BEGIN PUBLIC KEY----- +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEZ5BLdqyAEsMgmARZQ7PMU9u7+2DK +KpLQQeN+YztwILTi7L3EI5yDB05BB1VODODU6SpglU/GMv80vQdtQHFoTQ== +-----END PUBLIC KEY----- diff --git a/scenario/wallet/user2/user2 b/scenario/wallet/user2/user2 new file mode 100644 index 0000000..a83fea0 --- /dev/null +++ b/scenario/wallet/user2/user2 @@ -0,0 +1 @@ +{"name":"user2","mspid":"Org1MSP","roles":null,"affiliation":"","enrollmentSecret":"","enrollment":{"signingIdentity":"00d1b0fa0256847ecc75b3ff087e00e54008883449b7411a05ad7882ee1f1aab","identity":{"certificate":"-----BEGIN CERTIFICATE-----\nMIICvDCCAmOgAwIBAgIUE/PYgz1FszgQyZdJMTD7WVotlZ4wCgYIKoZIzj0EAwIw\nfzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNh\nbiBGcmFuY2lzY28xHzAdBgNVBAoTFkludGVybmV0IFdpZGdldHMsIEluYy4xDDAK\nBgNVBAsTA1dXVzEUMBIGA1UEAxMLZXhhbXBsZS5jb20wHhcNMjAwMjI0MTUzNzAw\nWhcNMjEwMjIzMTU0MjAwWjBhMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGgg\nQ2Fyb2xpbmExFDASBgNVBAoTC0h5cGVybGVkZ2VyMQ8wDQYDVQQLEwZjbGllbnQx\nEjAQBgNVBAMTCW9yZzFBZG1pbjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABGeQ\nS3asgBLDIJgEWUOzzFPbu/tgyiqS0EHjfmM7cCC04uy9xCOcgwdOQQdVTgzg1Okq\nYJVPxjL/NL0HbUBxaE2jgdowgdcwDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQC\nMAAwHQYDVR0OBBYEFPoIUbE0sNAmYKoUxiRCxYOAG1bJMB8GA1UdIwQYMBaAFBdn\nQj2qnoI/xMUdn1vDmdG1nEgQMBkGA1UdEQQSMBCCDmRvY2tlci1kZXNrdG9wMFwG\nCCoDBAUGBwgBBFB7ImF0dHJzIjp7ImhmLkFmZmlsaWF0aW9uIjoiIiwiaGYuRW5y\nb2xsbWVudElEIjoib3JnMUFkbWluIiwiaGYuVHlwZSI6ImNsaWVudCJ9fTAKBggq\nhkjOPQQDAgNHADBEAiAgZFVt/vMETbX6SFvbwCLBm9EhmxnuJ1QnXwD3xbFTpwIg\nK4UQSGTVbujzmp6tvE9fClhKOkMKaGBzoWMU+32ZqtA=\n-----END CERTIFICATE-----"}}} diff --git a/src/IdentityConverter.ts b/src/IdentityConverter.ts index 9ae8017..2954ca4 100644 --- a/src/IdentityConverter.ts +++ b/src/IdentityConverter.ts @@ -35,7 +35,7 @@ export class IdentityConverter implements IdentityConverter { identity: { certificate: storeData.credentials.certificate, }, - signingIdentity: uuid.v4().replace("-", "") + signingIdentity: uuid.v4() } }; const privateKey = storeData.credentials.privateKey;