Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef644ed

Browse files
authored
port #1098 and #1011 to forks/prague (#1102)
* port #1098 to prague * port #1011 to prague
1 parent ad81be4 commit ef644ed

File tree

5 files changed

+20
-13
lines changed

5 files changed

+20
-13
lines changed

.github/workflows/gh-pages.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
3434
- name: Upload Pages Artifact
3535
id: artifact
36-
uses: actions/upload-pages-artifact@v2
36+
uses: actions/upload-pages-artifact@v3
3737
with:
3838
path: .tox/docs
3939

@@ -46,6 +46,7 @@ jobs:
4646
permissions:
4747
pages: write
4848
id-token: write
49+
actions: read
4950

5051
environment:
5152
name: github-pages
@@ -54,4 +55,4 @@ jobs:
5455
steps:
5556
- name: Deploy to GitHub Pages
5657
id: deployment
57-
uses: actions/deploy-pages@v2
58+
uses: actions/deploy-pages@v4

src/ethereum/prague/fork.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
from ethereum_types.numeric import U64, U256, Uint
2121

2222
from ethereum.crypto.hash import Hash32, keccak256
23-
from ethereum.exceptions import InvalidBlock, InvalidSenderError
23+
from ethereum.exceptions import (
24+
EthereumException,
25+
InvalidBlock,
26+
InvalidSenderError,
27+
)
2428

2529
from . import vm
2630
from .blocks import Block, Header, Log, Receipt, Withdrawal, encode_receipt
@@ -453,7 +457,7 @@ def check_transaction(
453457

454458
def make_receipt(
455459
tx: Transaction,
456-
error: Optional[Exception],
460+
error: Optional[EthereumException],
457461
cumulative_gas_used: Uint,
458462
logs: Tuple[Log, ...],
459463
) -> Union[Bytes, Receipt]:
@@ -925,7 +929,7 @@ def process_general_purpose_requests(
925929

926930
def process_transaction(
927931
env: vm.Environment, tx: Transaction
928-
) -> Tuple[Uint, Tuple[Log, ...], Optional[Exception]]:
932+
) -> Tuple[Uint, Tuple[Log, ...], Optional[EthereumException]]:
929933
"""
930934
Execute a transaction against the provided environment.
931935

src/ethereum/prague/state.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
`EMPTY_ACCOUNT`.
1818
"""
1919
from dataclasses import dataclass, field
20-
from typing import Callable, Dict, Iterable, List, Optional, Set, Tuple
20+
from typing import Callable, Dict, List, Optional, Set, Tuple
2121

2222
from ethereum_types.bytes import Bytes, Bytes32
2323
from ethereum_types.frozen import modify
@@ -719,15 +719,15 @@ def set_transient_storage(
719719

720720

721721
def destroy_touched_empty_accounts(
722-
state: State, touched_accounts: Iterable[Address]
722+
state: State, touched_accounts: Set[Address]
723723
) -> None:
724724
"""
725725
Destroy all touched accounts that are empty.
726726
Parameters
727727
----------
728728
state: `State`
729729
The current state.
730-
touched_accounts: `Iterable[Address]`
730+
touched_accounts: `Set[Address]`
731731
All the accounts that have been touched in the current transaction.
732732
"""
733733
for address in touched_accounts:

src/ethereum/prague/vm/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from ethereum_types.numeric import U64, U256, Uint
2121

2222
from ethereum.crypto.hash import Hash32
23+
from ethereum.exceptions import EthereumException
2324

2425
from ..blocks import Log
2526
from ..fork_types import Address, Authorization, VersionedHash
@@ -95,7 +96,7 @@ class Evm:
9596
accounts_to_delete: Set[Address]
9697
touched_accounts: Set[Address]
9798
return_data: Bytes
98-
error: Optional[Exception]
99+
error: Optional[EthereumException]
99100
accessed_addresses: Set[Address]
100101
accessed_storage_keys: Set[Tuple[Address, Bytes32]]
101102

src/ethereum/prague/vm/interpreter.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
A straightforward interpreter that executes EVM code.
1313
"""
1414
from dataclasses import dataclass
15-
from typing import Iterable, Optional, Set, Tuple, Union
15+
from typing import Optional, Set, Tuple
1616

1717
from ethereum_types.bytes import Bytes, Bytes0
1818
from ethereum_types.numeric import U256, Uint, ulen
1919

20+
from ethereum.exceptions import EthereumException
2021
from ethereum.trace import (
2122
EvmStop,
2223
OpEnd,
@@ -83,10 +84,10 @@ class MessageCallOutput:
8384

8485
gas_left: Uint
8586
refund_counter: U256
86-
logs: Union[Tuple[()], Tuple[Log, ...]]
87+
logs: Tuple[Log, ...]
8788
accounts_to_delete: Set[Address]
88-
touched_accounts: Iterable[Address]
89-
error: Optional[Exception]
89+
touched_accounts: Set[Address]
90+
error: Optional[EthereumException]
9091
return_data: Bytes
9192

9293

0 commit comments

Comments
 (0)