From ec4753b46f60a447972233a44870252955377490 Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Thu, 10 Dec 2020 17:05:00 +0000 Subject: [PATCH] Patched the finalization schema --- package-lock.json | 8 ++++---- package.json | 2 +- src/infrastructure/FinalizationHttp.ts | 1 + src/model/finalization/BmTreeSignature.ts | 4 ++++ test/infrastructure/FinalizationHttp.spec.ts | 1 + 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index fa718c4b57..eec4deb424 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6159,7 +6159,7 @@ }, "which-module": { "version": "2.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, @@ -7746,9 +7746,9 @@ } }, "symbol-openapi-typescript-fetch-client": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/symbol-openapi-typescript-fetch-client/-/symbol-openapi-typescript-fetch-client-0.10.4.tgz", - "integrity": "sha512-WME5yuvfYTT7BxvKOyKu6iAWPPXCBmuARTpwBfh5jW+3SkmZ5KVVgl2H54ORmJILFGBm1ozzvMlyuGa+fsd7hw==" + "version": "0.10.5-SNAPSHOT.202012101637", + "resolved": "https://registry.npmjs.org/symbol-openapi-typescript-fetch-client/-/symbol-openapi-typescript-fetch-client-0.10.5-SNAPSHOT.202012101637.tgz", + "integrity": "sha512-UkjsLyOFDB9SBvOpz5QrXZUMXs3nnUsLlEvcc/NcZbOUBuFChTW/eKdbeIBSsmB3dzsNpGhyfZglpAY4Oi7ddg==" }, "symbol-sdk": { "version": "0.21.0", diff --git a/package.json b/package.json index 6d419784d4..3c1ec03575 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "ripemd160": "^2.0.2", "rxjs": "^6.6.3", "rxjs-compat": "^6.6.3", - "symbol-openapi-typescript-fetch-client": "0.10.4", + "symbol-openapi-typescript-fetch-client": "0.10.5-SNAPSHOT.202012101637", "tweetnacl": "^1.0.3", "ws": "^7.3.1" }, diff --git a/src/infrastructure/FinalizationHttp.ts b/src/infrastructure/FinalizationHttp.ts index 76533bbdae..a80a24309f 100644 --- a/src/infrastructure/FinalizationHttp.ts +++ b/src/infrastructure/FinalizationHttp.ts @@ -91,6 +91,7 @@ export class FinalizationHttp extends Http implements FinalizationRepository { new BmTreeSignature( new ParentPublicKeySignaturePair(s.root.parentPublicKey, s.root.signature), new ParentPublicKeySignaturePair(s.bottom.parentPublicKey, s.bottom.signature), + s.top ? new ParentPublicKeySignaturePair(s.top.parentPublicKey, s.top.signature) : undefined, ), ), mg.signatureSchema, diff --git a/src/model/finalization/BmTreeSignature.ts b/src/model/finalization/BmTreeSignature.ts index cf0676aa66..c8d43a5de2 100644 --- a/src/model/finalization/BmTreeSignature.ts +++ b/src/model/finalization/BmTreeSignature.ts @@ -29,5 +29,9 @@ export class BmTreeSignature { * Bottom. */ public readonly bottom: ParentPublicKeySignaturePair, + /** + * top (for testnet/3 V1 schema only). + */ + public readonly top?: ParentPublicKeySignaturePair, ) {} } diff --git a/test/infrastructure/FinalizationHttp.spec.ts b/test/infrastructure/FinalizationHttp.spec.ts index 20da18bee2..ec52094583 100644 --- a/test/infrastructure/FinalizationHttp.spec.ts +++ b/test/infrastructure/FinalizationHttp.spec.ts @@ -55,6 +55,7 @@ describe('FinalizationHttp', () => { const tree = {} as BmTreeSignature; tree.bottom = ps; tree.root = ps; + tree.top = undefined; mg.signatures = [tree]; dto.messageGroups = [mg];