Ethereum Test Types package¶
Common definitions and types.
TestParameterGroup
dataclass
¶
Base class for grouping test parameters in a dataclass. Provides a generic repr method to generate clean test ids, including only non-default optional fields.
Source code in src/ethereum_test_types/helpers.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|
__repr__()
¶
Generates a repr string, intended to be used as a test id, based on the class name and the values of the non-default optional fields.
Source code in src/ethereum_test_types/helpers.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|
add_kzg_version(b_hashes, kzg_version)
¶
Adds the Kzg Version to each blob hash.
Source code in src/ethereum_test_types/helpers.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
ceiling_division(a, b)
¶
Calculates the ceil without using floating point. Used by many of the EVM's formulas
Source code in src/ethereum_test_types/helpers.py
21 22 23 24 25 26 |
|
compute_create2_address(address, salt, initcode)
¶
Compute address of the resulting contract created using the CREATE2
opcode.
Source code in src/ethereum_test_types/helpers.py
56 57 58 59 60 61 62 63 64 |
|
compute_create_address(*, address, nonce=None, salt=0, initcode=b'', opcode=Op.CREATE)
¶
Compute address of the resulting contract created using a transaction
or the CREATE
opcode.
Source code in src/ethereum_test_types/helpers.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
compute_eofcreate_address(address, salt, init_container)
¶
Compute address of the resulting contract created using the EOFCREATE
opcode.
Source code in src/ethereum_test_types/helpers.py
93 94 95 96 97 98 99 100 101 102 103 104 |
|
copy_opcode_cost(length)
¶
Calculates the cost of the COPY opcodes, assuming memory expansion from empty memory, based on the costs specified in the yellow paper: https://ethereum.github.io/yellowpaper/paper.pdf
Source code in src/ethereum_test_types/helpers.py
84 85 86 87 88 89 90 |
|
cost_memory_bytes(new_bytes, previous_bytes)
¶
Calculates the cost of memory expansion, based on the costs specified in the yellow paper: https://ethereum.github.io/yellowpaper/paper.pdf
Source code in src/ethereum_test_types/helpers.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
eip_2028_transaction_data_cost(data)
¶
Calculates the cost of a given data as part of a transaction, based on the costs specified in EIP-2028: https://eips.ethereum.org/EIPS/eip-2028
Source code in src/ethereum_test_types/helpers.py
107 108 109 110 111 112 113 114 115 116 117 118 |
|
EOA
¶
Bases: Address
An Externally Owned Account (EOA) is an account controlled by a private key.
The EOA is defined by its address and (optionally) by its corresponding private key.
Source code in src/ethereum_test_types/types.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
__new__(address=None, *, key=None, nonce=0)
¶
Init the EOA.
Source code in src/ethereum_test_types/types.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
get_nonce()
¶
Returns the current nonce of the EOA and increments it by one.
Source code in src/ethereum_test_types/types.py
116 117 118 119 120 121 122 |
|
copy()
¶
Returns a copy of the EOA.
Source code in src/ethereum_test_types/types.py
124 125 126 127 128 |
|
AccessList
¶
Bases: CamelModel
Access List for transactions.
Source code in src/ethereum_test_types/types.py
525 526 527 528 529 530 531 532 533 534 535 536 537 |
|
to_list()
¶
Returns the access list as a list of serializable elements.
Source code in src/ethereum_test_types/types.py
533 534 535 536 537 |
|
Account
¶
Bases: CamelModel
State associated with an address.
Source code in src/ethereum_test_base_types/composite_types.py
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 |
|
nonce: ZeroPaddedHexNumber = ZeroPaddedHexNumber(0)
class-attribute
instance-attribute
¶
The scalar value equal to a) the number of transactions sent by an Externally Owned Account, b) the amount of contracts created by a contract.
balance: ZeroPaddedHexNumber = ZeroPaddedHexNumber(0)
class-attribute
instance-attribute
¶
The amount of Wei (10-18 Eth) the account has.
code: Bytes = Bytes(b'')
class-attribute
instance-attribute
¶
Bytecode contained by the account.
storage: Storage = Field(default_factory=Storage)
class-attribute
instance-attribute
¶
Storage within a contract.
NONEXISTENT: None = None
class-attribute
¶
Sentinel object used to specify when an account should not exist in the state.
NonceMismatch
dataclass
¶
Bases: Exception
Test expected a certain nonce value for an account but a different value was found.
Source code in src/ethereum_test_base_types/composite_types.py
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
313 314 315 316 317 318 319 320 321 |
|
BalanceMismatch
dataclass
¶
Bases: Exception
Test expected a certain balance for an account but a different value was found.
Source code in src/ethereum_test_base_types/composite_types.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
340 341 342 343 344 345 346 347 348 |
|
CodeMismatch
dataclass
¶
Bases: Exception
Test expected a certain bytecode for an account but a different one was found.
Source code in src/ethereum_test_base_types/composite_types.py
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
367 368 369 370 371 372 373 374 375 |
|
check_alloc(address, account)
¶
Checks the returned alloc against an expected account in post state. Raises exception on failure.
Source code in src/ethereum_test_base_types/composite_types.py
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
|
__bool__()
¶
Returns True on a non-empty account.
Source code in src/ethereum_test_base_types/composite_types.py
409 410 411 412 413 |
|
with_code(code)
classmethod
¶
Create account with provided code
and nonce of 1
.
Source code in src/ethereum_test_base_types/composite_types.py
415 416 417 418 419 420 |
|
merge(account_1, account_2)
classmethod
¶
Create a merged account from two sources.
Source code in src/ethereum_test_base_types/composite_types.py
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 |
|
Alloc
¶
Bases: Alloc
Allocation of accounts in the state, pre and post test execution.
Source code in src/ethereum_test_types/types.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
|
UnexpectedAccount
dataclass
¶
Bases: Exception
Unexpected account found in the allocation.
Source code in src/ethereum_test_types/types.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_types/types.py
152 153 154 |
|
MissingAccount
dataclass
¶
Bases: Exception
Expected account not found in the allocation.
Source code in src/ethereum_test_types/types.py
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_types/types.py
168 169 170 |
|
merge(alloc_1, alloc_2)
classmethod
¶
Returns the merged allocation of two sources.
Source code in src/ethereum_test_types/types.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
|
__iter__()
¶
Returns an iterator over the allocation.
Source code in src/ethereum_test_types/types.py
188 189 190 191 192 |
|
items()
¶
Returns an iterator over the allocation items.
Source code in src/ethereum_test_types/types.py
194 195 196 197 198 |
|
__getitem__(address)
¶
Returns the account associated with an address.
Source code in src/ethereum_test_types/types.py
200 201 202 203 204 205 206 207 208 |
|
__setitem__(address, account)
¶
Sets the account associated with an address.
Source code in src/ethereum_test_types/types.py
210 211 212 213 214 215 216 217 218 |
|
__delitem__(address)
¶
Deletes the account associated with an address.
Source code in src/ethereum_test_types/types.py
220 221 222 223 224 225 226 |
|
__eq__(other)
¶
Returns True if both allocations are equal.
Source code in src/ethereum_test_types/types.py
228 229 230 231 232 233 234 |
|
__contains__(address)
¶
Checks if an account is in the allocation.
Source code in src/ethereum_test_types/types.py
236 237 238 239 240 241 242 |
|
empty_accounts()
¶
Returns a list of addresses of empty accounts.
Source code in src/ethereum_test_types/types.py
244 245 246 247 248 |
|
state_root()
¶
Returns the state root of the allocation.
Source code in src/ethereum_test_types/types.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
|
verify_post_alloc(got_alloc)
¶
Verify that the allocation matches the expected post in the test. Raises exception on unexpected values.
Source code in src/ethereum_test_types/types.py
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
|
deploy_contract(code, *, storage={}, balance=0, nonce=1, address=None, evm_code_type=None, label=None)
¶
Deploy a contract to the allocation.
Source code in src/ethereum_test_types/types.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
|
fund_eoa(amount=None, label=None, storage=None, delegation=None)
¶
Add a previously unused EOA to the pre-alloc with the balance specified by amount
.
Source code in src/ethereum_test_types/types.py
319 320 321 322 323 324 325 326 327 328 329 |
|
fund_address(address, amount)
¶
Fund an address with a given amount.
If the address is already present in the pre-alloc the amount will be added to its existing balance.
Source code in src/ethereum_test_types/types.py
331 332 333 334 335 336 337 338 |
|
AuthorizationTuple
¶
Bases: AuthorizationTupleGeneric[HexNumber]
Authorization tuple for transactions.
Source code in src/ethereum_test_types/types.py
598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 |
|
model_post_init(__context)
¶
Automatically signs the authorization tuple if a secret key or sender are provided.
Source code in src/ethereum_test_types/types.py
606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 |
|
sign(private_key)
¶
Signs the authorization tuple with a private key.
Source code in src/ethereum_test_types/types.py
641 642 643 644 645 646 647 648 649 |
|
CamelModel
¶
Bases: CopyValidateModel
A base model that converts field names to camel case when serializing.
For example, the field name current_timestamp
in a Python model will be represented
as currentTimestamp
when it is serialized to json.
Source code in src/ethereum_test_base_types/pydantic.py
25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
ConsolidationRequest
¶
Bases: ConsolidationRequestGeneric[HexNumber]
Consolidation Request type
Source code in src/ethereum_test_types/types.py
1327 1328 1329 1330 1331 1332 |
|
DepositRequest
¶
Bases: DepositRequestGeneric[HexNumber]
Deposit Request type
Source code in src/ethereum_test_types/types.py
1255 1256 1257 1258 1259 1260 |
|
Environment
¶
Bases: EnvironmentGeneric[Number]
Structure used to keep track of the context in which a block must be executed.
Source code in src/ethereum_test_types/types.py
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 |
|
parent_hash: Hash | None
cached
property
¶
Obtains the latest hash according to the highest block number in
block_hashes
.
set_fork_requirements(fork)
¶
Fills the required fields in an environment depending on the fork.
Source code in src/ethereum_test_types/types.py
459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 |
|
Removable
¶
Sentinel class to detect if a parameter should be removed.
(None
normally means "do not modify")
Source code in src/ethereum_test_types/types.py
72 73 74 75 76 77 78 |
|
Requests
¶
Bases: RootModel[List[DepositRequest | WithdrawalRequest | ConsolidationRequest]]
Requests for the transition tool.
Source code in src/ethereum_test_types/types.py
1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 |
|
to_serializable_list()
¶
Returns the requests as a list of serializable elements.
Source code in src/ethereum_test_types/types.py
1346 1347 1348 1349 1350 1351 1352 |
|
trie_root: Hash
cached
property
¶
Returns the root hash of the requests.
deposit_requests()
¶
Returns the list of deposit requests.
Source code in src/ethereum_test_types/types.py
1367 1368 1369 1370 1371 |
|
withdrawal_requests()
¶
Returns the list of withdrawal requests.
Source code in src/ethereum_test_types/types.py
1373 1374 1375 1376 1377 |
|
consolidation_requests()
¶
Returns the list of consolidation requests.
Source code in src/ethereum_test_types/types.py
1379 1380 1381 1382 1383 |
|
Storage
¶
Bases: RootModel[Dict[StorageKeyValueType, StorageKeyValueType]]
Definition of a storage in pre or post state of a test
Source code in src/ethereum_test_base_types/composite_types.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
|
StorageDictType: TypeAlias = Dict[str | int | bytes | SupportsBytes, str | int | bytes | SupportsBytes]
class-attribute
¶
Dictionary type to be used when defining an input to initialize a storage.
InvalidType
dataclass
¶
Bases: Exception
Invalid type used when describing test's expected storage key or value.
Source code in src/ethereum_test_base_types/composite_types.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
47 48 49 |
|
InvalidValue
dataclass
¶
Bases: Exception
Invalid value used when describing test's expected storage key or value.
Source code in src/ethereum_test_base_types/composite_types.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
64 65 66 |
|
MissingKey
dataclass
¶
Bases: Exception
Test expected to find a storage key set but key was missing.
Source code in src/ethereum_test_base_types/composite_types.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
80 81 82 |
|
KeyValueMismatch
dataclass
¶
Bases: Exception
Test expected a certain value in a storage key but value found was different.
Source code in src/ethereum_test_base_types/composite_types.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
103 104 105 106 107 108 109 110 111 112 113 |
|
__contains__(key)
¶
Checks for an item in the storage
Source code in src/ethereum_test_base_types/composite_types.py
115 116 117 |
|
__getitem__(key)
¶
Returns an item from the storage
Source code in src/ethereum_test_base_types/composite_types.py
119 120 121 122 123 |
|
__setitem__(key, value)
¶
Sets an item in the storage
Source code in src/ethereum_test_base_types/composite_types.py
125 126 127 128 129 130 131 132 133 |
|
__delitem__(key)
¶
Deletes an item from the storage
Source code in src/ethereum_test_base_types/composite_types.py
135 136 137 |
|
__iter__()
¶
Returns an iterator over the storage
Source code in src/ethereum_test_base_types/composite_types.py
139 140 141 |
|
__eq__(other)
¶
Returns True if both storages are equal.
Source code in src/ethereum_test_base_types/composite_types.py
143 144 145 146 147 148 149 |
|
__ne__(other)
¶
Returns True if both storages are not equal.
Source code in src/ethereum_test_base_types/composite_types.py
151 152 153 154 155 156 157 |
|
__bool__()
¶
Returns True if the storage is not empty
Source code in src/ethereum_test_base_types/composite_types.py
159 160 161 |
|
__add__(other)
¶
Returns a new storage that is the sum of two storages.
Source code in src/ethereum_test_base_types/composite_types.py
163 164 165 166 167 |
|
keys()
¶
Returns the keys of the storage
Source code in src/ethereum_test_base_types/composite_types.py
169 170 171 |
|
set_next_slot(slot)
¶
Sets the next slot to be used by store_next
.
Source code in src/ethereum_test_base_types/composite_types.py
173 174 175 176 177 178 |
|
items()
¶
Returns the items of the storage
Source code in src/ethereum_test_base_types/composite_types.py
180 181 182 |
|
store_next(value)
¶
Stores a value in the storage and returns the key where the value is stored.
Increments the key counter so the next time this function is called, the next key is used.
Source code in src/ethereum_test_base_types/composite_types.py
184 185 186 187 188 189 190 191 192 193 194 195 196 |
|
peek_slot()
¶
Peeks the next slot that will be used by store_next
.
Source code in src/ethereum_test_base_types/composite_types.py
198 199 200 201 202 |
|
contains(other)
¶
Returns True if self contains all keys with equal value as contained by second storage. Used for comparison with test expected post state and alloc returned by the transition tool.
Source code in src/ethereum_test_base_types/composite_types.py
204 205 206 207 208 209 210 211 212 213 214 215 216 |
|
must_contain(address, other)
¶
Succeeds only if self contains all keys with equal value as contained by second storage. Used for comparison with test expected post state and alloc returned by the transition tool. Raises detailed exception when a difference is found.
Source code in src/ethereum_test_base_types/composite_types.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
|
must_be_equal(address, other)
¶
Succeeds only if "self" is equal to "other" storage.
Source code in src/ethereum_test_base_types/composite_types.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
|
canary()
¶
Returns a canary storage filled with non-zero values where the current storage expects zero values, to guarantee that the test overwrites the storage.
Source code in src/ethereum_test_base_types/composite_types.py
258 259 260 261 262 263 |
|
Transaction
¶
Bases: TransactionGeneric[HexNumber]
, TransactionTransitionToolConverter
Generic object that can represent all Ethereum transaction types.
Source code in src/ethereum_test_types/types.py
747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 |
|
InvalidFeePayment
¶
Bases: Exception
Transaction described more than one fee payment type.
Source code in src/ethereum_test_types/types.py
773 774 775 776 777 778 779 780 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_types/types.py
778 779 780 |
|
InvalidSignaturePrivateKey
¶
Bases: Exception
Transaction describes both the signature and private key of source account.
Source code in src/ethereum_test_types/types.py
782 783 784 785 786 787 788 789 790 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_types/types.py
788 789 790 |
|
model_post_init(__context)
¶
Ensures the transaction has no conflicting properties.
Source code in src/ethereum_test_types/types.py
792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 |
|
with_error(error)
¶
Create a copy of the transaction with an added error.
Source code in src/ethereum_test_types/types.py
870 871 872 873 874 875 876 |
|
with_nonce(nonce)
¶
Create a copy of the transaction with a modified nonce.
Source code in src/ethereum_test_types/types.py
878 879 880 881 882 |
|
with_signature_and_sender(*, keep_secret_key=False)
¶
Returns a signed version of the transaction using the private key.
Source code in src/ethereum_test_types/types.py
884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 |
|
signing_envelope: List[Any]
cached
property
¶
Returns the list of values included in the envelope used for signing.
payload_body: List[Any]
cached
property
¶
Returns the list of values included in the transaction body.
rlp: Bytes
cached
property
¶
Returns bytes of the serialized representation of the transaction, which is almost always RLP encoding.
hash: Hash
cached
property
¶
Returns hash of the transaction.
signing_bytes: Bytes
cached
property
¶
Returns the serialized bytes of the transaction used for signing.
signature_bytes: Bytes
cached
property
¶
Returns the serialized bytes of the transaction signature.
serializable_list: Any
cached
property
¶
Returns the list of values included in the transaction as a serializable object.
list_root(input_txs)
staticmethod
¶
Returns the transactions root of a list of transactions.
Source code in src/ethereum_test_types/types.py
1166 1167 1168 1169 1170 1171 1172 1173 1174 |
|
list_blob_versioned_hashes(input_txs)
staticmethod
¶
Gets a list of ordered blob versioned hashes from a list of transactions.
Source code in src/ethereum_test_types/types.py
1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 |
|
created_contract: Address
cached
property
¶
Returns the address of the contract created by the transaction.
TransactionDefaults
dataclass
¶
Default values for transactions.
Source code in src/ethereum_test_types/types.py
652 653 654 655 656 657 658 659 660 661 |
|
Withdrawal
¶
Bases: WithdrawalGeneric[HexNumber]
Withdrawal type
Source code in src/ethereum_test_types/types.py
374 375 376 377 378 379 |
|
WithdrawalRequest
¶
Bases: WithdrawalRequestGeneric[HexNumber]
Withdrawal Request type
Source code in src/ethereum_test_types/types.py
1291 1292 1293 1294 1295 1296 |
|
keccak256(data)
¶
Calculates the keccak256 hash of the given data.
Source code in src/ethereum_test_types/types.py
54 55 56 57 58 |
|
VerkleTree
¶
Bases: RootModel[Dict[Hash, Hash]]
Definition of a Verkle Tree.
A Verkle Tree is a data structure used to efficiently prove the membership or non-membership of elements in a state. This class represents the Verkle Tree as a dictionary, where each key and value is a Hash (32 bytes). The root attribute holds this dictionary, providing a mapping of the tree's key/values.
Source code in src/ethereum_test_types/verkle/types.py
149 150 151 152 153 154 155 156 157 158 159 |
|
Witness
¶
Bases: CamelModel
Definition of an Execution Witness.
Contains all the necessary data to verify the correctness of a blockchain state transition. This includes the state differences indicating changes in the Verkle tree, the Verkle proof for proving element membership or non-membership, and the parent state root which provides the root hash of the state tree before the current block execution.
Source code in src/ethereum_test_types/verkle/types.py
134 135 136 137 138 139 140 141 142 143 144 145 |
|
WitnessCheck
¶
Definition of a Witness Check.
Used as an intermediary class to store all the necessary items required to check during the filling process of a blockchain test.
Source code in src/ethereum_test_types/verkle/types.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
|
AccountHeaderEntry
¶
Bases: Enum
Represents all the data entries in an account header.
Source code in src/ethereum_test_types/verkle/types.py
172 173 174 175 176 177 178 |
|
__init__(fork)
¶
Initializes a WitnessCheck instance.
Source code in src/ethereum_test_types/verkle/types.py
180 181 182 183 184 185 186 187 188 189 190 191 |
|
__repr__()
¶
Provides a detailed string representation of the WitnessCheck object for debugging.
Source code in src/ethereum_test_types/verkle/types.py
193 194 195 196 197 198 199 200 201 202 203 |
|
add_account_full(address, account)
¶
Adds the address, nonce, balance, and code. Delays actual key computation until later.
Source code in src/ethereum_test_types/verkle/types.py
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
|
add_account_basic_data(address, account)
¶
Adds the basic data witness for the given address.
Source code in src/ethereum_test_types/verkle/types.py
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
|
add_account_codehash(address, codehash)
¶
Adds the code hash witness for the given address.
Source code in src/ethereum_test_types/verkle/types.py
258 259 260 261 262 263 264 |
|
add_storage_slot(address, storage_slot, value)
¶
Adds the storage slot witness for the given address and storage slot.
Source code in src/ethereum_test_types/verkle/types.py
266 267 268 269 270 271 272 |
|
add_code_chunk(address, chunk_number, value)
¶
Adds the code chunk witness for the given address and chunk number.
Source code in src/ethereum_test_types/verkle/types.py
274 275 276 277 278 279 280 |
|