-
Notifications
You must be signed in to change notification settings - Fork 146
Update mypy and fix type hints #506
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,10 +30,9 @@ | |
RPCServer, | ||
) | ||
from trinity.rpc.modules import ( | ||
BeaconChainRPCModule, | ||
BaseRPCModule, | ||
initialize_beacon_modules, | ||
initialize_eth1_modules, | ||
Eth1ChainRPCModule, | ||
) | ||
from trinity.rpc.ipc import ( | ||
IPCServer, | ||
|
@@ -60,7 +59,7 @@ def configure_parser(self, arg_parser: ArgumentParser, subparser: _SubParsersAct | |
help="Disables the JSON-RPC Server", | ||
) | ||
|
||
def setup_eth1_modules(self, trinity_config: TrinityConfig) -> Tuple[Eth1ChainRPCModule, ...]: | ||
def setup_eth1_modules(self, trinity_config: TrinityConfig) -> Tuple[BaseRPCModule, ...]: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since these methods are specifically returning this subset of modules, can't/shouldn't they be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't actually know. I'll spend a bit more time understanding why we have the two types. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looking at it, it doesn't appear to matter. Each of these functions return values are fed into |
||
db_manager = create_db_consumer_manager(trinity_config.database_ipc_path) | ||
|
||
eth1_app_config = trinity_config.get_app_config(Eth1AppConfig) | ||
|
@@ -80,7 +79,7 @@ def setup_eth1_modules(self, trinity_config: TrinityConfig) -> Tuple[Eth1ChainRP | |
|
||
return initialize_eth1_modules(chain, self.event_bus) | ||
|
||
def setup_beacon_modules(self) -> Tuple[BeaconChainRPCModule, ...]: | ||
def setup_beacon_modules(self) -> Tuple[BaseRPCModule, ...]: | ||
|
||
return initialize_beacon_modules(None, self.event_bus) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed because of the weird
@to_tuple
mypy bug in we're seeing in eth-utils?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this one. I'll update with a code comment: ethereum/eth-utils#152