-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
start typing #161
base: typed-py-geth
Are you sure you want to change the base?
start typing #161
Conversation
geth/process.py
Outdated
return not self.geth_kwargs.get("ipc_disable", None) | ||
|
||
@property | ||
def ipc_path(self): | ||
def ipc_path(self) -> str: | ||
return self.geth_kwargs.get( |
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.
And here too. I think it might look something like this:
@property
def ipc_path(self) -> str:
return getattr(self.geth_kwargs, "ipc_path", os.path.abspath(
os.path.expanduser(
os.path.join(
self.geth_kwargs.data_dir,
"geth.ipc",
)
)
))
e8dcf11
to
27f4834
Compare
return is_same_path(data_dir, get_live_data_dir()) | ||
|
||
|
||
def is_ropsten_chain(data_dir): | ||
def is_ropsten_chain(data_dir: str) -> bool: | ||
return is_same_path(data_dir, get_ropsten_data_dir()) | ||
|
||
|
||
def write_genesis_file( |
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.
write_genesis_file
currently contains separate parameters clique_period
and clique_epoch
. But, the circleci output shows that the function receives a clique from GenesisData
, I can suppose, that containing both period and epoch. And I think, we should update signature to accepting a single clique
parameter
Like this:
def write_genesis_file(
...
clique: Optional[Dict[str, int]] = None,
):
...
if clique is None:
clique = {"period": 5, "epoch": 30000}
if config is None:
config = {
...
"clique": {"period": clique.get("period"), "epoch": clique.get("epoch")},
}
...
d2dff2a
to
a9d946b
Compare
Co-authored-by: David Dzhalaev <72649244+DavidRomanovizc@users.noreply.github.com> Co-authored-by: David Dzhalaev <72649244+DavidRomanovizc@users.noreply.github.com>
7831e9b
to
92c80f0
Compare
This is the initial experimental typing effort. Pay no attention to this PR, just here for reference. It will be closed, not merged.
What was wrong?
py-geth has no types!
Related to Issue #116
How was it fixed?
Added mypy and typed files.
Converted to using pydantic models for
GethKwargs
andGenesisData
.Todo:
Clean up commit history
clean TODOs
clean breakpoints
Add or update documentation related to these changes
Add entry to the release notes
Cute Animal Picture