Skip to content

Commit 87b2ad7

Browse files
author
Inwon Kim
committed
fix lint problems
1 parent 24582ca commit 87b2ad7

18 files changed

+96
-19
lines changed

.eslintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@
7272
"no-console": 0,
7373
"no-undef": 0
7474
}
75-
}],
75+
}]
7676
}

lib/Exception.ts

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const ExceptionCode = {
2828
*/
2929
export class Exception {
3030
code: string;
31+
3132
message: string;
3233

3334
/**

lib/IconService.ts

+19-9
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,21 @@ import BTPSourceInformation from "./data/Formatter/BTPSourceInformation";
4848
*/
4949
export default class IconService {
5050
public static IconAmount = Amount;
51+
5152
public static IconBuilder = Builder;
53+
5254
public static IconConverter = Converter;
55+
5356
public static IconWallet = Wallet;
57+
5458
public static IconUtil = Util;
59+
5560
public static SignedTransaction = SignedTransaction;
61+
5662
public static HttpProvider = HttpProvider;
63+
5764
public static IconHexadecimal = Hexadecimal;
65+
5866
public static IconValidator = Validator;
5967

6068
private provider: HttpProvider;
@@ -290,6 +298,7 @@ export default class IconService {
290298
return this.provider.request(request);
291299
}
292300
}
301+
293302
/**
294303
* Calls a SCORE API just for reading.
295304
* @param {Call} call - The call instance exported by CallBuilder
@@ -366,7 +375,7 @@ export default class IconService {
366375
throw error.toString();
367376
}
368377
const requestId = Util.getCurrentTime();
369-
const params = { hash: hash };
378+
const params = { hash };
370379
const request = new Request(requestId, "icx_getDataByHash", params);
371380
return this.provider.request(request);
372381
}
@@ -412,6 +421,7 @@ export default class IconService {
412421
const request = new Request(requestId, "icx_getVotesByHeight", params);
413422
return this.provider.request(request);
414423
}
424+
415425
/**
416426
* Get proof for the receipt
417427
* @param {string} hash - The hash value of the block including the result
@@ -431,7 +441,7 @@ export default class IconService {
431441
throw error.toString();
432442
}
433443
const requestId = Util.getCurrentTime();
434-
const params = { hash: hash, index: Converter.toHex(index) };
444+
const params = { hash, index: Converter.toHex(index) };
435445
const request = new Request(requestId, "icx_getProofForResult", params);
436446
return this.provider.request(request);
437447
}
@@ -464,15 +474,15 @@ export default class IconService {
464474
}
465475
const requestId = Util.getCurrentTime();
466476
const params = {
467-
hash: hash,
477+
hash,
468478
index: Converter.toHex(index),
469479
events: events.map(Converter.toHex),
470480
};
471481
const request = new Request(requestId, "icx_getProofForEvents", params);
472482
return this.provider.request(request);
473483
}
474484

475-
/***
485+
/** *
476486
* Get BTP network information.
477487
* @param id - network id
478488
* @param height - Main block height
@@ -492,7 +502,7 @@ export default class IconService {
492502
return this.provider.request<BTPNetworkInfo>(request);
493503
}
494504

495-
/***
505+
/** *
496506
* Get BTP network type information.
497507
* @param id - Network type id
498508
* @param height - Main block height
@@ -512,7 +522,7 @@ export default class IconService {
512522
return this.provider.request<BTPNetworkTypeInfo>(request);
513523
}
514524

515-
/***
525+
/** *
516526
* Get BTP messages
517527
* @param networkID - BTP network ID
518528
* @param height - Main block height
@@ -528,7 +538,7 @@ export default class IconService {
528538
return this.provider.request<Array<string>>(request);
529539
}
530540

531-
/***
541+
/** *
532542
* Get BTP block header
533543
* @param networkID - Network id
534544
* @param height - Main block height
@@ -544,7 +554,7 @@ export default class IconService {
544554
return this.provider.request<string>(request);
545555
}
546556

547-
/***
557+
/** *
548558
* Get BTP block proof
549559
* @param networkID - Network id
550560
* @param height - Main block height
@@ -560,7 +570,7 @@ export default class IconService {
560570
return this.provider.request<string>(request);
561571
}
562572

563-
/***
573+
/** *
564574
* Get source network information
565575
* @return {HttpCall} The HttpCall instance for btp_getSourceInformation JSON-RPC API request.
566576
*/

lib/SignedTransaction.ts

+11
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,27 @@ function createProperties(
4545
*/
4646
export default class SignedTransaction {
4747
private private: any;
48+
4849
to: string;
50+
4951
from: string;
52+
5053
value: string;
54+
5155
stepLimit: BigNumber;
56+
5257
nid: BigNumber;
58+
5359
nonce: string;
60+
5461
version: BigNumber;
62+
5563
timestamp: number;
64+
5665
signature: string;
66+
5767
dataType: string;
68+
5869
data: any;
5970

6071
/**

lib/Wallet.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ export interface KeyStore {
4747
*/
4848
export default class Wallet {
4949
private _privKey: any;
50+
5051
private privKey: any;
52+
5153
private pubKey: any;
54+
5255
private address: string;
5356

5457
/**
@@ -126,7 +129,7 @@ export default class Wallet {
126129
? keystore
127130
: JSON.parse(
128131
nonStrict
129-
? ((keystore as unknown) as string).toLowerCase()
132+
? (keystore as unknown as string).toLowerCase()
130133
: (keystore as string)
131134
);
132135

lib/data/Formatter/BTPNetworkInfo.ts

+8
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,21 @@ import BigNumber from "bignumber.js";
1818

1919
export default class BTPNetworkInfo {
2020
startHeight: BigNumber;
21+
2122
networkTypeID: BigNumber;
23+
2224
networkTypeName: string;
25+
2326
networkID: BigNumber;
27+
2428
networkName: string;
29+
2530
open: BigNumber;
31+
2632
nextMessageSN: BigNumber;
33+
2734
prevNSHash: string;
35+
2836
lastNSHash: string;
2937

3038
constructor(data) {

lib/data/Formatter/BTPNetworkTypeInfo.ts

+3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ import BigNumber from "bignumber.js";
1818

1919
export default class BTPNetworkTypeInfo {
2020
networkTypeID: BigNumber;
21+
2122
networkTypeName: string;
23+
2224
openNetworkIDs: Array<BigNumber>;
25+
2326
nextProofContext: string;
2427

2528
constructor(data) {

lib/data/Formatter/BTPSourceInformation.ts

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import BigNumber from "bignumber.js";
1818

1919
export default class BTPSourceInformation {
2020
srcNetworkUID: string;
21+
2122
networkTypeIDs: Array<BigNumber>;
2223

2324
constructor(data) {

lib/data/Formatter/Block.ts

+13-6
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,21 @@ function toConfirmedTransaction(
4141

4242
export default class Block {
4343
height: number;
44+
4445
blockHash: string;
46+
4547
merkleTreeRootHash: string;
48+
4649
prevBlockHash: string;
50+
4751
peerId: string;
52+
4853
confirmedTransactionList: ConfirmedTransaction[];
54+
4955
signature: string;
56+
5057
timeStamp: Hash;
58+
5159
version: Hash;
5260

5361
constructor(data) {
@@ -56,12 +64,11 @@ export default class Block {
5664
this.merkleTreeRootHash = add0xPrefix(data.merkle_tree_root_hash);
5765
this.prevBlockHash = add0xPrefix(data.prev_block_hash);
5866
this.peerId = addHxPrefix(data.peer_id);
59-
this.confirmedTransactionList = (
60-
data.confirmed_transaction_list || []
61-
).map((transaction: ConfirmedTransaction) =>
62-
isGenesisBlock(data.height)
63-
? transaction
64-
: toConfirmedTransaction(transaction)
67+
this.confirmedTransactionList = (data.confirmed_transaction_list || []).map(
68+
(transaction: ConfirmedTransaction) =>
69+
isGenesisBlock(data.height)
70+
? transaction
71+
: toConfirmedTransaction(transaction)
6572
);
6673
this.signature = data.signature;
6774
this.timeStamp = toNumber(data.time_stamp);

lib/data/Formatter/ConfirmedTransaction.ts

+12
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,29 @@ const assignParams = (
4242

4343
export default class ConfirmedTransaction {
4444
timestamp: number;
45+
4546
value: BigNumber;
47+
4648
fee: BigNumber;
49+
4750
nid: BigNumber;
51+
4852
stepLimit: BigNumber;
53+
4954
nonce: BigNumber;
55+
5056
from: string;
57+
5158
to: string;
59+
5260
signature: string;
61+
5362
dataType: string;
63+
5464
data: unknown;
65+
5566
version: BigNumber;
67+
5668
txHash: string;
5769

5870
constructor(data) {

lib/data/Formatter/Failure.ts

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
export default class Failure {
1818
code: string;
19+
1920
message: string;
2021

2122
constructor(data) {

lib/data/Formatter/Transaction.ts

+2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ import { toNumber } from "../Converter";
2020

2121
export default class Transaction extends ConfirmedTransaction {
2222
txIndex: number;
23+
2324
blockHeight: number;
25+
2426
blockHash: string;
2527

2628
constructor(data) {

lib/data/Formatter/TransactionResult.ts

+12
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,29 @@ import Failure from "./Failure";
2222

2323
export default class TransactionResult {
2424
status: Hash;
25+
2526
to: string;
27+
2628
txHash: string;
29+
2730
txIndex: number;
31+
2832
blockHeight: number;
33+
2934
blockHash: string;
35+
3036
cumulativeStepUsed: BigNumber;
37+
3138
stepUsed: BigNumber;
39+
3240
stepPrice: BigNumber;
41+
3342
scoreAddress?: string;
43+
3444
eventLogs?: unknown;
45+
3546
logsBloom?: unknown;
47+
3648
failure?: Failure;
3749

3850
constructor(data) {

lib/transport/http/client/HttpCall.ts

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { RpcError } from "../../../Exception";
1919

2020
export default class HttpCall<T> {
2121
httpCall: HttpCall<T>;
22+
2223
// eslint-disable-next-line no-unused-vars
2324
converter?: (result: string) => T;
2425

lib/transport/http/client/HttpClient.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default class HttpClient {
3333
try {
3434
const response = await fetch(url, {
3535
method: "POST",
36-
body: body,
36+
body,
3737
});
3838

3939
if (response.ok) {

lib/transport/http/client/HttpRequest.ts

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
export default class HttpRequest {
1818
public url: string;
19+
1920
public body: string;
2021

2122
constructor(url: string, body: string) {

lib/transport/jsonrpc/Request.ts

+3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616

1717
export default class Request {
1818
jsonrpc: string;
19+
1920
id: number;
21+
2022
method: string;
23+
2124
params: any;
2225

2326
constructor(id: number, method: string, params: any) {

lib/transport/jsonrpc/Response.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { Exception } from "../../Exception";
1818

1919
export default class Response<T> {
2020
result: T;
21+
2122
error: Exception;
2223

2324
constructor(
@@ -31,7 +32,7 @@ export default class Response<T> {
3132
this.result =
3233
typeof converter === "function"
3334
? converter(result as string)
34-
: ((result as unknown) as T);
35+
: (result as unknown as T);
3536
}
3637

3738
if (error) {

0 commit comments

Comments
 (0)