Skip to content
This repository was archived by the owner on Dec 10, 2020. It is now read-only.

Commit f60865b

Browse files
committed
Lint lib/blockchain
1 parent 869bc16 commit f60865b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/blockchain/chain.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ const defaultOptions = {
1111
common: new Common('mainnet', 'chainstart'),
1212
}
1313

14+
function hexToBuffer(hexString: string): Buffer | string {
15+
if (typeof hexString === 'string' && hexString.startsWith('0x')) {
16+
return Buffer.from(hexString.slice(2), 'hex')
17+
}
18+
return hexString
19+
}
20+
1421
/**
1522
* Blockchain
1623
* @memberof module:blockchain
@@ -296,10 +303,3 @@ export class Chain extends events.EventEmitter {
296303
return await (this._getTd as Function)(hash)
297304
}
298305
}
299-
300-
function hexToBuffer(hexString: string): Buffer | string {
301-
if (typeof hexString === 'string' && hexString.startsWith('0x')) {
302-
return Buffer.from(hexString.slice(2), 'hex')
303-
}
304-
return hexString
305-
}

0 commit comments

Comments
 (0)