This repository was archived by the owner on Dec 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 11import { middleware , validators } from '../validation'
22import { addHexPrefix , keccak , toBuffer } from 'ethereumjs-util'
33import { platform } from 'os'
4+ import { getClientVersion } from '../../util'
45
56/**
67 * web3_* RPC module
@@ -29,9 +30,7 @@ export class Web3 {
2930 * client version as the second argument
3031 */
3132 clientVersion ( _params = [ ] , cb : ( err : null , version : string ) => void ) {
32- const packageVersion = require ( '../../../package.json' ) . version
33- const { version } = process
34- const ethJsVersion = `EthereumJS/${ packageVersion } /${ platform ( ) } /node${ version . substring ( 1 ) } `
33+ const ethJsVersion = getClientVersion ( )
3534 cb ( null , ethJsVersion )
3635 }
3736
Original file line number Diff line number Diff line change 11/**
22 * @module util
33 */
4+ import { platform } from 'os'
5+ import { version as packageVersion } from '../../package.json'
46
57export * from './parse'
68
79export function short ( buffer : Buffer ) : string {
810 return buffer . toString ( 'hex' ) . slice ( 0 , 8 ) + '...'
911}
12+
13+ export function getClientVersion ( ) {
14+ const { version } = process
15+ return `EthereumJS/${ packageVersion } /${ platform ( ) } /node${ version . substring ( 1 ) } `
16+ }
You can’t perform that action at this time.
0 commit comments