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
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 |
|
__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
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
add_kzg_version(b_hashes, kzg_version)
¶
Adds the Kzg Version to each blob hash.
Source code in src/ethereum_test_types/helpers.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
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
67 68 69 70 71 72 73 74 75 76 77 78 |
|
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 |
|
__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 |
|
get_nonce()
¶
Returns the current nonce of the EOA and increments it by one.
Source code in src/ethereum_test_types/types.py
114 115 116 117 118 119 120 |
|
copy()
¶
Returns a copy of the EOA.
Source code in src/ethereum_test_types/types.py
122 123 124 125 126 |
|
Account
¶
Bases: CamelModel
State associated with an address.
Source code in src/ethereum_test_base_types/composite_types.py
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 |
|
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
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 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
339 340 341 342 343 344 345 346 347 |
|
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
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 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
366 367 368 369 370 371 372 373 374 |
|
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
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 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
393 394 395 396 397 398 399 400 401 |
|
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
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 |
|
__bool__()
¶
Returns True on a non-empty account.
Source code in src/ethereum_test_base_types/composite_types.py
435 436 437 438 439 |
|
with_code(code)
classmethod
¶
Create account with provided code
and nonce of 1
.
Source code in src/ethereum_test_base_types/composite_types.py
441 442 443 444 445 446 |
|
merge(account_1, account_2)
classmethod
¶
Create a merged account from two sources.
Source code in src/ethereum_test_base_types/composite_types.py
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 |
|
Alloc
¶
Bases: Alloc
Allocation of accounts in the state, pre and post test execution.
Source code in src/ethereum_test_types/types.py
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 |
|
UnexpectedAccount
dataclass
¶
Bases: Exception
Unexpected account found in the allocation.
Source code in src/ethereum_test_types/types.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_types/types.py
150 151 152 |
|
MissingAccount
dataclass
¶
Bases: Exception
Expected account not found in the allocation.
Source code in src/ethereum_test_types/types.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_types/types.py
166 167 168 |
|
merge(alloc_1, alloc_2)
classmethod
¶
Returns the merged allocation of two sources.
Source code in src/ethereum_test_types/types.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
|
__iter__()
¶
Returns an iterator over the allocation.
Source code in src/ethereum_test_types/types.py
186 187 188 189 190 |
|
items()
¶
Returns an iterator over the allocation items.
Source code in src/ethereum_test_types/types.py
192 193 194 195 196 |
|
__getitem__(address)
¶
Returns the account associated with an address.
Source code in src/ethereum_test_types/types.py
198 199 200 201 202 203 204 |
|
__setitem__(address, account)
¶
Sets the account associated with an address.
Source code in src/ethereum_test_types/types.py
206 207 208 209 210 211 212 |
|
__delitem__(address)
¶
Deletes the account associated with an address.
Source code in src/ethereum_test_types/types.py
214 215 216 217 218 219 220 |
|
__eq__(other)
¶
Returns True if both allocations are equal.
Source code in src/ethereum_test_types/types.py
222 223 224 225 226 227 228 |
|
__contains__(address)
¶
Checks if an account is in the allocation.
Source code in src/ethereum_test_types/types.py
230 231 232 233 234 235 236 |
|
empty_accounts()
¶
Returns a list of addresses of empty accounts.
Source code in src/ethereum_test_types/types.py
238 239 240 241 242 |
|
state_root()
¶
Returns the state root of the allocation.
Source code in src/ethereum_test_types/types.py
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 |
|
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
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
|
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
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
|
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
307 308 309 310 311 312 313 314 315 316 317 318 |
|
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
320 321 322 323 324 325 326 327 |
|
AuthorizationTuple
¶
Bases: AuthorizationTupleGeneric[HexNumber]
Authorization tuple for transactions.
Source code in src/ethereum_test_types/types.py
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 |
|
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
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 |
|
sign(private_key)
¶
Signs the authorization tuple with a private key.
Source code in src/ethereum_test_types/types.py
579 580 581 582 583 584 585 586 587 |
|
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
45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
ConsolidationRequest
¶
Bases: RequestBase
, CamelModel
Consolidation Request type
Source code in src/ethereum_test_types/types.py
1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 |
|
__bytes__()
¶
Returns the consolidation's attributes as bytes.
Source code in src/ethereum_test_types/types.py
1181 1182 1183 1184 1185 |
|
DepositRequest
¶
Bases: RequestBase
, CamelModel
Deposit Request type.
Source code in src/ethereum_test_types/types.py
1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 |
|
__bytes__()
¶
Returns the deposit's attributes as bytes.
Source code in src/ethereum_test_types/types.py
1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 |
|
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
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 |
|
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
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 |
|
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
¶
Requests for the transition tool.
Source code in src/ethereum_test_types/types.py
1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 |
|
__init__(*requests, max_request_type=None, requests_lists=None)
¶
Initializes the requests object.
Source code in src/ethereum_test_types/types.py
1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 |
|
__bytes__()
¶
Returns the requests hash.
Source code in src/ethereum_test_types/types.py
1229 1230 1231 1232 1233 1234 1235 1236 1237 |
|
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
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 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
|
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
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
49 50 51 |
|
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
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
66 67 68 |
|
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
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
82 83 84 |
|
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
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 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
107 108 109 110 111 112 113 114 115 116 117 |
|
__contains__(key)
¶
Checks for an item in the storage
Source code in src/ethereum_test_base_types/composite_types.py
119 120 121 |
|
__getitem__(key)
¶
Returns an item from the storage
Source code in src/ethereum_test_base_types/composite_types.py
123 124 125 126 127 |
|
__setitem__(key, value)
¶
Sets an item in the storage
Source code in src/ethereum_test_base_types/composite_types.py
129 130 131 132 133 134 135 136 137 |
|
__delitem__(key)
¶
Deletes an item from the storage
Source code in src/ethereum_test_base_types/composite_types.py
139 140 141 |
|
__iter__()
¶
Returns an iterator over the storage
Source code in src/ethereum_test_base_types/composite_types.py
143 144 145 |
|
__eq__(other)
¶
Returns True if both storages are equal.
Source code in src/ethereum_test_base_types/composite_types.py
147 148 149 150 151 152 153 |
|
__ne__(other)
¶
Returns True if both storages are not equal.
Source code in src/ethereum_test_base_types/composite_types.py
155 156 157 158 159 160 161 |
|
__bool__()
¶
Returns True if the storage is not empty
Source code in src/ethereum_test_base_types/composite_types.py
163 164 165 |
|
__add__(other)
¶
Returns a new storage that is the sum of two storages.
Source code in src/ethereum_test_base_types/composite_types.py
167 168 169 170 171 |
|
keys()
¶
Returns the keys of the storage
Source code in src/ethereum_test_base_types/composite_types.py
173 174 175 |
|
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
177 178 179 180 181 182 |
|
items()
¶
Returns the items of the storage
Source code in src/ethereum_test_base_types/composite_types.py
184 185 186 |
|
store_next(value, hint='')
¶
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
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|
peek_slot()
¶
Peeks the next slot that will be used by store_next
.
Source code in src/ethereum_test_base_types/composite_types.py
204 205 206 207 208 |
|
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
210 211 212 213 214 215 216 217 218 219 220 221 222 |
|
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
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
|
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
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 |
|
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
284 285 286 287 288 289 |
|
Transaction
¶
Bases: TransactionGeneric[HexNumber]
, TransactionTransitionToolConverter
Generic object that can represent all Ethereum transaction types.
Source code in src/ethereum_test_types/types.py
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 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 |
|
InvalidFeePayment
¶
Bases: Exception
Transaction described more than one fee payment type.
Source code in src/ethereum_test_types/types.py
709 710 711 712 713 714 715 716 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_types/types.py
714 715 716 |
|
InvalidSignaturePrivateKey
¶
Bases: Exception
Transaction describes both the signature and private key of source account.
Source code in src/ethereum_test_types/types.py
718 719 720 721 722 723 724 725 726 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_types/types.py
724 725 726 |
|
model_post_init(__context)
¶
Ensures the transaction has no conflicting properties.
Source code in src/ethereum_test_types/types.py
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 |
|
with_error(error)
¶
Create a copy of the transaction with an added error.
Source code in src/ethereum_test_types/types.py
794 795 796 797 798 799 800 |
|
with_nonce(nonce)
¶
Create a copy of the transaction with a modified nonce.
Source code in src/ethereum_test_types/types.py
802 803 804 805 806 |
|
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
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 |
|
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
1072 1073 1074 1075 1076 1077 1078 1079 1080 |
|
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
1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 |
|
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
590 591 592 593 594 595 596 597 598 599 |
|
Withdrawal
¶
Bases: WithdrawalGeneric[HexNumber]
Withdrawal type
Source code in src/ethereum_test_types/types.py
363 364 365 366 367 368 |
|
WithdrawalRequest
¶
Bases: RequestBase
, CamelModel
Withdrawal Request type
Source code in src/ethereum_test_types/types.py
1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 |
|
__bytes__()
¶
Returns the withdrawal's attributes as bytes.
Source code in src/ethereum_test_types/types.py
1159 1160 1161 1162 1163 1164 1165 1166 1167 |
|
keccak256(data)
¶
Calculates the keccak256 hash of the given data.
Source code in src/ethereum_test_types/types.py
54 55 56 57 58 |
|