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
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 |
|
__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 src/ethereum_test_types/helpers.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
add_kzg_version(b_hashes, kzg_version)
¶
Add Kzg Version to each blob hash.
Source code in src/ethereum_test_types/helpers.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
ceiling_division(a, b)
¶
Calculate ceil without using floating point. Used by many of the EVM's formulas.
Source code in src/ethereum_test_types/helpers.py
19 20 21 22 23 24 |
|
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
54 55 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
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 |
|
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
67 68 69 70 71 72 73 74 75 76 |
|
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
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 |
|
__new__(address=None, *, key=None, nonce=0)
¶
Init the EOA.
Source code in src/ethereum_test_types/types.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
get_nonce()
¶
Return current nonce of the EOA and increments it by one.
Source code in src/ethereum_test_types/types.py
110 111 112 113 114 |
|
copy()
¶
Return copy of the EOA.
Source code in src/ethereum_test_types/types.py
116 117 118 |
|
Account
¶
Bases: CamelModel
State associated with an address.
Source code in src/ethereum_test_base_types/composite_types.py
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 |
|
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.
NonceMismatchError
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
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 |
|
__init__(address, want, got, *args)
¶
Initialize the exception with the address, wanted and got values.
Source code in src/ethereum_test_base_types/composite_types.py
315 316 317 318 319 320 |
|
__str__()
¶
Print exception string.
Source code in src/ethereum_test_base_types/composite_types.py
322 323 324 325 326 327 328 329 330 |
|
BalanceMismatchError
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
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 |
|
__init__(address, want, got, *args)
¶
Initialize the exception with the address, wanted and got values.
Source code in src/ethereum_test_base_types/composite_types.py
343 344 345 346 347 348 |
|
__str__()
¶
Print exception string.
Source code in src/ethereum_test_base_types/composite_types.py
350 351 352 353 354 355 356 357 358 |
|
CodeMismatchError
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
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 |
|
__init__(address, want, got, *args)
¶
Initialize the exception with the address, wanted and got values.
Source code in src/ethereum_test_base_types/composite_types.py
371 372 373 374 375 376 |
|
__str__()
¶
Print exception string.
Source code in src/ethereum_test_base_types/composite_types.py
378 379 380 381 382 383 384 385 386 |
|
check_alloc(address, account)
¶
Check 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
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 |
|
__bool__()
¶
Return True on a non-empty account.
Source code in src/ethereum_test_base_types/composite_types.py
420 421 422 |
|
with_code(code)
classmethod
¶
Create account with provided code
and nonce of 1
.
Source code in src/ethereum_test_base_types/composite_types.py
424 425 426 427 |
|
merge(account_1, account_2)
classmethod
¶
Create a merged account from two sources.
Source code in src/ethereum_test_base_types/composite_types.py
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
|
Alloc
¶
Bases: Alloc
Allocation of accounts in the state, pre and post test execution.
Source code in src/ethereum_test_types/types.py
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 |
|
UnexpectedAccountError
dataclass
¶
Bases: Exception
Unexpected account found in the allocation.
Source code in src/ethereum_test_types/types.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
|
__init__(address, account, *args)
¶
Initialize the exception.
Source code in src/ethereum_test_types/types.py
133 134 135 136 137 |
|
__str__()
¶
Print exception string.
Source code in src/ethereum_test_types/types.py
139 140 141 |
|
MissingAccountError
dataclass
¶
Bases: Exception
Expected account not found in the allocation.
Source code in src/ethereum_test_types/types.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
__init__(address, *args)
¶
Initialize the exception.
Source code in src/ethereum_test_types/types.py
149 150 151 152 |
|
__str__()
¶
Print exception string.
Source code in src/ethereum_test_types/types.py
154 155 156 |
|
merge(alloc_1, alloc_2)
classmethod
¶
Return merged allocation of two sources.
Source code in src/ethereum_test_types/types.py
158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
__iter__()
¶
Return iterator over the allocation.
Source code in src/ethereum_test_types/types.py
172 173 174 |
|
items()
¶
Return iterator over the allocation items.
Source code in src/ethereum_test_types/types.py
176 177 178 |
|
__getitem__(address)
¶
Return account associated with an address.
Source code in src/ethereum_test_types/types.py
180 181 182 183 184 |
|
__setitem__(address, account)
¶
Set account associated with an address.
Source code in src/ethereum_test_types/types.py
186 187 188 189 190 |
|
__delitem__(address)
¶
Delete account associated with an address.
Source code in src/ethereum_test_types/types.py
192 193 194 195 196 |
|
__eq__(other)
¶
Return True if both allocations are equal.
Source code in src/ethereum_test_types/types.py
198 199 200 201 202 |
|
__contains__(address)
¶
Check if an account is in the allocation.
Source code in src/ethereum_test_types/types.py
204 205 206 207 208 |
|
empty_accounts()
¶
Return list of addresses of empty accounts.
Source code in src/ethereum_test_types/types.py
210 211 212 |
|
state_root()
¶
Return state root of the allocation.
Source code in src/ethereum_test_types/types.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
|
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
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
|
deploy_contract(code, *, storage=None, 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
259 260 261 262 263 264 265 266 267 268 269 270 271 |
|
fund_eoa(amount=None, label=None, storage=None, delegation=None, nonce=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
273 274 275 276 277 278 279 280 281 282 |
|
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
284 285 286 287 288 289 290 291 |
|
AuthorizationTuple
¶
Bases: AuthorizationTupleGeneric[HexNumber]
Authorization tuple for transactions.
Source code in src/ethereum_test_types/types.py
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 |
|
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
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 |
|
sign(private_key)
¶
Signs the authorization tuple with a private key.
Source code in src/ethereum_test_types/types.py
541 542 543 544 545 546 547 |
|
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
35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
ConsolidationRequest
¶
Bases: RequestBase
, CamelModel
Consolidation Request type.
Source code in src/ethereum_test_types/types.py
1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 |
|
__bytes__()
¶
Return consolidation's attributes as bytes.
Source code in src/ethereum_test_types/types.py
1128 1129 1130 |
|
DepositRequest
¶
Bases: RequestBase
, CamelModel
Deposit Request type.
Source code in src/ethereum_test_types/types.py
1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 |
|
__bytes__()
¶
Return deposit's attributes as bytes.
Source code in src/ethereum_test_types/types.py
1090 1091 1092 1093 1094 1095 1096 1097 1098 |
|
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
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 |
|
parent_hash: Hash | None
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 src/ethereum_test_types/types.py
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 |
|
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
70 71 72 73 74 75 76 |
|
Requests
¶
Requests for the transition tool.
Source code in src/ethereum_test_types/types.py
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 |
|
__init__(*requests, requests_lists=None)
¶
Initialize requests object.
Source code in src/ethereum_test_types/types.py
1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 |
|
__bytes__()
¶
Return requests hash.
Source code in src/ethereum_test_types/types.py
1167 1168 1169 1170 1171 1172 1173 |
|
Storage
¶
Bases: EthereumTestRootModel[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
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 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 |
|
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.
InvalidTypeError
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
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
__init__(key_or_value, *args)
¶
Initialize the exception with the invalid type.
Source code in src/ethereum_test_base_types/composite_types.py
39 40 41 42 |
|
__str__()
¶
Print exception string.
Source code in src/ethereum_test_base_types/composite_types.py
44 45 46 |
|
InvalidValueError
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
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
__init__(key_or_value, *args)
¶
Initialize the exception with the invalid value.
Source code in src/ethereum_test_base_types/composite_types.py
57 58 59 60 |
|
__str__()
¶
Print exception string.
Source code in src/ethereum_test_base_types/composite_types.py
62 63 64 |
|
MissingKeyError
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
66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
__init__(key, *args)
¶
Initialize the exception with the missing key.
Source code in src/ethereum_test_base_types/composite_types.py
72 73 74 75 |
|
__str__()
¶
Print exception string.
Source code in src/ethereum_test_base_types/composite_types.py
77 78 79 |
|
KeyValueMismatchError
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
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 |
|
__init__(address, key, want, got, hint='', *args)
¶
Initialize the exception with the address, key, wanted and got values.
Source code in src/ethereum_test_base_types/composite_types.py
94 95 96 97 98 99 100 101 |
|
__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)
¶
Check for an item in the storage.
Source code in src/ethereum_test_base_types/composite_types.py
115 116 117 |
|
__getitem__(key)
¶
Return an item from the storage.
Source code in src/ethereum_test_base_types/composite_types.py
119 120 121 122 123 |
|
__setitem__(key, value)
¶
Set 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)
¶
Delete an item from the storage.
Source code in src/ethereum_test_base_types/composite_types.py
135 136 137 |
|
__iter__()
¶
Return an iterator over the storage.
Source code in src/ethereum_test_base_types/composite_types.py
139 140 141 |
|
__eq__(other)
¶
Return True if both storages are equal.
Source code in src/ethereum_test_base_types/composite_types.py
143 144 145 146 147 |
|
__ne__(other)
¶
Return True if both storages are not equal.
Source code in src/ethereum_test_base_types/composite_types.py
149 150 151 152 153 |
|
__bool__()
¶
Return True if the storage is not empty.
Source code in src/ethereum_test_base_types/composite_types.py
155 156 157 |
|
__add__(other)
¶
Return a new storage that is the sum of two storages.
Source code in src/ethereum_test_base_types/composite_types.py
159 160 161 |
|
keys()
¶
Return the keys of the storage.
Source code in src/ethereum_test_base_types/composite_types.py
163 164 165 |
|
set_next_slot(slot)
¶
Set the next slot to be used by store_next
.
Source code in src/ethereum_test_base_types/composite_types.py
167 168 169 170 |
|
items()
¶
Return the items of the storage.
Source code in src/ethereum_test_base_types/composite_types.py
172 173 174 |
|
store_next(value, hint='')
¶
Store 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
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
|
peek_slot()
¶
Peek the next slot that will be used by store_next
.
Source code in src/ethereum_test_base_types/composite_types.py
192 193 194 |
|
contains(other)
¶
Return 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
196 197 198 199 200 201 202 203 204 205 206 207 208 |
|
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
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
must_be_equal(address, other)
¶
Succeed only if "self" is equal to "other" storage.
Source code in src/ethereum_test_base_types/composite_types.py
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 |
|
canary()
¶
Return 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
268 269 270 271 272 273 |
|
Transaction
¶
Bases: TransactionGeneric[HexNumber]
, TransactionTransitionToolConverter
Generic object that can represent all Ethereum transaction types.
Source code in src/ethereum_test_types/types.py
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 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 |
|
InvalidFeePaymentError
¶
Bases: Exception
Transaction described more than one fee payment type.
Source code in src/ethereum_test_types/types.py
698 699 700 701 702 703 |
|
__str__()
¶
Print exception string.
Source code in src/ethereum_test_types/types.py
701 702 703 |
|
InvalidSignaturePrivateKeyError
¶
Bases: Exception
Transaction describes both the signature and private key of source account.
Source code in src/ethereum_test_types/types.py
705 706 707 708 709 710 711 712 713 |
|
__str__()
¶
Print exception string.
Source code in src/ethereum_test_types/types.py
711 712 713 |
|
model_post_init(__context)
¶
Ensure transaction has no conflicting properties.
Source code in src/ethereum_test_types/types.py
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 |
|
with_error(error)
¶
Create a copy of the transaction with an added error.
Source code in src/ethereum_test_types/types.py
779 780 781 782 783 |
|
with_nonce(nonce)
¶
Create a copy of the transaction with a modified nonce.
Source code in src/ethereum_test_types/types.py
785 786 787 |
|
with_signature_and_sender(*, keep_secret_key=False)
¶
Return signed version of the transaction using the private key.
Source code in src/ethereum_test_types/types.py
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 |
|
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
¶
Return list of values included in the transaction as a serializable object.
list_root(input_txs)
staticmethod
¶
Return transactions root of a list of transactions.
Source code in src/ethereum_test_types/types.py
1039 1040 1041 1042 1043 1044 1045 |
|
list_blob_versioned_hashes(input_txs)
staticmethod
¶
Get list of ordered blob versioned hashes from a list of transactions.
Source code in src/ethereum_test_types/types.py
1047 1048 1049 1050 1051 1052 1053 1054 1055 |
|
created_contract: Address
cached
property
¶
Return address of the contract created by the transaction.
TransactionDefaults
dataclass
¶
Default values for transactions.
Source code in src/ethereum_test_types/types.py
591 592 593 594 595 596 597 598 |
|
TransactionReceipt
¶
Bases: CamelModel
Transaction receipt.
Source code in src/ethereum_test_types/types.py
572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 |
|
Withdrawal
¶
Bases: WithdrawalGeneric[HexNumber]
Withdrawal type.
Source code in src/ethereum_test_types/types.py
323 324 325 326 |
|
WithdrawalRequest
¶
Bases: RequestBase
, CamelModel
Withdrawal Request type.
Source code in src/ethereum_test_types/types.py
1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 |
|
__bytes__()
¶
Return withdrawal's attributes as bytes.
Source code in src/ethereum_test_types/types.py
1110 1111 1112 1113 1114 1115 1116 |
|
keccak256(data)
¶
Calculate keccak256 hash of the given data.
Source code in src/ethereum_test_types/types.py
56 57 58 |
|