ethereumjs / ethereumjs-monorepo

Compare 3712a1b ... +0 ... 34f3dcd

Coverage Reach
client/lib/sync/fetcher/fetcher.ts client/lib/sync/fetcher/blockfetcherbase.ts client/lib/sync/fetcher/blockfetcher.ts client/lib/sync/fetcher/headerfetcher.ts client/lib/sync/fetcher/reverseblockfetcher.ts client/lib/sync/fetcher/types.ts client/lib/sync/fetcher/index.ts client/lib/sync/skeleton.ts client/lib/sync/fullsync.ts client/lib/sync/beaconsync.ts client/lib/sync/sync.ts client/lib/sync/lightsync.ts client/lib/sync/snapsync.ts client/lib/sync/index.ts client/lib/net/protocol/ethprotocol.ts client/lib/net/protocol/snapprotocol.ts client/lib/net/protocol/lesprotocol.ts client/lib/net/protocol/boundprotocol.ts client/lib/net/protocol/protocol.ts client/lib/net/protocol/flowcontrol.ts client/lib/net/protocol/libp2psender.ts client/lib/net/protocol/rlpxsender.ts client/lib/net/protocol/sender.ts client/lib/net/protocol/index.ts client/lib/net/server/rlpxserver.ts client/lib/net/server/libp2pserver.ts client/lib/net/server/server.ts client/lib/net/server/index.ts client/lib/net/peer/rlpxpeer.ts client/lib/net/peer/peer.ts client/lib/net/peer/libp2ppeer.ts client/lib/net/peer/libp2pnode.ts client/lib/net/peer/index.ts client/lib/net/peerpool.ts client/lib/rpc/modules/eth.ts client/lib/rpc/modules/engine.ts client/lib/rpc/modules/admin.ts client/lib/rpc/modules/net.ts client/lib/rpc/modules/web3.ts client/lib/rpc/modules/index.ts client/lib/rpc/validation.ts client/lib/rpc/util/CLConnectionManager.ts client/lib/rpc/index.ts client/lib/rpc/types.ts client/lib/rpc/error-code.ts client/lib/service/txpool.ts client/lib/service/fullethereumservice.ts client/lib/service/service.ts client/lib/service/ethereumservice.ts client/lib/service/lightethereumservice.ts client/lib/service/index.ts client/lib/execution/vmexecution.ts client/lib/execution/receipt.ts client/lib/execution/level.ts client/lib/execution/execution.ts client/lib/execution/index.ts client/lib/miner/miner.ts client/lib/miner/pendingBlock.ts client/lib/miner/index.ts client/lib/util/rpc.ts client/lib/util/parse.ts client/lib/util/metaDBManager.ts client/lib/util/debug.ts client/lib/util/index.ts client/lib/config.ts client/lib/blockchain/chain.ts client/lib/blockchain/index.ts client/lib/client.ts client/lib/logging.ts client/lib/types.ts client/lib/index.ts evm/src/opcodes/functions.ts evm/src/opcodes/gas.ts evm/src/opcodes/codes.ts evm/src/opcodes/util.ts evm/src/opcodes/EIP2929.ts evm/src/opcodes/EIP2200.ts evm/src/opcodes/EIP1283.ts evm/src/opcodes/index.ts evm/src/precompiles/util/bls12_381.ts evm/src/precompiles/09-blake2f.ts evm/src/precompiles/index.ts evm/src/precompiles/05-modexp.ts evm/src/precompiles/10-bls12-pairing.ts evm/src/precompiles/0c-bls12-g1multiexp.ts evm/src/precompiles/0f-bls12-g2multiexp.ts evm/src/precompiles/0d-bls12-g2add.ts evm/src/precompiles/0e-bls12-g2mul.ts evm/src/precompiles/0b-bls12-g1mul.ts evm/src/precompiles/0a-bls12-g1add.ts evm/src/precompiles/12-bls12-map-fp2-to-g2.ts evm/src/precompiles/01-ecrecover.ts evm/src/precompiles/11-bls12-map-fp-to-g1.ts evm/src/precompiles/08-ecpairing.ts evm/src/precompiles/06-ecadd.ts evm/src/precompiles/07-ecmul.ts evm/src/precompiles/03-ripemd160.ts evm/src/precompiles/02-sha256.ts evm/src/precompiles/04-identity.ts evm/src/precompiles/types.ts evm/src/evm.ts evm/src/interpreter.ts evm/src/transientStorage.ts evm/src/stack.ts evm/src/message.ts evm/src/eof.ts evm/src/memory.ts evm/src/exceptions.ts devp2p/src/rlpx/peer.ts devp2p/src/rlpx/ecies.ts devp2p/src/rlpx/rlpx.ts devp2p/src/rlpx/mac.ts devp2p/src/rlpx/index.ts devp2p/src/protocol/eth.ts devp2p/src/protocol/les.ts devp2p/src/protocol/protocol.ts devp2p/src/protocol/snap.ts devp2p/src/protocol/index.ts devp2p/src/dpt/dpt.ts devp2p/src/dpt/server.ts devp2p/src/dpt/message.ts devp2p/src/dpt/kbucket.ts devp2p/src/dpt/ban-list.ts devp2p/src/dpt/index.ts devp2p/src/dns/dns.ts devp2p/src/dns/enr.ts devp2p/src/dns/index.ts devp2p/src/browser/dns.ts blockchain/src/blockchain.ts blockchain/src/consensus/clique.ts blockchain/src/consensus/ethash.ts blockchain/src/consensus/interface.ts blockchain/src/consensus/casper.ts blockchain/src/consensus/index.ts blockchain/src/db/manager.ts blockchain/src/db/operation.ts blockchain/src/db/helpers.ts blockchain/src/db/constants.ts blockchain/src/db/cache.ts blockchain/src/genesisStates/index.ts blockchain/src/lock.ts trie/src/trie/trie.ts trie/src/trie/node/branch.ts trie/src/trie/node/node.ts trie/src/trie/node/util.ts trie/src/trie/node/extension.ts trie/src/trie/node/leaf.ts trie/src/trie/node/index.ts trie/src/trie/index.ts trie/src/proof/range.ts trie/src/proof/index.ts trie/src/util/walkController.ts trie/src/util/nibbles.ts trie/src/util/readStream.ts trie/src/util/tasks.ts trie/src/util/hex.ts trie/src/util/lock.ts trie/src/util/index.ts trie/src/db/checkpoint.ts trie/src/db/map.ts trie/src/db/index.ts vm/src/eei/vmState.ts vm/src/eei/eei.ts vm/src/runTx.ts vm/src/runBlock.ts vm/src/vm.ts vm/src/buildBlock.ts vm/src/bloom/index.ts tx/src/baseTransaction.ts tx/src/eip1559Transaction.ts tx/src/legacyTransaction.ts tx/src/eip2930Transaction.ts tx/src/transactionFactory.ts util/src/bytes.ts util/src/account.ts util/src/internal.ts util/src/signature.ts util/src/address.ts util/src/constants.ts block/src/header.ts block/src/block.ts block/src/from-rpc.ts block/src/header-from-rpc.ts block/src/clique.ts common/src/common.ts common/src/enums.ts common/src/eips/index.ts common/src/hardforks/index.ts statemanager/src/stateManager.ts statemanager/src/cache.ts statemanager/src/baseStateManager.ts statemanager/src/interface.ts

