Ethereum Test Types package¶
Common definitions and types.
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 packages/testing/src/execution_testing/test_types/account_types.py
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 | |
__new__(address=None, *, key=None, nonce=0)
¶
Init the EOA.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
get_nonce()
¶
Return current nonce of the EOA and increments it by one.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
152 153 154 155 156 | |
copy()
¶
Return copy of the EOA.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
158 159 160 | |
Alloc
¶
Bases: Alloc
Allocation of accounts in the state, pre and post test execution.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
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 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 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 | |
UnexpectedAccountError
dataclass
¶
Bases: Exception
Unexpected account found in the allocation.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
166 167 168 169 170 171 172 173 174 175 176 177 178 | |
__str__()
¶
Print exception string.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
173 174 175 176 177 178 | |
MissingAccountError
dataclass
¶
Bases: Exception
Expected account not found in the allocation.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
180 181 182 183 184 185 186 187 188 | |
__str__()
¶
Print exception string.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
186 187 188 | |
CollisionError
dataclass
¶
Bases: Exception
Different accounts at the same address.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
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 | |
to_json()
¶
Dump to json object.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
198 199 200 201 202 203 204 205 206 207 208 | |
from_json(obj)
classmethod
¶
Parse from a json dict.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
210 211 212 213 214 215 216 217 218 219 220 221 | |
__str__()
¶
Print exception string.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
223 224 225 226 227 228 | |
KeyCollisionMode
¶
Bases: Enum
Mode for handling key collisions when merging allocations.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
230 231 232 233 234 235 | |
merge(alloc_1, alloc_2, key_collision_mode=KeyCollisionMode.OVERWRITE)
classmethod
¶
Return merged allocation of two sources.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
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 | |
__iter__()
¶
Return iterator over the allocation.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
279 280 281 | |
items()
¶
Return iterator over the allocation items.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
283 284 285 | |
__getitem__(address)
¶
Return account associated with an address.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
287 288 289 290 291 292 293 | |
__setitem__(address, account)
¶
Set account associated with an address.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
295 296 297 298 299 300 301 302 303 | |
__delitem__(address)
¶
Delete account associated with an address.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
305 306 307 308 309 310 311 | |
__eq__(other)
¶
Return True if both allocations are equal.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
313 314 315 316 317 | |
__contains__(address)
¶
Check if an account is in the allocation.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
319 320 321 322 323 324 325 | |
empty_accounts()
¶
Return list of addresses of empty accounts.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
327 328 329 330 331 | |
state_root()
¶
Return state root of the allocation.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
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 | |
verify_post_alloc(got_alloc)
¶
Verify that the allocation matches the expected post in the test. Raises exception on unexpected values.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
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 | |
deterministic_deploy_contract(*, deploy_code, salt=0, initcode=None, storage=None, label=None)
¶
Deploy a contract to the allocation at a deterministic location using a deterministic deployment proxy.
The initcode is not executed during test filling; it is executed only
when the tests run on live networks. Therefore, if the initcode
performs modifications to the storage, these must be specified using
the storage parameter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
deploy_code
|
BytesConvertible
|
Contract code to deploy. |
required |
salt
|
Hash | int
|
Salt to use for deterministic deployment. |
0
|
initcode
|
BytesConvertible | None
|
Initcode to use for deterministic deployment.
If |
None
|
storage
|
Storage | StorageRootType | None
|
The expected storage state of the deployed contract after initcode execution. |
None
|
label
|
str | None
|
Label to use for the contract. |
None
|
Source code in packages/testing/src/execution_testing/test_types/account_types.py
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 | |
deploy_contract(code, *, storage=None, balance=0, nonce=1, address=None, label=None, stub=None)
¶
Deploy a contract to the allocation.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | |
fund_eoa(amount=None, label=None, storage=None, code=None, delegation=None, nonce=None)
¶
Add a previously unused EOA to the pre-alloc with the balance specified
by amount.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 | |
fund_address(address, amount, *, minimum_balance=False)
¶
Fund an address with a given amount.
Add a funded account to the pre-allocation.
The address must not already exist in the pre-allocation. To set the
balance of an account, use the amount parameter in fund_eoa() or
the balance parameter in deploy_contract() at creation time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
Address
|
Address to fund |
required |
amount
|
NumberConvertible
|
Amount to fund in Wei |
required |
minimum_balance
|
bool
|
If set to True, account will be checked to have a
minimum balance of |
False
|
Source code in packages/testing/src/execution_testing/test_types/account_types.py
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 | |
empty_account()
¶
Return a previously unused account guaranteed to be empty.
This ensures the account has zero balance, zero nonce, no code, and no storage. The account is not a precompile or a system contract.
Source code in packages/testing/src/execution_testing/test_types/account_types.py
484 485 486 487 488 489 490 491 492 493 | |
Blob
¶
Bases: CamelModel
Class representing a full blob.
Source code in packages/testing/src/execution_testing/test_types/blob_types.py
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 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 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 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 521 522 523 524 525 526 527 528 529 530 531 532 533 534 | |
trusted_setup()
classmethod
¶
Set trusted setup if it is not already set.
Source code in packages/testing/src/execution_testing/test_types/blob_types.py
67 68 69 70 71 72 73 74 75 76 77 | |
get_filename(fork, seed)
staticmethod
¶
Return filename this blob would have as string (with .json extension).
Source code in packages/testing/src/execution_testing/test_types/blob_types.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
get_filepath(fork, seed)
staticmethod
¶
Return the Path to the blob that would be created with these parameters.
Source code in packages/testing/src/execution_testing/test_types/blob_types.py
95 96 97 98 99 100 101 102 103 104 105 | |
from_fork(fork, seed=0, timestamp=0)
staticmethod
¶
Construct Blob instances. Fork logic is encapsulated within nested functions.
Source code in packages/testing/src/execution_testing/test_types/blob_types.py
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 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 | |
from_file(file_name)
staticmethod
¶
Read a .json file and reconstruct object it represents.
You can load a blob only via its filename (with or without .json extension).
Source code in packages/testing/src/execution_testing/test_types/blob_types.py
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 | |
write_to_file()
¶
Take a blob object, serialize it and write it to disk as json.
Source code in packages/testing/src/execution_testing/test_types/blob_types.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | |
verify_cell_kzg_proof_batch(cell_indices)
¶
Check whether all cell proofs are valid and returns True only if that is the case.
Source code in packages/testing/src/execution_testing/test_types/blob_types.py
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 | |
delete_cells_then_recover_them(deletion_indices)
¶
Simulate the cell recovery process in user-specified scenario.
Note: Requirement for successful reconstruction is having at least N of the 2N cells.
Theoretical Usage: You pass a cell list with to 128 elements to this function along with a list of deletion indices. These cells will be deleted and then the ckzg recovery mechanism is used to repair the missing cells. If no assertion is triggered the reconstruction was successful.
Source code in packages/testing/src/execution_testing/test_types/blob_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 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 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 | |
ProofCorruptionMode
¶
Bases: Enum
Define what the proof corruption modes do.
For Osaka and later each Bytes object in the list is manipulated this way.
Source code in packages/testing/src/execution_testing/test_types/blob_types.py
461 462 463 464 465 466 467 468 469 470 471 472 | |
corrupt_proof(mode)
¶
Corrupt the proof field, supports different corruption modes.
Source code in packages/testing/src/execution_testing/test_types/blob_types.py
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 521 522 523 524 525 526 527 528 529 530 531 532 533 534 | |
BalAccountChange
¶
Bases: CamelModel, RLPSerializable
Represents all changes to a specific account in a block.
Source code in packages/testing/src/execution_testing/test_types/block_access_list/account_changes.py
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 | |
BalAccountExpectation
¶
Bases: CamelModel
Represents expected changes to a specific account in a block.
Same as BalAccountChange but without the address field, used for expectations.
Source code in packages/testing/src/execution_testing/test_types/block_access_list/expectations.py
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 | |
empty()
classmethod
¶
Create an expectation that validates the account has NO changes.
This is distinct from BalAccountExpectation() with no fields set,
which is ambiguous and clashes with model_fields_set logic, and
will raise a clarifying error if used in expectations.
Returns:
| Type | Description |
|---|---|
BalAccountExpectation
|
A BalAccountExpectation instance with all change lists empty. |
BalAccountExpectation
|
This uses a classvar to facilitate identity checks across |
BalAccountExpectation
|
multiple expectation instances. |
Source code in packages/testing/src/execution_testing/test_types/block_access_list/expectations.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
BalBalanceChange
¶
Bases: CamelModel, RLPSerializable
Represents a balance change in the block access list.
Source code in packages/testing/src/execution_testing/test_types/block_access_list/account_changes.py
35 36 37 38 39 40 41 42 43 44 45 46 | |
BalCodeChange
¶
Bases: CamelModel, RLPSerializable
Represents a code change in the block access list.
Source code in packages/testing/src/execution_testing/test_types/block_access_list/account_changes.py
49 50 51 52 53 54 55 56 57 58 | |
BalNonceChange
¶
Bases: CamelModel, RLPSerializable
Represents a nonce change in the block access list.
Source code in packages/testing/src/execution_testing/test_types/block_access_list/account_changes.py
21 22 23 24 25 26 27 28 29 30 31 32 | |
BalStorageChange
¶
Bases: CamelModel, RLPSerializable
Represents a change to a specific storage slot.
Source code in packages/testing/src/execution_testing/test_types/block_access_list/account_changes.py
61 62 63 64 65 66 67 68 69 70 71 72 | |
BalStorageSlot
¶
Bases: CamelModel, RLPSerializable
Represents all changes to a specific storage slot.
Source code in packages/testing/src/execution_testing/test_types/block_access_list/account_changes.py
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 | |
BlockAccessList
¶
Bases: EthereumTestRootModel[List[BalAccountChange]]
Block Access List for t8n tool communication and fixtures.
This model represents the BAL exactly as defined in EIP-7928 - it is itself a list of account changes (root model), not a container.
Used for: - Communication with t8n tools - Fixture generation - RLP encoding for hash verification
Example
bal = BlockAccessList([ BalAccountChange(address=alice, nonce_changes=[...]), BalAccountChange(address=bob, balance_changes=[...]) ])
Source code in packages/testing/src/execution_testing/test_types/block_access_list/t8n.py
18 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 | |
to_list()
¶
Return the list for RLP encoding per EIP-7928.
Source code in packages/testing/src/execution_testing/test_types/block_access_list/t8n.py
40 41 42 | |
rlp
cached
property
¶
Return the RLP encoded block access list for hash verification.
rlp_hash
cached
property
¶
Return the hash of the RLP encoded block access list.
validate_structure()
¶
Validate BAL structure follows EIP-7928 requirements.
Checks: - Addresses are in lexicographic (ascending) order - Transaction indices are sorted and unique within each change list - Storage slots are in ascending order - Storage reads are in ascending order
Raises:
| Type | Description |
|---|---|
BlockAccessListValidationError
|
If validation fails |
Source code in packages/testing/src/execution_testing/test_types/block_access_list/t8n.py
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 | |
BlockAccessListExpectation
¶
Bases: CamelModel
Block Access List expectation model for test writing.
This model is used to define expected BAL values in tests. It supports: - Partial validation (only checks explicitly set fields) - Convenient test syntax with named parameters - Verification against actual BAL from t8n - Explicit exclusion of addresses (using None values)
Example
In test definition¶
expected_block_access_list = BlockAccessListExpectation( account_expectations={ alice: BalAccountExpectation( nonce_changes=[ BalNonceChange(block_access_index=1, post_nonce=1) ] ), bob: None, # Bob should NOT be in the BAL } )
Source code in packages/testing/src/execution_testing/test_types/block_access_list/expectations.py
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 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 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 | |
modify(*modifiers)
¶
Create a new expectation with a modifier for invalid test cases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
modifiers
|
Callable[[BlockAccessList], BlockAccessList]
|
One or more functions that take and return a BlockAccessList |
()
|
Returns:
| Type | Description |
|---|---|
BlockAccessListExpectation
|
A new BlockAccessListExpectation instance with |
BlockAccessListExpectation
|
the modifiers applied |
Example
from execution_testing.test_types.block_access_list. modifiers import remove_nonces
expectation = BlockAccessListExpectation( account_expectations={...} ).modify(remove_nonces(alice))
Source code in packages/testing/src/execution_testing/test_types/block_access_list/expectations.py
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 | |
modify_if_invalid_test(t8n_bal)
¶
Apply the modifier to the given BAL if this is an invalid test case.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t8n_bal
|
BlockAccessList
|
The BlockAccessList from t8n tool |
required |
Returns:
| Type | Description |
|---|---|
BlockAccessList
|
The potentially transformed BlockAccessList for the fixture |
Source code in packages/testing/src/execution_testing/test_types/block_access_list/expectations.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |
verify_against(actual_bal)
¶
Verify that the actual BAL from the client matches this expected BAL.
Validation steps: 1. Verify address expectations - presence or explicit absence 2. Verify expected changes within accounts match actual changes
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
actual_bal
|
BlockAccessList
|
The BlockAccessList model from the client |
required |
Raises:
| Type | Description |
|---|---|
BlockAccessListValidationError
|
If verification fails |
Source code in packages/testing/src/execution_testing/test_types/block_access_list/expectations.py
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 | |
Environment
¶
Bases: EnvironmentGeneric[ZeroPaddedHexNumber]
Structure used to keep track of the context in which a block must be executed.
Source code in packages/testing/src/execution_testing/test_types/block_types.py
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 | |
strip_computed_fields(data)
classmethod
¶
Strip computed fields that are not valid input fields.
Source code in packages/testing/src/execution_testing/test_types/block_types.py
120 121 122 123 124 125 126 127 | |
parent_hash
cached
property
¶
Obtains the latest hash according to the highest block number in
block_hashes.
set_fork_requirements(fork)
¶
Fill required fields in an environment depending on the fork.
Source code in packages/testing/src/execution_testing/test_types/block_types.py
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 | |
__hash__()
¶
Hashes the environment object.
Source code in packages/testing/src/execution_testing/test_types/block_types.py
228 229 230 231 232 233 234 235 236 | |
__eq__(other)
¶
Check if two environment objects are equal.
Source code in packages/testing/src/execution_testing/test_types/block_types.py
238 239 240 241 242 243 244 245 246 247 248 249 | |
EnvironmentDefaults
dataclass
¶
Default environment values.
Source code in packages/testing/src/execution_testing/test_types/block_types.py
30 31 32 33 34 35 36 37 | |
Withdrawal
¶
Bases: WithdrawalGeneric[HexNumber]
Withdrawal type.
Source code in packages/testing/src/execution_testing/test_types/block_types.py
75 76 77 78 | |
ChainConfig
¶
Bases: CamelModel
Chain configuration.
Source code in packages/testing/src/execution_testing/test_types/chain_config_types.py
19 20 21 22 23 24 25 | |
ChainConfigDefaults
¶
Default values for the chain configuration.
Can be modified by modules that import this module and want to override the default values.
Source code in packages/testing/src/execution_testing/test_types/chain_config_types.py
8 9 10 11 12 13 14 15 16 | |
TestParameterGroup
¶
Bases: BaseModel
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 packages/testing/src/execution_testing/test_types/helpers.py
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 | |
__repr__()
¶
Generate 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 packages/testing/src/execution_testing/test_types/helpers.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
add_kzg_version(b_hashes, kzg_version)
¶
Add KZG version to each blob hash.
Source code in packages/testing/src/execution_testing/test_types/helpers.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |
ceiling_division(a, b)
¶
Calculate ceil without using floating point. Used by many of the EVM's formulas.
Source code in packages/testing/src/execution_testing/test_types/helpers.py
51 52 53 54 55 56 | |
compute_create2_address(address, salt, initcode)
¶
Compute address of the resulting contract created using the CREATE2
opcode.
Source code in packages/testing/src/execution_testing/test_types/helpers.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | |
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 packages/testing/src/execution_testing/test_types/helpers.py
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 | |
compute_deterministic_create2_address(*, salt, initcode, fork)
¶
Compute address of the resulting contract created using the CREATE2
opcode using the DETERMINISTIC_FACTORY_ADDRESS.
Source code in packages/testing/src/execution_testing/test_types/helpers.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
contract_address_from_hash(account_hash, salt)
¶
Calculate an address from a given (account) hash plus a salt.
Useful to not duplicate accounts in the pre-allocation when grouping many tests.
Source code in packages/testing/src/execution_testing/test_types/helpers.py
150 151 152 153 154 155 156 157 158 159 | |
eoa_from_hash(account_hash, salt)
¶
Calculate an EOA from a given (account) hash plus a salt.
Useful to not duplicate accounts in the pre-allocation when grouping many tests.
Source code in packages/testing/src/execution_testing/test_types/helpers.py
162 163 164 165 166 167 168 169 | |
TestPhase
¶
Bases: str, Enum
Test phase for state and blockchain tests.
Source code in packages/testing/src/execution_testing/test_types/phase_manager.py
8 9 10 11 12 13 14 15 | |
TestPhaseManager
¶
Manages test phases for transactions and blocks.
This singleton class provides context managers for SETUP and EXECUTION phases. Transactions automatically detect and tag themselves with the current phase.
Usage
with TestPhaseManager.setup(): # Transactions created here have test_phase = SETUP setup_tx = Transaction(...)
with TestPhaseManager.execution(): # Transactions created here have test_phase = EXECUTION benchmark_tx = Transaction(...)
Source code in packages/testing/src/execution_testing/test_types/phase_manager.py
18 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 | |
setup()
classmethod
¶
Context manager for the setup phase of a benchmark test.
Source code in packages/testing/src/execution_testing/test_types/phase_manager.py
38 39 40 41 42 43 44 45 46 47 | |
execution()
classmethod
¶
Context manager for the execution phase of a test.
Source code in packages/testing/src/execution_testing/test_types/phase_manager.py
49 50 51 52 53 54 55 56 57 58 | |
get_current_phase()
classmethod
¶
Get the current test phase.
Source code in packages/testing/src/execution_testing/test_types/phase_manager.py
60 61 62 63 | |
reset()
classmethod
¶
Reset the phase state to None (primarily for testing).
Source code in packages/testing/src/execution_testing/test_types/phase_manager.py
65 66 67 68 | |
TransactionLog
¶
Bases: CamelModel
Transaction log.
Source code in packages/testing/src/execution_testing/test_types/receipt_types.py
17 18 19 20 21 22 23 24 25 26 27 28 29 | |
TransactionReceipt
¶
Bases: CamelModel
Transaction receipt.
Source code in packages/testing/src/execution_testing/test_types/receipt_types.py
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 | |
strip_extra_fields(data)
classmethod
¶
Strip extra fields from t8n tool output not part of model.
Source code in packages/testing/src/execution_testing/test_types/receipt_types.py
43 44 45 46 47 48 49 50 51 | |
ConsolidationRequest
¶
Bases: RequestBase, CamelModel
Consolidation Request type.
Source code in packages/testing/src/execution_testing/test_types/request_types.py
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 | |
source_address = Address(0)
class-attribute
instance-attribute
¶
The address of the execution layer account that made the consolidation request.
source_pubkey
instance-attribute
¶
The public key of the source validator as it currently is in the beacon state.
target_pubkey
instance-attribute
¶
The public key of the target validator as it currently is in the beacon state.
__bytes__()
¶
Return consolidation's attributes as bytes.
Source code in packages/testing/src/execution_testing/test_types/request_types.py
107 108 109 110 111 112 113 | |
DepositRequest
¶
Bases: RequestBase, CamelModel
Deposit Request type.
Source code in packages/testing/src/execution_testing/test_types/request_types.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 54 55 56 | |
pubkey
instance-attribute
¶
The public key of the beacon chain validator.
withdrawal_credentials
instance-attribute
¶
The withdrawal credentials of the beacon chain validator.
amount
instance-attribute
¶
The amount in gwei of the deposit.
signature
instance-attribute
¶
The signature of the deposit using the validator's private key that matches
the pubkey.
index
instance-attribute
¶
The index of the deposit.
__bytes__()
¶
Return deposit's attributes as bytes.
Source code in packages/testing/src/execution_testing/test_types/request_types.py
48 49 50 51 52 53 54 55 56 | |
Requests
¶
Requests for the transition tool.
Source code in packages/testing/src/execution_testing/test_types/request_types.py
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 | |
__init__(*requests, requests_lists=None)
¶
Initialize requests object.
Source code in packages/testing/src/execution_testing/test_types/request_types.py
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 | |
__bytes__()
¶
Return requests hash.
Source code in packages/testing/src/execution_testing/test_types/request_types.py
159 160 161 162 | |
WithdrawalRequest
¶
Bases: RequestBase, CamelModel
Withdrawal Request type.
Source code in packages/testing/src/execution_testing/test_types/request_types.py
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 | |
source_address = Address(0)
class-attribute
instance-attribute
¶
The address of the execution layer account that made the withdrawal request.
validator_pubkey
instance-attribute
¶
The current public key of the validator as it currently is in the beacon state.
amount
instance-attribute
¶
The amount in gwei to be withdrawn on the beacon chain.
__bytes__()
¶
Return withdrawal's attributes as bytes.
Source code in packages/testing/src/execution_testing/test_types/request_types.py
77 78 79 80 81 82 83 | |
AuthorizationTuple
¶
Bases: AuthorizationTupleGeneric[HexNumber]
Authorization tuple for transactions.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
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 | |
model_post_init(__context)
¶
Automatically signs the authorization tuple if a secret key or sender are provided.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
124 125 126 127 128 129 130 | |
sign()
¶
Signs the authorization tuple with a private key.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
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 | |
NetworkWrappedTransaction
¶
Bases: CamelModel, RLPSerializable
Network wrapped transaction as defined in EIP-4844.
< Osaka: rlp([tx_payload_body, blobs, commitments, proofs])
= Osaka: rlp([tx_payload_body, wrapper_version, blobs, commitments, cell_proofs])
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
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 | |
blobs
property
¶
Return a list of blob data as bytes.
commitments
property
¶
Return a list of kzg commitments.
proofs
property
¶
Return a list of kzg proofs (returns None >= Osaka).
cell_proofs
property
¶
Return a list of cells (returns None < Osaka).
get_rlp_fields()
¶
Return an ordered list of field names to be included in RLP serialization.
Function can be overridden to customize the logic to return the fields.
By default, rlp_fields class variable is used.
The list can be nested list up to one extra level to represent nested fields.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
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 | |
hash
property
¶
Return the hash of the transaction.
sender
property
¶
Return the sender of the transaction.
to
property
¶
Return the to address of the transaction.
set_gas_price(*, gas_price, max_fee_per_gas, max_priority_fee_per_gas, max_fee_per_blob_gas)
¶
Set gas price to values of the current execution environment.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | |
signer_minimum_balance(*, fork)
¶
Return minimum balance of the signer.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
1010 1011 1012 | |
get_rlp_prefix()
¶
Return the transaction type as bytes to be appended at the beginning of the serialized transaction if type is not 0.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
1014 1015 1016 1017 1018 1019 1020 1021 | |
with_signature_and_sender(*, keep_secret_key=False)
¶
Return a new transaction with the signature and sender added.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 | |
Transaction
¶
Bases: TransactionGeneric[HexNumber], TransactionTransitionToolConverter, SignableRLPSerializable
Generic object that can represent all Ethereum transaction types.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
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 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 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 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 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 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 | |
strip_hash_from_t8n_output(data)
classmethod
¶
Strip the hash field which may be included in t8n tool output.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
302 303 304 305 306 307 308 309 310 311 | |
InvalidFeePaymentError
¶
Bases: Exception
Transaction described more than one fee payment type.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
343 344 345 346 347 348 349 350 | |
__str__()
¶
Print exception string.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
346 347 348 349 350 | |
InvalidSignaturePrivateKeyError
¶
Bases: Exception
Transaction describes both the signature and private key of source account.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
352 353 354 355 356 357 358 359 360 | |
__str__()
¶
Print exception string.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
358 359 360 | |
model_post_init(__context)
¶
Ensure transaction has no conflicting properties.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
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 443 444 445 446 447 448 449 450 451 452 453 454 455 | |
with_error(error)
¶
Create a copy of the transaction with an added error.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
457 458 459 460 461 | |
with_nonce(nonce)
¶
Create a copy of the transaction with a modified nonce.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
463 464 465 | |
signature_bytes
cached
property
¶
Returns the serialized bytes of the transaction signature.
sign()
¶
Signs the authorization tuple with a private key.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
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 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
with_signature_and_sender(*, keep_secret_key=False)
¶
Return signed version of the transaction using the private key.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 | |
get_rlp_signing_fields()
¶
Return the list of values included in the envelope used for signing depending on the transaction type.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
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 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 | |
get_rlp_fields()
¶
Return the list of values included in the list used for rlp encoding depending on the transaction type.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
713 714 715 716 717 718 719 720 721 | |
get_rlp_prefix()
¶
Return the transaction type as bytes to be appended at the beginning of the serialized transaction if type is not 0.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
723 724 725 726 727 728 729 730 | |
get_rlp_signing_prefix()
¶
Return the transaction type as bytes to be appended at the beginning of the serialized transaction signing envelope if type is not 0.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
732 733 734 735 736 737 738 739 | |
metadata_string()
¶
Return the metadata field as a formatted json string or None.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
741 742 743 744 745 | |
hash
cached
property
¶
Returns hash of the transaction.
serializable_list
cached
property
¶
Return list of values included in the transaction as a serializable object.
list_blob_versioned_hashes(input_txs)
staticmethod
¶
Get list of ordered blob versioned hashes from a list of transactions.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
760 761 762 763 764 765 766 767 768 769 770 771 772 | |
created_contract
cached
property
¶
Return address of the contract created by the transaction.
set_gas_price(*, gas_price, max_fee_per_gas, max_priority_fee_per_gas, max_fee_per_blob_gas)
¶
Set the gas price to the appropriate values of the current execution environment.
Values are only set if they were not set during instance creation.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
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 | |
signer_minimum_balance(*, fork)
¶
Return minimum balance of the signer.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 | |
__repr__()
¶
Return string representation with hex-encoded values for applicable fields.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
861 862 863 864 865 866 867 868 869 870 871 872 | |
__str__()
¶
Return the repr string representation.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
874 875 876 | |
TransactionDefaults
dataclass
¶
Default values for transactions.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
60 61 62 63 64 65 66 | |
TransactionTestMetadata
¶
Bases: CamelModel
Represents the metadata for a transaction.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | |
to_json()
¶
Convert the transaction metadata into json string for it to be embedded in the request id.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
287 288 289 290 291 292 | |
TransactionType
¶
Bases: IntEnum
Transaction types.
Source code in packages/testing/src/execution_testing/test_types/transaction_types.py
50 51 52 53 54 55 56 57 | |
Removable
¶
Sentinel class to detect if a parameter should be removed.
(None normally means "do not modify").
Source code in packages/testing/src/execution_testing/test_types/utils.py
22 23 24 25 26 27 28 29 30 31 32 | |
__eq__(other)
¶
Return True for all Removable.
Source code in packages/testing/src/execution_testing/test_types/utils.py
28 29 30 31 32 | |
keccak256(data)
¶
Calculate keccak256 hash of the given data.
Source code in packages/testing/src/execution_testing/test_types/utils.py
8 9 10 | |