Commit Graph

44 Commits

Author SHA1 Message Date
Amine Khaldi
3cade8afd8
Type check mempool_item.py (#14088) 2022-12-08 14:01:46 -06:00
Arvid Norberg
d330691db1
move mempool tests from full_node to mempool directory (#14056) 2022-12-07 20:49:13 -06:00
dustinface
898543b874
server: Enable and fix mypy for all chia.server files (#13990)
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-11-28 18:00:45 -06:00
Almog De Paz
efb670cf1b
Setup services mypy (#13932) 2022-11-22 17:01:01 -06:00
dustinface
9b1989b014
Enable and fix mypy in server.py (#13579)
* server: Enable and fix `mypy` in `server.py`

* Add a comment about the `Message` hint

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Tweak assert message

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Make `name` non-optional

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Properly reject incoming connections to crawlers

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Hint `StreamResponse` and return the existing `WebSocketResonse`

* Raise if `remote` is `None`

* Restore old behaviour: succeed, don't fail for self connection

* Raise `HTTPInternalServerError` if `remote` is `None`

* Cast config values to `int`

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-11-18 10:43:14 -06:00
Kyle Altendorf
69a4fe025d
warn_redundant_casts = True (#13922) 2022-11-15 18:52:04 -06:00
Almog De Paz
ac2203eda8
Refactor test utils for import availability outside of repo (#13880)
* refactor for import availability outside of repo

* refactor for import availability outside of repo

* small revert

* newline

* fix imports

* fix pre-commit issues

* types issort, adapt mypy ignore

* redundant imports

* move files from util to simulator

* run pre_commit

* remove setup_nodes/keyring from isort.cfg

* fix asyncio import
2022-11-15 18:51:05 -06:00
dustinface
2706f5995b
server: Enable and fix mypy in ws_connection.py (#13878)
* server: Enable and fix `mypy` in `ws_connection.py`

* Apply suggestions from code review

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Tweak error message

* Tweak formatting

* Make `WSChiaConnection.close_callback` optional

* Tweak assert message

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Don't provide a default for `close_callback`

* Adjust assertion

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-11-12 14:18:11 -06:00
Kyle Altendorf
095b9c337e
adjustments for new mypy (#13859)
* adjustments for new mypy

* assert something
2022-11-07 17:38:40 -06:00
Kyle Altendorf
8436e6a17a
Confirm equality of client and server RPC routes (#11765)
* Confirm equality of client and server RPC routes

* Update rpc.py

* hints

* Update rpc.py

* Update mypy.ini

* Update rpc_server.py

* Update tests/util/rpc.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2022-09-26 11:18:46 -05:00
Matt Hauff
2de55aff17
Remove rl wallet (#13429)
* remove all references to RL wallet

* Missed one

* Some new references from main

* Fix is_transaction_confirmed

* mypy

* check for 'confirmed'

* Try again to fix is_transaction_confirmed

* remove from mypy.ini
2022-09-13 17:07:29 -05:00
Mariano Sorgente
87a3e93cc4
Ms.mypy enable (#13320)
* Remove mempool.additions

* Don't re run the program, and remove program from mempool item

* Removals only stores item ids, and stores a list

* Move pending cache down to prevent cache dos

* Separate validation from adding to pool, and remove mypy exceptions

* Fix bug with replacing

* Add to mypy

* Revert cbgui

* precommit fail

* Properly update the seen dict

* lint error

* Fix mempool bug

* Enable mypy for a bunch of files

* Update after merge with main

* 99/260 remaining

* Address comments

* Enable more mypy

* Merge conflict mypy file

* More fixes

* pytest.ini and cb-gui

* One more flake8 fix

* Flake8 and tests

* More test fixes

* isort

* Make LGTM happy

* Update chia/full_node/block_store.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Update chia/full_node/full_node_store.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Update chia/wallet/util/peer_request_cache.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Apply all suggestions from PR comments

* Revert cb-gui

* 100 back to 1000, minor tweaks

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-09-08 12:57:15 -05:00
Mariano Sorgente
8ef4c980b3
Ms.mempool simplify (#13314)
* Remove mempool.additions

* Don't re run the program, and remove program from mempool item

* Removals only stores item ids, and stores a list

* Move pending cache down to prevent cache dos

* Separate validation from adding to pool, and remove mypy exceptions

* Fix bug with replacing

* Add to mypy

* Revert cbgui

* precommit fail

* Properly update the seen dict

* lint error

* Fix mempool bug

* Update after merge with main

* Address comments
2022-09-06 12:32:03 -05:00
Arvid Norberg
0a433b3368
minor fixes for Serialized program (#13229)
* use bytearray to build a binary blob, convert it to bytes once it's done

* load the bootstrap generator rom in binary form directly, avoid conversions
2022-09-02 17:08:20 -05:00
Arvid Norberg
31b5340001
enable mypy for a some wallet files (#13185)
* enable mypy for chia/wallet/trading/offer.py

* enable mypy for chia/wallet/trade_manager.py
2022-08-26 14:25:11 -05:00
Amine Khaldi
c62c67044c
Remove the wallet action store and adapt what depended on it. (#13015) 2022-08-17 17:50:04 -05:00
Arvid Norberg
415006235d
enable mypy for nft wallet (#12999) 2022-08-17 09:54:59 -05:00
Arvid Norberg
5b56a562ed
cat_wallet mypy fixes (#12998)
* enable mypy for cat_utils

* mypy fixes for cat_wallet

* mypy fixes for cat_wallet.lineage_proof

* Update chia/wallet/cat_wallet/cat_utils.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-08-17 01:01:21 -05:00
dustinface
84b0da7587
plotters: Move install_plotter into plotters (#12403) 2022-08-15 12:18:55 -05:00
Jack Nelson
ff8ecb35a0
Fix no keys loaded error by making KeychainProxy automatically reconnect when a connection is lost (#12782)
* Add proper types to daemon client & keychain

* pre type pass on keychain proxy

* add auto restarting keychain proxy

* finalize keychain proxy v2

* move event calls

* fix close on timeout

* fix possible key leak in logging

* fix last little error

* log on disconnection & reduce duplicate code

* Update client.py
2022-08-04 20:28:58 -05:00
dustinface
fc2498885f
util: Enable isort and more mypy in file_keyring.py (#12531)
Co-Authored-By: Kyle Altendorf <sda@fstab.net>

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-07-28 14:07:27 -05:00
Jack Nelson
0bc54ae08b
Move simulator test requirements over to new module (#12521)
* create new test.simulator module

to allow other packages to use the simulator without it crashing.
also tiny QOL fixes

* change user mode sim plot filter

Now only plots matching the user set fingerprint are loaded, this decreases the chance of user error.

* fix small oops in configure

* oops

* fix lint

* isort, who dis

* move folder over to chia/simulator

also change mypy settings again
2022-07-25 14:07:38 -05:00
Kyle Altendorf
749162d9fe
hint chia.clvm.spend_sim (#11819)
* hint chia.clvm.spend_sim

* adjust comments

* undo

* Created typo corrected to create
2022-06-29 04:34:41 -05:00
dustinface
0fd2dd66fc
rpc: Enable more mypy in chia.rpc.rpc_server (#11928) 2022-06-28 11:42:20 -05:00
Kyle Altendorf
890da94024
Hint and lightly refactor chia.server.upnp.UPnP (#11816)
* Hint and lightly refactor chia.server.upnp.UPnP

* Remove chia.server.upnp from mypy.ini lax rules

* black

* Revert the pointless int for shutdown

* isort

* from __future__ import annotations
2022-06-08 10:25:42 -05:00
Amine Khaldi
11c36a2113
Test. 2022-06-01 14:29:49 +01:00
Kronus91
662c60da38
Extend on chain metadata update/API (#11585)
* Extend on chain metadata update/API

* Resolve comments

* Suppress rasing exception in rpc api

* Split artist address to royalty & target address

* Refine NFTInfo

* Fix tests

* Return disassembled metadata & optimize chialisp

* Fix clvm tests

* suppress untyped erro

* Change updater

* Fix clvm test
2022-05-25 12:34:40 -07:00
xdustinface
3ee55045fd
Merge remote-tracking branch 'chia/main' into pr-main-dids-catchup 2022-05-19 13:02:56 +02:00
Kyle Altendorf
cb5470b806
hints and strict type checking for test_wallet (#11541)
* hints and strict type checking for test_wallet

* fixup

* flip flop
2022-05-18 09:12:39 -07:00
Kyle Altendorf
f9226fb60d
rename test files that are missing test_ prefix (#10712)
* rename test files that are missing test_ prefix

* update mypy and isort excludes

* skip test_get_host_addr6() in GitHub Actions under macOS

* rebuild workflows
2022-05-16 09:51:00 -07:00
Kyle Altendorf
7c91f470f4
simplify SizedBytes and StructStream (#11429)
* simplify SizedBytes and StructStream

* lint

* super()  !!!

* do not pass parameter up to super().__init__()

* Update chia/util/struct_stream.py

Co-authored-by: Arvid Norberg <arvid@libtorrent.org>

* parse fixed-width int data from class name

* add int512 and uint128 .from_bytes(), test .parse() failures

* test serialization against struct.pack()

* use typing_extensions for final

* override ignore

* stop using struct for StructStream

oh the irony

* fixup .to_bytes() to accept parameters again for where we use that

* bring back signed parameter

* format

* adjust tests for new exception

* eliminate custom coding for uint128 and int512

* tidy

* remove unused StructStream.PACK attribute

* add direct tests for parse_metadata_from_name()

* stricter hinting

* remove no-longer-needed typeshed work-around

* apply strict type checking to all touched files

* remove StructStream override of .to_bytes()

* tidy

* types touchup

* add unused parameter comments

Co-authored-by: Arvid Norberg <arvid@libtorrent.org>
Co-authored-by: wjblanke <wjb98672@gmail.com>
2022-05-14 02:05:27 -07:00
Mariano Sorgente
d1e445fac2
Ms.mypy consensus (#11403)
* Mypy for consensus dir (Except blockchain.py)

* Finish up consensus folder mypy

* Lint

* isort

* lint

* awaitable over coroutine

* less Any

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-05-12 15:21:47 -07:00
Kyle Altendorf
28eaf46b3e
Merge branch 'main' into main_dids-merge_cleanup_test 2022-04-27 12:11:15 -04:00
dustinface
79cbadf987
streamable: Enable isort + more mypy (#10539)
* isort: Fix `streamable.py` and `test_streamable.py`

* mypy: Drop `streamable.py` and `test_streamable.py` form exclusion

And fix all the mypy issues.

* Fix `pylint`

* Introduce `ParseFunctionType` and `StreamFunctionType`

* Use `object` instead of `Type[Any]` for `is_type_*` functions

* Some `Any` -> `object`

* Use `typing.overload` for `recurse_jsonify`

* Move some comments

* Drop `Union`, use `Literal` properly

* Explicitly ignore the return of `f_type.parse`

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Merge two `recurse_jsonify` overloads

* Typing for the base definition of `recurse_jsonify`

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-04-20 11:09:41 -07:00
Jeff
e5d048f1de
Merge commit with main (9ff3fc993f) (#11137)
* Merged with main (9ff3fc993f)

* Linter and some test fixes

* isort, linting, test fix

* Fixes and bumped the GUI to point to nftdev

* Couple of fixes
2022-04-14 12:02:42 -07:00
dustinface
a48fd43100
streamable: Simplify and force correct usage (#10509)
* streamable: Merge `strictdataclass` into `Streamable` class

* tests: Test not supported streamable types

* streamable: Reorder decorators

* streamable: Simplify streamable decorator and force correct usage/syntax

* streamable: Just move some stuff around in the file

* streamable: Improve syntax error messages

* mypy: Drop `type_checking.py` and `test_type_checking.py` from exclusion

* streamable: Use cached fields instead of `__annotations__`

This is now possible after merging `__post_init__` into `Streamable`

* Introduce `DefinitionError` as `StreamableError`

* `/t` -> `    `
2022-04-08 18:29:32 -07:00
dustinface
0917d0ae78
wallet: Drop puzzles/genesis_checkers.py and related puzzles (#10790)
Its all duplicated code and puzzles as far as i can tell, see 
`chia/wallet/puzzles/tails.py`.
2022-04-07 09:19:37 -07:00
Adam Kelly
7bbfa30a24
Ak.setup nodes (#10619)
* Remove unused test code

* Centralize fixture uses of setup_n_nodes

* Centralize fixure uses of setup_two_nodes

* Break up setup_nodes into setup_services, for individial services, and setup_nodes, for initializing different simulator configurations

* Sort imports
2022-03-16 11:47:54 -07:00
Mariano Sorgente
7fb26a7a14
Ms.unused code (#10453)
* Remove old backup stuff

* Remove references to CC (couloured coins) which is deprecated terminology

* removed no longer used import

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-02-27 23:34:37 -05:00
Kyle Altendorf
8a5c125418
apply stricter mypy to all new files (#10133)
* just put __init__.py files where we have .py files

* and the rest

* remove unused ignore

* update mypy ignore list

* remove chia.util.clvm pass-through file

* import ConsensusConstants from actual definition

* in tests too

* import ConditionOpcode from actual definition

* a little less ignore

* update mypy reduced-strictness set

* update mypy reduced-strictness set
2022-02-20 21:32:23 -08:00
Kyle Altendorf
bf01b58cb4
tweak mypy config (#9368)
* tweak mypy config

* add types-click to pre-commit
2021-11-24 13:06:39 -08:00
Kyle Altendorf
1073f9d5dd
mypy: warn_unused_ignores = true (and remove some) (#9085)
* mypy: warn_unused_ignores = true (and remove some)

* catch up

* type checking tweaks

* precommit uses mypy --no-warn-unused-ignores

* revert a bit

* precommit explanatory comment

* Update .pre-commit-config.yaml

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2021-11-23 12:44:53 -08:00
Mariano Sorgente
d4051b72b9 Ms.fixtest (#432)
* New chiapos API

* Fix flake

* Move to chiapos 0.12.30 to fix segfaults

* Black

* change stripe size to 2000

* chiavdf to 0.12.25

* Revert "chiavdf to 0.12.25"

This reverts commit f7f596ce16.
chiavdf has a timelord compile error on MacOS.

* Increase default -b

* Plotter GUI test

Co-authored-by: Gene Hoffman <hoffmang@hoffmang.com>
Co-authored-by: Yostra <straya@chia.net>
2020-10-01 11:07:12 -07:00
Mariano Sorgente
0fef0b933e Changed to mypy from pyright, fix tests (full node still broken) 2019-10-22 16:44:01 +09:00