Skip to content

Commit 13276b1

Browse files
holgerd77acolytec3
andauthored
Client: Rename lib to src Folder (ethereumjs#2722)
* Client: rename lib -> src folder * Client: rename lib references to src * Fix Karma tests * fix linter and ts config --------- Co-authored-by: acolytec3 <[email protected]> Co-authored-by: acolytec3 <[email protected]>
1 parent c1b2973 commit 13276b1

File tree

194 files changed

+349
-349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+349
-349
lines changed

packages/block/test/eip4844block.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type { TypedTransaction } from '@ethereumjs/tx'
1919
// Hack to detect if running in browser or not
2020
const isBrowser = new Function('try {return this===window;}catch(e){ return false;}')
2121

22-
if (isBrowser() === false) initKZG(kzg, __dirname + '/../../client/lib/trustedSetups/devnet4.txt')
22+
if (isBrowser() === false) initKZG(kzg, __dirname + '/../../client/src/trustedSetups/devnet4.txt')
2323
const gethGenesis = require('./testdata/4844-hardfork.json')
2424
const common = Common.fromGethGenesis(gethGenesis, {
2525
chain: 'customChain',

packages/client/.c8rc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"extends": "../../config/.c8rc.json",
3-
"include": ["lib/**/*.ts"]
3+
"include": ["src/**/*.ts"]
44
}

packages/client/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
},
66
overrides: [
77
{
8-
files: ['bin/**.ts'],
8+
files: ['bin/**.ts', 'test/sim/**.ts'],
99
rules: {
1010
'no-console': 'off',
1111
},

packages/client/bin/cli.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ import * as readline from 'readline'
2424
import yargs from 'yargs'
2525
import { hideBin } from 'yargs/helpers'
2626

27-
import { EthereumClient } from '../lib/client'
28-
import { Config, DataDirectory, SyncMode } from '../lib/config'
29-
import { LevelDB } from '../lib/execution/level'
30-
import { getLogger } from '../lib/logging'
31-
import { Event } from '../lib/types'
32-
import { parseMultiaddrs } from '../lib/util'
27+
import { EthereumClient } from '../src/client'
28+
import { Config, DataDirectory, SyncMode } from '../src/config'
29+
import { LevelDB } from '../src/execution/level'
30+
import { getLogger } from '../src/logging'
31+
import { Event } from '../src/types'
32+
import { parseMultiaddrs } from '../src/util'
3333

3434
import { helprpc, startRPCServers } from './startRpc'
3535

36-
import type { Logger } from '../lib/logging'
37-
import type { FullEthereumService } from '../lib/service'
38-
import type { ClientOpts } from '../lib/types'
36+
import type { Logger } from '../src/logging'
37+
import type { FullEthereumService } from '../src/service'
38+
import type { ClientOpts } from '../src/types'
3939
import type { RPCArgs } from './startRpc'
4040
import type { BlockBytes } from '@ethereumjs/block'
4141
import type { GenesisState } from '@ethereumjs/blockchain'
@@ -658,7 +658,7 @@ async function run() {
658658

659659
// TODO sharding: Just initialize kzg library now, in future it can be optimized to be
660660
// loaded and initialized on the sharding hardfork activation
661-
initKZG(kzg, __dirname + '/../lib/trustedSetups/devnet4.txt')
661+
initKZG(kzg, __dirname + '/../src/trustedSetups/devnet4.txt')
662662
// Give network id precedence over network name
663663
const chain = args.networkId ?? args.network ?? Chain.Mainnet
664664

packages/client/bin/startRpc.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ import { hexStringToBytes, randomBytes } from '@ethereumjs/util'
22
import { bytesToHex } from 'ethereum-cryptography/utils'
33
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs'
44

5-
import { RPCManager, saveReceiptsMethods } from '../lib/rpc'
6-
import * as modules from '../lib/rpc/modules'
5+
import { RPCManager, saveReceiptsMethods } from '../src/rpc'
6+
import * as modules from '../src/rpc/modules'
77
import {
88
MethodConfig,
99
createRPCServer,
1010
createRPCServerListener,
1111
createWsRPCServerListener,
12-
} from '../lib/util'
12+
} from '../src/util'
1313

14-
import type { EthereumClient } from '../lib/client'
15-
import type { Config } from '../lib/config'
14+
import type { EthereumClient } from '../src/client'
15+
import type { Config } from '../src/config'
1616
import type { Server as RPCServer } from 'jayson/promise'
1717

1818
export type RPCArgs = {

packages/client/browser/index.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,48 @@ import { Chain, Common } from '@ethereumjs/common'
33
import debug from 'debug'
44
import { Level } from 'level'
55

6-
import { EthereumClient } from '../lib/client'
7-
import { Config } from '../lib/config'
8-
import { LevelDB } from '../lib/execution/level'
9-
import { parseMultiaddrs } from '../lib/util'
6+
import { EthereumClient } from '../src/client'
7+
import { Config } from '../src/config'
8+
import { LevelDB } from '../src/execution/level'
9+
import { parseMultiaddrs } from '../src/util'
1010

1111
import { getLogger } from './logging'
1212
// Blockchain
13-
export * from '../lib/blockchain/chain'
13+
export * from '../src/blockchain/chain'
1414

1515
// Peer
16-
export * from '../lib/net/peer/libp2ppeer'
17-
export * from '../lib/net/peer/peer'
16+
export * from '../src/net/peer/libp2ppeer'
17+
export * from '../src/net/peer/peer'
1818
export * from './libp2pnode'
1919

2020
// Peer Pool
21-
export * from '../lib/net/peerpool'
21+
export * from '../src/net/peerpool'
2222

2323
// Protocol
24-
export * from '../lib/net/protocol/ethprotocol'
25-
export * from '../lib/net/protocol/flowcontrol'
26-
export * from '../lib/net/protocol/lesprotocol'
27-
export * from '../lib/net/protocol/protocol'
24+
export * from '../src/net/protocol/ethprotocol'
25+
export * from '../src/net/protocol/flowcontrol'
26+
export * from '../src/net/protocol/lesprotocol'
27+
export * from '../src/net/protocol/protocol'
2828

2929
// Server
30-
export * from '../lib/net/server/libp2pserver'
31-
export * from '../lib/net/server/server'
30+
export * from '../src/net/server/libp2pserver'
31+
export * from '../src/net/server/server'
3232

3333
// EthereumClient
34-
export * from '../lib/client'
34+
export * from '../src/client'
3535

3636
// Service
37-
export * from '../lib/service/fullethereumservice'
38-
export * from '../lib/service/lightethereumservice'
39-
export * from '../lib/service/service'
37+
export * from '../src/service/fullethereumservice'
38+
export * from '../src/service/lightethereumservice'
39+
export * from '../src/service/service'
4040

4141
// Synchronizer
42-
export * from '../lib/sync/fullsync'
43-
export * from '../lib/sync/lightsync'
44-
export * from '../lib/sync/sync'
42+
export * from '../src/sync/fullsync'
43+
export * from '../src/sync/lightsync'
44+
export * from '../src/sync/sync'
4545

4646
// Utilities
47-
export * from '../lib/util/parse'
47+
export * from '../src/util/parse'
4848

4949
// Logging
5050
export * from './logging'

packages/client/browser/util/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { platform } from 'os'
66

77
import { version as packageVersion } from '../../package.json'
88

9-
export * from '../../lib/util/parse'
9+
export * from '../../src/util/parse'
1010

1111
export function short(bytes: Uint8Array | string): string {
1212
if (bytes === null || bytes === undefined || bytes === '') return ''

packages/client/devnets/4844-interop/tools/txGenerator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const input = process.argv[3] // text to generate blob from
2121
const genesisJson = require(process.argv[4]) // Genesis parameters
2222
const pkey = hexStringToBytes(process.argv[5]) // private key of tx sender as unprefixed hex string
2323

24-
initKZG(kzg, __dirname + '/../../../lib/trustedSetups/devnet4.txt')
24+
initKZG(kzg, __dirname + '/../../../src/trustedSetups/devnet4.txt')
2525

2626
const sender = Address.fromPrivateKey(pkey)
2727
const common = Common.fromGethGenesis(genesisJson, {

packages/client/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = function (config) {
22
config.set({
33
frameworks: ['karma-typescript', 'tap'],
44

5-
files: ['lib/**/*.ts', 'test/blockchain/chain.spec.ts'],
5+
files: ['src/**/*.ts', 'test/blockchain/chain.spec.ts'],
66

77
preprocessors: {
88
'**/*.ts': ['karma-typescript'],

packages/client/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
},
2121
"license": "MPL-2.0",
2222
"author": "Vinay Pulim ([email protected])",
23-
"main": "dist/lib/index.js",
23+
"main": "dist/src/index.js",
2424
"browser": "dist/bundle.js",
25-
"types": "dist/lib/index.d.ts",
25+
"types": "dist/src/index.d.ts",
2626
"bin": {
2727
"ethereumjs": "dist/bin/cli.js"
2828
},
@@ -31,7 +31,7 @@
3131
],
3232
"scripts": {
3333
"binWorkaround": "test -f dist/bin/cli.js || echo 'install fails if bin script does not exist (https://github.com/npm/cli/issues/2632), creating placeholder file at \"dist/bin/cli.js\"' && mkdir -p 'dist/bin' && touch dist/bin/cli.js",
34-
"build": "npm run build:common && mkdir -p ./lib/trustedSetup/ && cp -Rf ./lib/trustedSetups ./dist/lib/",
34+
"build": "npm run build:common && mkdir -p ./src/trustedSetup/ && cp -Rf ./src/trustedSetups ./dist/src/",
3535
"build:browser": "../../config/cli/ts-build.sh browser && npm run bundle && rm -rf dist.browser",
3636
"build:common": "../../config/cli/ts-build.sh",
3737
"bundle": "webpack",

0 commit comments

Comments
 (0)