Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit 8743c2e

Browse files
Fixes required by changes to typing in dependencies (#682)
Scheduled build began failing last week, with the typing / import errors related to the version of the long package inherited from the protobuf packages. Add explicit dependencies on the long package and adjust imports accordingly. Signed-off-by: Mark S. Lewis <[email protected]>
1 parent 9bf4de0 commit 8743c2e

24 files changed

+50
-124
lines changed

fabric-common/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"fabric-protos": "file:../fabric-protos",
3030
"js-sha3": "^0.8.0",
3131
"jsrsasign": "^10.5.25",
32+
"long": "^5.2.3",
3233
"nconf": "^0.12.0",
3334
"promise-settle": "^0.3.0",
3435
"sjcl": "^1.0.8",
@@ -61,6 +62,5 @@
6162
"type": "Apache-2.0",
6263
"url": "https://github.com/hyperledger/fabric/blob/main/LICENSE"
6364
}
64-
],
65-
"devDependencies": {}
65+
]
6666
}

fabric-common/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* eslint-disable @typescript-eslint/no-explicit-any */
66
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
77

8-
import * as Long from 'long';
8+
import Long from 'long';
99
import * as fabproto6 from 'fabric-protos';
1010
import winston = require('winston');
1111

fabric-common/types/tsconfig.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"$schema": "https://json.schemastore.org/tsconfig",
33
"extends": "@tsconfig/node10/tsconfig.json",
44
"compilerOptions": {
5-
"removeComments": false,
65
"preserveConstEnums": true,
76
"sourceMap": true,
87
"declaration": true,
9-
"noImplicitAny": true,
8+
"declarationMap": true,
9+
"strict": true,
10+
"noUnusedLocals": true,
1011
"noImplicitReturns": true,
11-
"noImplicitThis": true,
12-
"suppressImplicitAnyIndexErrors": true,
12+
"forceConsistentCasingInFileNames": true,
1313
"baseUrl": ".",
1414
"paths": {
1515
"*": [

fabric-network/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"dependencies": {
2727
"fabric-common": "file:../fabric-common",
2828
"fabric-protos": "file:../fabric-protos",
29+
"long": "^5.2.3",
2930
"nano": "^9.0.5"
3031
},
3132
"nyc": {
@@ -54,6 +55,5 @@
5455
"type": "Apache-2.0",
5556
"url": "https://github.com/hyperledger/fabric/blob/master/LICENSE"
5657
}
57-
],
58-
"devDependencies": {}
58+
]
5959
}

fabric-network/src/checkpointer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
import * as Long from 'long';
7+
import Long from 'long';
88

99
export interface Checkpointer {
1010
addTransactionId(transactionId: string): Promise<void>;

fabric-network/src/events.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import {BlockType, Endorser} from 'fabric-common';
88
import * as fabproto6 from 'fabric-protos';
99
import {Checkpointer} from './checkpointer';
10-
import * as Long from 'long';
10+
import Long from 'long';
1111

1212
export type EventType = BlockType;
1313

fabric-network/src/impl/event/blockeventsource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {newFullBlockEvent} from './fullblockeventfactory';
1515
import {OrderedBlockQueue} from './orderedblockqueue';
1616
import {newPrivateBlockEvent} from './privateblockeventfactory';
1717
import {notNullish} from '../gatewayutils';
18-
import * as Long from 'long';
18+
import Long from 'long';
1919

2020
const logger = Logger.getLogger('BlockEventSource');
2121

fabric-network/src/impl/event/commitlistenersession.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class CommitListenerSession implements ListenerSession {
7272
return startErrors;
7373
}
7474

75-
private async startEventService(eventService: EventService): Promise<CommitError|undefined> {
75+
private async startEventService(eventService: EventService): Promise<CommitError|void> {
7676
try {
7777
await this.eventServiceManager.startEventService(eventService);
7878
} catch (error) {

fabric-network/src/impl/event/orderedblockqueue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import {BlockEvent} from '../../events';
8-
import * as Long from 'long';
8+
import Long from 'long';
99

1010
export class OrderedBlockQueue {
1111
private readonly queue = new Map<string, BlockEvent>();

fabric-network/src/impl/filecheckpointer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import {Checkpointer} from '../checkpointer';
8-
import * as Long from 'long';
8+
import Long from 'long';
99
import * as fs from 'fs';
1010

1111
const encoding = 'utf8';
@@ -58,7 +58,7 @@ export class FileCheckpointer implements Checkpointer {
5858
}
5959
}
6060

61-
private async readFile(): Promise<Buffer | undefined> {
61+
private async readFile(): Promise<Buffer | void> {
6262
try {
6363
return await fs.promises.readFile(this.path);
6464
} catch (err) {

0 commit comments

Comments
 (0)