Skip to content

Commit 04ad41c

Browse files
authored
Move SpoofTransaction out of private namespace (#1662)
* Move SpoofTransaction out of private namespace * fix import path * fix tests import * import
1 parent d4c4f1f commit 04ad41c

File tree

6 files changed

+20
-36
lines changed

6 files changed

+20
-36
lines changed

eth/_utils/spoof.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,3 @@ def copy(self: T, **kwargs: Any) -> T:
5959
new_target = self.spoof_target.copy(**kwargs)
6060
new_overrides = merge(self.overrides, kwargs)
6161
return type(self)(new_target, **new_overrides)
62-
63-
64-
class SpoofTransaction(SpoofAttributes):
65-
def __init__(self, transaction: BaseTransaction, **overrides: Any) -> None:
66-
super().__init__(transaction, **overrides)

eth/estimators/gas.py

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
1-
from typing import (
2-
Optional,
3-
)
1+
from typing import Optional
42

5-
from cytoolz import (
6-
curry,
7-
)
3+
from eth_utils.toolz import curry
84

9-
from eth.exceptions import (
10-
VMError,
11-
)
5+
from eth.exceptions import VMError
126

13-
from eth.rlp.transactions import (
14-
BaseTransaction,
15-
)
16-
17-
from eth._utils.spoof import (
18-
SpoofTransaction,
19-
)
20-
21-
from eth.vm.state import (
22-
BaseState,
23-
)
7+
from eth.rlp.transactions import BaseTransaction
8+
from eth.vm.spoof import SpoofTransaction
9+
from eth.vm.state import BaseState
2410

2511

2612
def _get_computation_error(state: BaseState, transaction: SpoofTransaction) -> Optional[VMError]:

eth/typing.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,9 @@
2525
)
2626

2727
if TYPE_CHECKING:
28-
from eth.rlp.transactions import ( # noqa: F401
29-
BaseTransaction
30-
)
31-
from eth._utils.spoof import ( # noqa: F401
32-
SpoofTransaction
33-
)
34-
from eth.vm.base import ( # noqa: F401
35-
BaseVM
36-
)
28+
from eth.rlp.transactions import BaseTransaction # noqa: F401
29+
from eth.vm.spoof import SpoofTransaction # noqa: F401
30+
from eth.vm.base import BaseVM # noqa: F401
3731

3832

3933
# TODO: Move into eth_typing

eth/vm/spoof.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from typing import Any
2+
3+
from eth.rlp.transactions import BaseTransaction
4+
from eth._utils.spoof import SpoofAttributes
5+
6+
7+
class SpoofTransaction(SpoofAttributes):
8+
def __init__(self, transaction: BaseTransaction, **overrides: Any) -> None:
9+
super().__init__(transaction, **overrides)

tests/core/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from eth.chains.base import MiningChain
1313

14-
from eth._utils.spoof import (
14+
from eth.vm.spoof import (
1515
SpoofTransaction,
1616
)
1717

trinity/rpc/modules/eth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from eth.rlp.headers import (
3434
BlockHeader
3535
)
36-
from eth._utils.spoof import (
36+
from eth.vm.spoof import (
3737
SpoofTransaction,
3838
)
3939
from eth.vm.state import (

0 commit comments

Comments
 (0)