You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(connector-go-ethereum-socketio): fix strict flag warnings
cactus-plugin-ledger-connector-go-ethereum-socketio will compile with global strict flag.
Related issue: hyperledger-cacti#1671
Signed-off-by: Michal Bajer <[email protected]>
Copy file name to clipboardExpand all lines: packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/main/typescript/connector/ServerMonitorPlugin.ts
+15-18
Original file line number
Diff line number
Diff line change
@@ -25,33 +25,30 @@ import { ValidatorAuthentication } from "./ValidatorAuthentication";
25
25
constWeb3=require("web3");
26
26
importsafeStringifyfrom"fast-safe-stringify";
27
27
28
+
exporttypeMonitorCallback=(callback: {
29
+
status: number;
30
+
blockData?: string;
31
+
errorDetail?: string;
32
+
})=>void;
33
+
28
34
/*
29
35
* ServerMonitorPlugin
30
36
* Class definitions of server monitoring
31
37
*/
32
38
exportclassServerMonitorPlugin{
33
-
_filterTable: object;
34
-
35
-
/*
36
-
* constructors
37
-
*/
38
-
constructor(){
39
-
// Define dependent specific settings
40
-
// Initialize monitored filter
41
-
this._filterTable={};
42
-
}
39
+
_filterTable=newMap<string,any>();
43
40
44
41
/*
45
42
* startMonitor
46
43
* Start Monitoring
47
44
* @param {string} clientId: Client ID from which monitoring start request was made
48
45
* @param {function} cb: A callback function that receives monitoring results at any time.
Copy file name to clipboardExpand all lines: packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/main/typescript/connector/ServerPlugin.ts
+16-16
Original file line number
Diff line number
Diff line change
@@ -47,8 +47,8 @@ export class ServerPlugin {
47
47
* Scope of this function is in this class
48
48
* Functions that should not be called directly should be implemented outside this class like utilities.
49
49
*/
50
-
isExistFunction(funcName){
51
-
if(this[funcName]!=undefined){
50
+
isExistFunction(funcName: string){
51
+
if((thisasany)[funcName]){
52
52
returntrue;
53
53
}else{
54
54
returnfalse;
@@ -67,11 +67,11 @@ export class ServerPlugin {
67
67
* }
68
68
* @return {Object} JSON object
69
69
*/
70
-
getNumericBalance(args){
70
+
getNumericBalance(args: any){
71
71
// * The Web3 API can be used synchronously, but each function is always an asynchronous specification because of the use of other APIs such as REST,
72
72
returnnewPromise((resolve,reject)=>{
73
73
logger.info("getNumericBalance start");
74
-
letretObj={};
74
+
letretObj: Record<string,any>;
75
75
76
76
constreferedAddress=args.args.args[0];
77
77
constreqID=args["reqID"];
@@ -139,11 +139,11 @@ export class ServerPlugin {
139
139
* }
140
140
* @return {Object} JSON object
141
141
*/
142
-
transferNumericAsset(args){
142
+
transferNumericAsset(args: any){
143
143
returnnewPromise((resolve,reject)=>{
144
144
logger.info("transferNumericAsset start");
145
145
146
-
letretObj={};
146
+
letretObj: Record<string,any>;
147
147
letsendArgs={};
148
148
constsendFunction="sendTransaction";
149
149
// const funcParam = args;
@@ -231,11 +231,11 @@ export class ServerPlugin {
231
231
* }
232
232
* @return {Object} JSON object
233
233
*/
234
-
getNonce(args){
234
+
getNonce(args: any){
235
235
// * The Web3 API can be used synchronously, but each function is always an asynchronous specification because of the use of other APIs such as REST,
236
236
returnnewPromise((resolve,reject)=>{
237
237
logger.info("getNonce start");
238
-
letretObj={};
238
+
letretObj: Record<string,any>;
239
239
240
240
consttargetAddress=args.args.args.args[0];
241
241
constreqID=args["reqID"];
@@ -316,11 +316,11 @@ export class ServerPlugin {
316
316
* }
317
317
* @return {Object} JSON object
318
318
*/
319
-
toHex(args){
319
+
toHex(args: any){
320
320
// * The Web3 API can be used synchronously, but each function is always an asynchronous specification because of the use of other APIs such as REST,
0 commit comments