Skip to content

Commit

Permalink
yet more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Jul 30, 2024
1 parent 177645e commit beaa077
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/block/test/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
import { RLP } from '@ethereumjs/rlp'
import { BIGINT_0, BIGINT_1, utf8ToBytes } from '@ethereumjs/util'
import { keccak256 } from 'ethereum-cryptography/keccak'
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/miner/pendingBlock.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Block, BlockHeader } from '@ethereumjs/block'
import { Common, Goerli, Hardfork, createCommonFromGethGenesis } from '@ethereumjs/common'
import { Common, Goerli, Hardfork, Mainnet, createCommonFromGethGenesis } from '@ethereumjs/common'
import { DefaultStateManager } from '@ethereumjs/statemanager'
import { create1559FeeMarketTx, create4844BlobTx, createLegacyTx } from '@ethereumjs/tx'
import {
Expand Down Expand Up @@ -78,7 +78,7 @@ const setup = () => {
shallowCopy: () => service.execution.vm,
setStateRoot: () => {},
blockchain: mockBlockchain({}),
common: new Common({ chain: 'mainnet' }),
common: new Common({ chain: Mainnet }),
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/rpc/eth/chainId.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Chain, Common, Goerli } from '@ethereumjs/common'
import { Common, Goerli } from '@ethereumjs/common'
import { assert, describe, it } from 'vitest'

import { baseSetup, createClient, createManager, getRpcClient, startRPC } from '../helpers.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/rpc/eth/getFeeHistory.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { paramsBlock } from '@ethereumjs/block'
import { Common, Chain as CommonChain, Hardfork, Mainnet } from '@ethereumjs/common'
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
import { createTxFromTxData } from '@ethereumjs/tx'
import {
BIGINT_0,
Expand Down
5 changes: 3 additions & 2 deletions packages/common/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export class Common {
(acc: number, hf: HardforkTransitionConfig) => Math.max(Number(hf.timestamp ?? '0'), acc),
0,
)
if (minTimeStamp > timestamp) {
if (BigInt(minTimeStamp) > timestamp) {
throw Error(`Maximum HF determined by timestamp is lower than the block number/ttd HF`)
}

Expand All @@ -266,7 +266,8 @@ export class Common {
Math.min(Number(hf.timestamp ?? timestamp), acc),
Number(timestamp),
)
if (maxTimeStamp < timestamp) {
console.log(minTimeStamp, maxTimeStamp, timestamp, blockNumber)
if (BigInt(maxTimeStamp) < timestamp) {
throw Error(`Maximum HF determined by block number/ttd is lower than timestamp HF`)
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vm/test/api/EIPs/eip-1559-FeeMarket.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createBlockFromBlockData } from '@ethereumjs/block'
import { Chain, Common, Hardfork, Mainnet } from '@ethereumjs/common'
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
import {
AccessListEIP2930Transaction,
FeeMarketEIP1559Transaction,
Expand Down

0 comments on commit beaa077

Please sign in to comment.