Skip to content

various typing fixes #15899

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

Merged
merged 4 commits into from
Aug 18, 2023
Merged

various typing fixes #15899

merged 4 commits into from
Aug 18, 2023

Conversation

arvidn
Copy link
Contributor

@arvidn arvidn commented Jul 30, 2023

This PR adds type stubs for blspy and addresses mypy errors that resulted from it.

There are 3 lines missing coverage:

chia/full_node/full_node.py (0.0%): Missing lines 1297

This is a trivially correct change (I think). It's encoding an invariant we have in FullBlock as an assert.
This function seems simple to break out and unit test, which we should do in the future.

chia/rpc/wallet_rpc_api.py (0.0%): Missing lines 2257

This is a typo in the DID recovery code. It should have a test. Matt reviewed the change and said it looks good. I think it's a fairly trivially correct change.

tests/util/benchmark_cost.py (0.0%): Missing lines 116

We don't instrument benchmarks for coverage. And we probably don't even run this benchmark in CI, since this was another trivial typo.

@arvidn arvidn added Fixed Required label for PR that categorizes merge commit message as "Fixed" for changelog Cleanup Code cleanup labels Jul 30, 2023
@arvidn
Copy link
Contributor Author

arvidn commented Jul 31, 2023

chia/full_node/full_node.py (0.0%): Missing lines 1297
chia/rpc/wallet_rpc_api.py (0.0%): Missing lines 2257
tests/util/benchmark_cost.py (0.0%): Missing lines 116

This is a benchmark. We probably don't run it on CI, but even if we did, we don't instrument benchmarks for coverage

@github-actions github-actions bot added the merge_conflict Branch has conflicts that prevent merge to main label Jul 31, 2023
@github-actions

This comment was marked as outdated.

@github-actions github-actions bot removed the merge_conflict Branch has conflicts that prevent merge to main label Jul 31, 2023
@github-actions

This comment was marked as outdated.

@arvidn arvidn marked this pull request as ready for review August 1, 2023 19:00
@arvidn arvidn requested a review from a team as a code owner August 1, 2023 19:00
@arvidn arvidn requested a review from altendky August 1, 2023 19:13
@arvidn arvidn force-pushed the typing-fixes branch 2 times, most recently from 24e1212 to c3a5ab0 Compare August 2, 2023 09:25
@arvidn

This comment was marked as resolved.

@arvidn arvidn force-pushed the typing-fixes branch 3 times, most recently from cf9c319 to 82853e1 Compare August 3, 2023 07:14
Copy link
Contributor

@altendky altendky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not excited about adding type stubs here for other packages, but I'm also not driving the future of these libs. The asserts in the runtime code aren't great, but are also in keeping with our practices.

Other than above and my couple inline comments I'm ok with this. Someone familiar with the actual code changes should review them specifically.

Copy link
Contributor

@rostislav rostislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@github-actions
Copy link
Contributor

File Coverage Missing Lines
chia/cmds/keys_funcs.py 87.5% lines 747
chia/full_node/full_node.py 0.0% lines 1297
chia/rpc/wallet_rpc_api.py 0.0% lines 2287
tests/util/benchmark_cost.py 0.0% lines 116
Total Missing Coverage
41 lines 4 lines 90%

@coveralls-official
Copy link

Pull Request Test Coverage Report for Build 5890253647

  • 37 of 40 (92.5%) changed or added relevant lines in 16 files are covered.
  • 10 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.03%) to 88.848%

Changes Missing Coverage Covered Lines Changed/Added Lines %
chia/cmds/keys_funcs.py 7 8 87.5%
chia/full_node/full_node.py 0 1 0.0%
tests/util/benchmark_cost.py 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
chia/full_node/full_node_api.py 1 77.03%
chia/full_node/full_node.py 1 85.75%
chia/timelord/timelord_launcher.py 1 61.9%
chia/wallet/util/wallet_sync_utils.py 1 67.27%
chia/wallet/wallet_node.py 6 87.11%
Totals Coverage Status
Change from base Build 5886127374: 0.03%
Covered Lines: 85146
Relevant Lines: 95751

💛 - Coveralls

@arvidn arvidn requested a review from paninaro August 17, 2023 16:43
Copy link
Contributor

@paninaro paninaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@arvidn arvidn added the ready_to_merge Submitter and reviewers think this is ready label Aug 17, 2023
@wallentx wallentx merged commit 7b0bea4 into main Aug 18, 2023
@wallentx wallentx deleted the typing-fixes branch August 18, 2023 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup Code cleanup Fixed Required label for PR that categorizes merge commit message as "Fixed" for changelog ready_to_merge Submitter and reviewers think this is ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants