Skip to content

Commit

Permalink
unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
winsvega committed Dec 19, 2024
1 parent 9ceacff commit 972d8c7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
40 changes: 20 additions & 20 deletions src/ethereum_test_types/tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,9 @@ def test_account_merge(
Environment(),
{
"currentCoinbase": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentGasLimit": "100000000000000000",
"currentNumber": "1",
"currentTimestamp": "1000",
"currentGasLimit": "0x16345785d8a0000",
"currentNumber": "0x1",
"currentTimestamp": "0x3e8",
"blockHashes": {},
"ommers": [],
"parentUncleHash": (
Expand Down Expand Up @@ -487,17 +487,17 @@ def test_account_merge(
),
{
"currentCoinbase": "0x0000000000000000000000000000000000001234",
"currentGasLimit": "100000000000000000",
"currentNumber": "1",
"currentTimestamp": "1000",
"currentDifficulty": "5",
"currentRandom": "6",
"currentBaseFee": "7",
"parentDifficulty": "8",
"parentTimestamp": "9",
"parentBaseFee": "10",
"parentGasUsed": "11",
"parentGasLimit": "12",
"currentGasLimit": "0x16345785d8a0000",
"currentNumber": "0x1",
"currentTimestamp": "0x3e8",
"currentDifficulty": "0x5",
"currentRandom": "0x6",
"currentBaseFee": "0x7",
"parentDifficulty": "0x8",
"parentTimestamp": "0x9",
"parentBaseFee": "0xa",
"parentGasUsed": "0xb",
"parentGasLimit": "0xc",
"parentUncleHash": (
"0x000000000000000000000000000000000000000000000000000000000000000d"
),
Expand All @@ -509,13 +509,13 @@ def test_account_merge(
"amount": "0x2",
},
],
"parentBlobGasUsed": "14",
"parentExcessBlobGas": "15",
"currentBlobGasUsed": "16",
"currentExcessBlobGas": "17",
"parentBlobGasUsed": "0xe",
"parentExcessBlobGas": "0xf",
"currentBlobGasUsed": "0x10",
"currentExcessBlobGas": "0x11",
"blockHashes": {
"1": "0x0000000000000000000000000000000000000000000000000000000000000002",
"3": "0x0000000000000000000000000000000000000000000000000000000000000004",
"0x1": "0x0000000000000000000000000000000000000000000000000000000000000002",
"0x3": "0x0000000000000000000000000000000000000000000000000000000000000004",
},
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000004",
"ommers": [],
Expand Down
8 changes: 4 additions & 4 deletions src/ethereum_test_types/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,13 @@ class Environment(EnvironmentGeneric[HexNumber]):
must be executed.
"""

blob_gas_used: Number | None = Field(None, alias="currentBlobGasUsed")
blob_gas_used: HexNumber | None = Field(None, alias="currentBlobGasUsed")
parent_ommers_hash: Hash = Field(Hash(EmptyOmmersRoot), alias="parentUncleHash")
parent_blob_gas_used: Number | None = Field(None)
parent_excess_blob_gas: Number | None = Field(None)
parent_blob_gas_used: HexNumber | None = Field(None)
parent_excess_blob_gas: HexNumber | None = Field(None)
parent_beacon_block_root: Hash | None = Field(None)

block_hashes: Dict[Number, Hash] = Field(default_factory=dict)
block_hashes: Dict[HexNumber, Hash] = Field(default_factory=dict)
ommers: List[Hash] = Field(default_factory=list)
withdrawals: List[Withdrawal] | None = Field(None)
extra_data: Bytes = Field(Bytes(b"\x00"), exclude=True)
Expand Down

0 comments on commit 972d8c7

Please sign in to comment.