Flags

Flags have been temporarily removed from this view while the flagging feature is refactored for better performance and user experience.

You can still use flags when viewing individual files. Flag-level thresholds will also remain on pull and merge requests in your repository provider.

More information can be found in our documentation.


@@ -1,35 +1,30 @@
Loading
1 1
import { TransactionFactory } from '@ethereumjs/tx'
2 -
import { setLengthLeft, toBuffer } from '@ethereumjs/util'
2 +
import { TypeOutput, setLengthLeft, toBuffer, toType } from '@ethereumjs/util'
3 3
4 4
import { blockHeaderFromRpc } from './header-from-rpc'
5 -
import { numberToHex } from './helpers'
6 5
7 6
import { Block } from './index'
8 7
9 8
import type { BlockOptions, JsonRpcBlock } from './index'
10 9
import type { TxData, TypedTransaction } from '@ethereumjs/tx'
11 10
12 -
function normalizeTxParams(_txParams: any) {
11 +
export function normalizeTxParams(_txParams: any) {
13 12
  const txParams = Object.assign({}, _txParams)
14 13
15 -
  txParams.gasLimit = txParams.gasLimit === undefined ? txParams.gas : txParams.gasLimit
14 +
  txParams.gasLimit = toType(txParams.gasLimit ?? txParams.gas, TypeOutput.BigInt)
16 15
  txParams.data = txParams.data === undefined ? txParams.input : txParams.data
17 16
18 17
  // check and convert gasPrice and value params
19 -
  txParams.gasPrice = numberToHex(txParams.gasPrice)
20 -
  txParams.value = numberToHex(txParams.value)
18 +
  txParams.gasPrice = txParams.gasPrice !== undefined ? BigInt(txParams.gasPrice) : undefined
19 +
  txParams.value = txParams.value !== undefined ? BigInt(txParams.value) : undefined
21 20
22 21
  // strict byte length checking
23 22
  txParams.to =
24 23
    txParams.to !== null && txParams.to !== undefined
25 24
      ? setLengthLeft(toBuffer(txParams.to), 20)
26 25
      : null
27 26
28 -
  // v as raw signature value {0,1}
29 -
  // v is the recovery bit and can be either {0,1} or {27,28}.
30 -
  // https://ethereum.stackexchange.com/questions/40679/why-the-value-of-v-is-always-either-27-11011-or-28-11100
31 -
  const v: number = txParams.v
32 -
  txParams.v = v < 27 ? v + 27 : v
27 +
  txParams.v = toType(txParams.v, TypeOutput.BigInt)
33 28
34 29
  return txParams
35 30
}
@@ -50,7 +45,7 @@
Loading
50 45
51 46
  const transactions: TypedTransaction[] = []
52 47
  const opts = { common: header._common }
53 -
  for (const _txParams of blockParams.transactions) {
48 +
  for (const _txParams of blockParams.transactions ?? []) {
54 49
    const txParams = normalizeTxParams(_txParams)
55 50
    const tx = TransactionFactory.fromTxData(txParams as TxData, opts)
56 51
    transactions.push(tx)

Learn more Showing 20 files with coverage changes found.

New file packages/devp2p/src/browser/dns.ts
New
Loading file...
New file packages/devp2p/src/dns/enr.ts
New
Loading file...
New file packages/devp2p/src/protocol/index.ts
New
Loading file...
New file packages/devp2p/src/rlpx/rlpx.ts
New
Loading file...
New file packages/devp2p/src/rlpx/mac.ts
New
Loading file...
New file packages/devp2p/src/rlpx/ecies.ts
New
Loading file...
New file packages/devp2p/src/dpt/index.ts
New
Loading file...
New file packages/devp2p/src/dpt/ban-list.ts
New
Loading file...
New file packages/devp2p/src/protocol/snap.ts
New
Loading file...
New file packages/devp2p/src/rlpx/index.ts
New
Loading file...
New file packages/devp2p/src/dpt/message.ts
New
Loading file...
New file packages/devp2p/src/dns/index.ts
New
Loading file...
New file packages/devp2p/src/protocol/les.ts
New
Loading file...
New file packages/devp2p/src/dpt/kbucket.ts
New
Loading file...
New file packages/devp2p/src/rlpx/peer.ts
New
Loading file...
New file packages/devp2p/src/dpt/server.ts
New
Loading file...
New file packages/devp2p/src/protocol/eth.ts
New
Loading file...
New file packages/devp2p/src/dns/dns.ts
New
Loading file...
New file packages/devp2p/src/protocol/protocol.ts
New
Loading file...
New file packages/devp2p/src/dpt/dpt.ts
New
Loading file...
Files Coverage
packages 0.53% 87.60%
Project Totals (192 files) 87.60%
Loading