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
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 |
|
__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
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
add_kzg_version(b_hashes, kzg_version)
¶
Adds the Kzg Version to each blob hash.
Source code in src/ethereum_test_types/helpers.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
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
43 44 45 46 47 48 49 50 51 |
|
compute_create_address(address, nonce=0)
¶
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 |
|
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
80 81 82 83 84 85 86 87 88 89 |
|
copy_opcode_cost(length)
¶
Calculates the cost of the COPY opcodes, assuming memory expansion from empty memory, based on the costs specified in the yellow paper: https://ethereum.github.io/yellowpaper/paper.pdf
Source code in src/ethereum_test_types/helpers.py
71 72 73 74 75 76 77 |
|
cost_memory_bytes(new_bytes, previous_bytes)
¶
Calculates the cost of memory expansion, based on the costs specified in the yellow paper: https://ethereum.github.io/yellowpaper/paper.pdf
Source code in src/ethereum_test_types/helpers.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
eip_2028_transaction_data_cost(data)
¶
Calculates the cost of a given data as part of a transaction, based on the costs specified in EIP-2028: https://eips.ethereum.org/EIPS/eip-2028
Source code in src/ethereum_test_types/helpers.py
92 93 94 95 96 97 98 99 100 101 102 103 |
|
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
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 |
|
__new__(address=None, *, key=None, nonce=0)
¶
Init the EOA.
Source code in src/ethereum_test_types/types.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
get_nonce()
¶
Returns the current nonce of the EOA and increments it by one.
Source code in src/ethereum_test_types/types.py
95 96 97 98 99 100 101 |
|
copy()
¶
Returns a copy of the EOA.
Source code in src/ethereum_test_types/types.py
103 104 105 106 107 |
|
AccessList
¶
Bases: CamelModel
Access List for transactions.
Source code in src/ethereum_test_types/types.py
445 446 447 448 449 450 451 452 453 454 455 456 457 |
|
to_list()
¶
Returns the access list as a list of serializable elements.
Source code in src/ethereum_test_types/types.py
453 454 455 456 457 |
|
Account
¶
Bases: CamelModel
State associated with an address.
Source code in src/ethereum_test_base_types/composite_types.py
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 |
|
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
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 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
309 310 311 312 313 314 315 316 317 |
|
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
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 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
336 337 338 339 340 341 342 343 344 |
|
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
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 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
363 364 365 366 367 368 369 370 371 |
|
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
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 |
|
__bool__()
¶
Returns True on a non-empty account.
Source code in src/ethereum_test_base_types/composite_types.py
405 406 407 408 409 |
|
with_code(code)
classmethod
¶
Create account with provided code
and nonce of 1
.
Source code in src/ethereum_test_base_types/composite_types.py
411 412 413 414 415 416 |
|
merge(account_1, account_2)
classmethod
¶
Create a merged account from two sources.
Source code in src/ethereum_test_base_types/composite_types.py
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 |
|
Alloc
¶
Bases: Alloc
Allocation of accounts in the state, pre and post test execution.
Source code in src/ethereum_test_types/types.py
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 |
|
UnexpectedAccount
dataclass
¶
Bases: Exception
Unexpected account found in the allocation.
Source code in src/ethereum_test_types/types.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_types/types.py
129 130 131 |
|
MissingAccount
dataclass
¶
Bases: Exception
Expected account not found in the allocation.
Source code in src/ethereum_test_types/types.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_types/types.py
145 146 147 |
|
merge(alloc_1, alloc_2)
classmethod
¶
Returns the merged allocation of two sources.
Source code in src/ethereum_test_types/types.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
|
__iter__()
¶
Returns an iterator over the allocation.
Source code in src/ethereum_test_types/types.py
165 166 167 168 169 |
|
__getitem__(address)
¶
Returns the account associated with an address.
Source code in src/ethereum_test_types/types.py
171 172 173 174 175 176 177 |
|
__setitem__(address, account)
¶
Sets the account associated with an address.
Source code in src/ethereum_test_types/types.py
179 180 181 182 183 184 185 |
|
__delitem__(address)
¶
Deletes the account associated with an address.
Source code in src/ethereum_test_types/types.py
187 188 189 190 191 192 193 |
|
__eq__(other)
¶
Returns True if both allocations are equal.
Source code in src/ethereum_test_types/types.py
195 196 197 198 199 200 201 |
|
__contains__(address)
¶
Checks if an account is in the allocation.
Source code in src/ethereum_test_types/types.py
203 204 205 206 207 208 209 |
|
empty_accounts()
¶
Returns a list of addresses of empty accounts.
Source code in src/ethereum_test_types/types.py
211 212 213 214 215 |
|
state_root()
¶
Returns the state root of the allocation.
Source code in src/ethereum_test_types/types.py
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 |
|
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
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
|
deploy_contract(code, *, storage={}, balance=0, nonce=1, address=None, label=None)
¶
Deploy a contract to the allocation.
Source code in src/ethereum_test_types/types.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
|
fund_eoa(amount=10 ** 21, label=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
279 280 281 282 283 |
|
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
285 286 287 288 289 290 291 292 |
|
AuthorizationTuple
¶
Bases: AuthorizationTupleGeneric[HexNumber]
Authorization tuple for transactions.
Source code in src/ethereum_test_types/types.py
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 |
|
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
533 534 535 536 537 538 539 540 541 542 543 |
|
sign(private_key)
¶
Signs the authorization tuple with a private key.
Source code in src/ethereum_test_types/types.py
545 546 547 548 549 550 551 552 553 |
|
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
24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
ConsolidationRequest
¶
Bases: ConsolidationRequestGeneric[HexNumber]
Consolidation Request type
Source code in src/ethereum_test_types/types.py
1182 1183 1184 1185 1186 1187 |
|
DepositRequest
¶
Bases: DepositRequestGeneric[HexNumber]
Deposit Request type
Source code in src/ethereum_test_types/types.py
1110 1111 1112 1113 1114 1115 |
|
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
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 |
|
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
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 |
|
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
53 54 55 56 57 58 59 |
|
Requests
¶
Bases: RootModel[List[DepositRequest | WithdrawalRequest | ConsolidationRequest]]
Requests for the transition tool.
Source code in src/ethereum_test_types/types.py
1190 1191 1192 1193 1194 1195 1196 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 |
|
to_serializable_list()
¶
Returns the requests as a list of serializable elements.
Source code in src/ethereum_test_types/types.py
1199 1200 1201 1202 1203 |
|
trie_root: Hash
cached
property
¶
Returns the root hash of the requests.
deposit_requests()
¶
Returns the list of deposit requests.
Source code in src/ethereum_test_types/types.py
1218 1219 1220 1221 1222 |
|
withdrawal_requests()
¶
Returns the list of withdrawal requests.
Source code in src/ethereum_test_types/types.py
1224 1225 1226 1227 1228 |
|
consolidation_requests()
¶
Returns the list of consolidation requests.
Source code in src/ethereum_test_types/types.py
1230 1231 1232 1233 1234 |
|
Storage
¶
Bases: RootModel[Dict[StorageKeyValueType, StorageKeyValueType]]
Definition of a storage in pre or post state of a test
Source code in src/ethereum_test_base_types/composite_types.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
|
StorageDictType: TypeAlias = Dict[str | int | bytes | SupportsBytes, str | int | bytes | SupportsBytes]
class-attribute
¶
Dictionary type to be used when defining an input to initialize a storage.
InvalidType
dataclass
¶
Bases: Exception
Invalid type used when describing test's expected storage key or value.
Source code in src/ethereum_test_base_types/composite_types.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
47 48 49 |
|
InvalidValue
dataclass
¶
Bases: Exception
Invalid value used when describing test's expected storage key or value.
Source code in src/ethereum_test_base_types/composite_types.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
64 65 66 |
|
MissingKey
dataclass
¶
Bases: Exception
Test expected to find a storage key set but key was missing.
Source code in src/ethereum_test_base_types/composite_types.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
80 81 82 |
|
KeyValueMismatch
dataclass
¶
Bases: Exception
Test expected a certain value in a storage key but value found was different.
Source code in src/ethereum_test_base_types/composite_types.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_base_types/composite_types.py
103 104 105 106 107 108 109 110 111 112 113 |
|
__contains__(key)
¶
Checks for an item in the storage
Source code in src/ethereum_test_base_types/composite_types.py
115 116 117 |
|
__getitem__(key)
¶
Returns an item from the storage
Source code in src/ethereum_test_base_types/composite_types.py
119 120 121 122 123 |
|
__setitem__(key, value)
¶
Sets an item in the storage
Source code in src/ethereum_test_base_types/composite_types.py
125 126 127 128 129 130 131 132 133 |
|
__delitem__(key)
¶
Deletes an item from the storage
Source code in src/ethereum_test_base_types/composite_types.py
135 136 137 |
|
__iter__()
¶
Returns an iterator over the storage
Source code in src/ethereum_test_base_types/composite_types.py
139 140 141 |
|
__eq__(other)
¶
Returns True if both storages are equal.
Source code in src/ethereum_test_base_types/composite_types.py
143 144 145 146 147 148 149 |
|
__ne__(other)
¶
Returns True if both storages are not equal.
Source code in src/ethereum_test_base_types/composite_types.py
151 152 153 154 155 156 157 |
|
__bool__()
¶
Returns True if the storage is not empty
Source code in src/ethereum_test_base_types/composite_types.py
159 160 161 |
|
__add__(other)
¶
Returns a new storage that is the sum of two storages.
Source code in src/ethereum_test_base_types/composite_types.py
163 164 165 166 167 |
|
keys()
¶
Returns the keys of the storage
Source code in src/ethereum_test_base_types/composite_types.py
169 170 171 |
|
set_next_slot(slot)
¶
Sets the next slot to be used by store_next
.
Source code in src/ethereum_test_base_types/composite_types.py
173 174 175 176 177 178 |
|
store_next(value)
¶
Stores a value in the storage and returns the key where the value is stored.
Increments the key counter so the next time this function is called, the next key is used.
Source code in src/ethereum_test_base_types/composite_types.py
180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
peek_slot()
¶
Peeks the next slot that will be used by store_next
.
Source code in src/ethereum_test_base_types/composite_types.py
194 195 196 197 198 |
|
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
200 201 202 203 204 205 206 207 208 209 210 211 212 |
|
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
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
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
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
|
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
254 255 256 257 258 259 |
|
Transaction
¶
Bases: TransactionGeneric[HexNumber]
, TransactionTransitionToolConverter
Generic object that can represent all Ethereum transaction types.
Source code in src/ethereum_test_types/types.py
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 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 |
|
InvalidFeePayment
¶
Bases: Exception
Transaction described more than one fee payment type.
Source code in src/ethereum_test_types/types.py
661 662 663 664 665 666 667 668 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_types/types.py
666 667 668 |
|
InvalidSignaturePrivateKey
¶
Bases: Exception
Transaction describes both the signature and private key of source account.
Source code in src/ethereum_test_types/types.py
670 671 672 673 674 675 676 677 678 |
|
__str__()
¶
Print exception string
Source code in src/ethereum_test_types/types.py
676 677 678 |
|
model_post_init(__context)
¶
Ensures the transaction has no conflicting properties.
Source code in src/ethereum_test_types/types.py
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 |
|
with_error(error)
¶
Create a copy of the transaction with an added error.
Source code in src/ethereum_test_types/types.py
746 747 748 749 750 751 752 |
|
with_nonce(nonce)
¶
Create a copy of the transaction with a modified nonce.
Source code in src/ethereum_test_types/types.py
754 755 756 757 758 |
|
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
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 |
|
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
1024 1025 1026 1027 1028 1029 1030 1031 1032 |
|
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
1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 |
|
created_contract: Address
cached
property
¶
Returns the address of the contract created by the transaction.