Commit Graph

5675 Commits

Author SHA1 Message Date
Kyle Altendorf
aead84a346
less optional around ssl (#10558)
* less optional

* clean up cruft

* more

* more

* just a little less optional
2022-03-17 09:06:22 -07:00
Amine Khaldi
6e499e0e62
Improve the CI runs w.r.t. timelord installation (#10673)
* Superficial analysis showed that only two test groups require (for now) installing the timelord. This change aims to save us hours of CI running time by simply running the install timelord script only for those test groups, with everything else having it omitted. Dedicated to @hoffmang9

* We don't need these anymore.
2022-03-17 09:05:33 -07:00
Kyle Altendorf
1c8e4aef10
Use the passed root_path in configure CLI command (#10694) 2022-03-17 09:04:47 -07:00
Kyle Altendorf
48cd97cf47
minor followup to config locking (#10696)
* minor lock scope reduction

* use the lock in tests
2022-03-17 09:03:58 -07:00
ChiaMineJP
42fff8e773
Issues found in RPC API review (#10702)
* Removed unnecessary substitution

* Recovered  property which was accidentally removed in full node RPC API

* Added backward compatibility to `get_additions_and_removals` full_node RPC API

* Fixed full_node rpc client
2022-03-17 09:03:30 -07:00
Kyle Altendorf
f5d692f5c3
require test-cache repo is found in CI (#10711) 2022-03-17 09:02:41 -07:00
Freddie Coleman
687ea720e3
New RPC get_coin_records_by_hint - Get coins for a given hint (#10715)
* RPC endpoint to retrieve coins by hint

* RPC client update for get_coin_records_by_hint

* start writing tests for get_coin_records_by_hint

* Address linting concerns.

* Address flake8. Fix the get_coin_ids() call.

* convert hint to bytes32

* tests for get_coin_records_by_hint

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2022-03-17 08:48:09 -07:00
Arvid Norberg
cd83a9ecde
fix typo in command line argument parsing for chia db validate (#10716) 2022-03-17 08:47:31 -07:00
Dave
073dc941f0
Fix typos lastest > latest (#10720) 2022-03-17 08:47:02 -07:00
Brandon Butler
6c5d7e7e89
Add healthcheck endpoint to rpc services (#10718)
* Add healthcheck endpoint to rpc services

* Trailing whitespace ding
2022-03-17 08:45:48 -07:00
Jeff
82e8b7dea5
Add maker fee to remaining offer RPCs (#10726) 2022-03-17 08:45:06 -07:00
Kyle Altendorf
7850f7355a
mypy 0.941 for pre-commit (#10728) 2022-03-17 08:44:28 -07:00
dustinface
e0c53864f5
harvester: Reuse legacy refresh interval if new params aren't available (#10729) 2022-03-17 08:43:53 -07:00
dustinface
66c7427622
wallet: Optional wallet type parameter for get_wallets and wallet show (#10739)
* wallet: Add optional `type` parameter to `get_wallets` and `wallet show`

* tests: Use the `type` parameter for `get_wallets` in pool rpc tests

* cmds: Ask for the name of the wallet type in CLI
2022-03-17 08:42:48 -07:00
dustinface
25630d3e7f
wallet: Fix STANDARD_WALLET creation for wallet_info.id != 1 (#10757) 2022-03-17 08:41:54 -07:00
dustinface
d127898ce8
cmds: Implement chia rpc command (#10763)
* cmds: Implement `chia rpc` command

* Enable "timelord" client + some refactoring to enable "crawler" client
2022-03-17 08:40:54 -07:00
Adam Kelly
37843ee044
Change name to order of returned values. Enforce mandatory naming and inclusion of start_services parameter (#10769) 2022-03-17 08:39:30 -07:00
Arvid Norberg
0e956c8b5a
run benchmarks separately (#10754)
* run benchmarks separately

* only run benchmarks once, with the most recent python version we support
2022-03-17 08:36:51 -07:00
William Allen
bf2976a2a9
Updating Changelog for point release (#10781)
* Updating Changelog for point release

* Adding missing changelog items
2022-03-16 17:08:33 -07:00
Kyle Altendorf
da6f668f0c
update chia-blockchain-gui one commit for npm build fix (#10776) 2022-03-16 16:21:46 -07:00
Arvid Norberg
7bab39161f
more entropy in random listen ports (#10743) 2022-03-16 12:03:56 -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
Adam Kelly
185a483d0d
Remove unused test code (#10614) 2022-03-15 10:33:33 -07:00
Adam Kelly
aa7123053b
Convert helper method do_spend from a class method to a function (#10613) 2022-03-15 10:33:05 -07:00
Jeff
fc453e637c
Fixed test failures on Windows. (#10740) 2022-03-15 09:59:27 -07:00
dustinface
0036118177
tests: Add _PYTEST_RAISE to fix exception breakpoints with pytest (#10487)
It's currently not possible to have the debuger stop on an uncaucht 
exception when debugging tests. With this patch, adding 
`_PYTEST_RAISE=1` to the environment variables in the pytest 
configuration template fixes this.
2022-03-15 06:08:29 -07:00
William Blanke
622cdeb396
updated gui to c992d07c95 2022-03-14 13:10:16 -07:00
Kyle Altendorf
c63324abe9
remove some event_loop() fixtures (#10420)
* remove event_loop() fixtures

* flake8

* flake8

* remove sys.exit() from daemon shutdown

* bump full node test timeout.  a lot...  to see.

* fixup some tests

* back to module scope event loop fixture for test_full_node.py

* Update test_full_node.py

* Iterator...

* for the whole directory

* some fixtures back to module scope for reduced runtime

* back to 40 minute workflow timeouts

* these are being addressed separately
2022-03-14 06:08:35 -07:00
Kyle Altendorf
4915477fcb
bump pre-commit mypy to 0.940 (#10672) 2022-03-14 06:08:05 -07:00
Arvid Norberg
773d692fc5
fix usage of the bt fixture in conftest fixtures (#10688) 2022-03-12 10:40:52 -08:00
Kyle Altendorf
dbeff36ae0
Add configuration locking (#10680)
* Add configuration locking

Extracted from https://github.com/Chia-Network/chia-blockchain/pull/10631

* note that fasteners will likely be replaced by filelock

* Fix test_multiple_writers on macOS

* create_all_ssl() doesn't need to be inside the config access lock

* add warnings about not using async within get_config_lock() get lock contexts

* no need to pre-touch the lock file

* .yaml.lock instead of just .lock

* test_multiple_writers() is sync

* Revert "add warnings about not using async within get_config_lock() get lock contexts"

This reverts commit 681af3835b.

* reduce lock context size in chia_init()

* use an exit stack in load_config()

* avoid config existence precheck

* only lock around the read in load_config()

* do not raise e, just raise

* tidy new imports

* fix queue empty check in test_config.py

* remove commented out code in test_config.py

* remove unused import

Co-authored-by: Jeff Cruikshank <jeff@chia.net>
2022-03-12 06:52:47 -08:00
Earle Lowe
19ee652d73
better TLS1.3 check (#10552)
* better TLS1.3 check

* catch ValueError instead of Exception

* Code simplification and cleanup

* a few nits in comments
2022-03-11 18:52:00 -08:00
Jeff
184920a55c
Better management of KeyringWrapper's keys_root_path when using TempKeyring for tests (#10636)
* Better management of KeyringWrapper's keys_root_path when using TempKeyring for tests.

* Move keys_root_path restoration code into `cleanup()`
Added an assert to detect if an unexpected shared KeyringWrapper is injected during a test.

* Conditionally restore keys_root_path for testing
2022-03-11 18:48:45 -08:00
William Blanke
917fb5db4c
updated gui to cdfa2b9821 2022-03-11 18:04:07 -08:00
Adam Kelly
70639be906
Ak.convert fixtures (#10612)
* Use bt fixture

* rebase

* Use local_hostname

* flake8

* Remove set_shared_instance

* Remove unneeded comments

* Revert unrelated change

* Add back type signature - rebase issue

* Correct type for _configure_legacy_backend

* See what's going on during CI mypy run

* github workflows

* mypy typing

* Remove legacy Keyring create method

* Start daemon first

* Set chia-blockchain-gui to hash in main

* Fix two test files that were not importing self_hostname

* self_hostname fixture

* Convert all class fixtures to top level functions
2022-03-11 16:26:54 -08:00
Chris Marslender
efdff0adba
Check prefix on send_transaction before sending (#10566)
* Check prefix on send_transaction

* Fix failing RPC tests - xch -> txch since tests are a testnet and we enforce valid prefixes with this PR
2022-03-11 16:25:55 -08:00
Chris Marslender
230b785d3a
Slightly different query for V2 DBs for getting compact/uncompact block counts, to ensure the available index is used / avoid a table scan (#10661) 2022-03-11 16:24:58 -08:00
Jeff
75ed1307e5
Fix exception when chia keys migrate is run without needing migration (#10655)
* Fix exception when `chia keys migrate` is run without needing migration

* Linter fixes
2022-03-11 16:23:24 -08:00
dustinface
0bf370c642
plotting: Only lock while actually accessing PlotManager.plots (#10675) 2022-03-11 16:23:01 -08:00
austinsirkin
caaf7f40e1
Version control (#10479)
* Added version control enforcement to macOS m1

* Added enforced version control

* Added enforce version compliance

* Added enforced version compliance

* Added enforced versioning

* Updating this to include DRY internal action.

* Removed some unintended whitespace.

* Removed some unintended whitespace.

* CI re-run

* Trying to figure out why it's failing one test.

* Trying to figure out why it's failing one test.

* Trying to figure out why it's failing one test.
2022-03-11 15:57:35 -07:00
Don Kackman
ef4224d9e4
fix [Bug] #10569 (#10571) 2022-03-10 11:25:28 -08:00
Don Kackman
7c717853a1
correct spelling of genrated (#10653) 2022-03-10 11:11:30 -08:00
Mariano Sorgente
fe964a48bd
Fix invalid DB commit (#10594)
* Fix invalid DB commit

* More fixes

* Add raise

* Fix test
2022-03-10 11:11:04 -08:00
Johannes Tysiak
e8ff5a32a7
fix initial-config typo - log_maxbytesrotation (#10598) 2022-03-10 11:10:28 -08:00
dustinface
7a8cae2936
pools: Fix plotnft claim command's output (#10609)
If you currently claim rewards `claim_cmd` fails to print the txhash 
with the lookup hint in `submit_tx_with_confirmation`

```
Error performing operation on Plot NFT -f 172057028 wallet id: 12: 
'dict' object has no attribute 'name'
```

Because `submit_tx_with_confirmation` expects a `TransactionRecord` as 
result from its callable parameter `func` but `pw_absorb_rewards` 
returns a dict which includes the `TransactionRecord` as value for the 
key `transaction`. This PR makes sure all other methods used as `func` 
callable have the same return behaviour as `pw_absorb_rewards`. We could 
have adjusted it the other way around (only return `TransactionRecord` 
in `pw_absorb_rewards`) but then we would drop information in the RPC 
client.  


With this PR you get:

```
Do chia wallet get_transaction -f 172057028 -tx 
0x34f74a1ffd9da9a493b78463e635996fd03d4f805ade583acb9764df73355f9c to 
get status
```
2022-03-10 11:10:03 -08:00
Jeff
88f7c6bd83
chia keys show will default to displaying the first observer-derived wallet address. With the addition of the -d option, the non-observer derived wallet address can be displayed. (#10615) 2022-03-10 11:09:29 -08:00
Arvid Norberg
5b0fb70d97
a problem with using random.randint() to pick a port is that all processes (running in parallel) are seeded the same, and so pick the same ports at the same time, causing conflicts. This uses proper entropy instead. (#10621) 2022-03-10 11:08:30 -08:00
Adam Kelly
ff324095cc
Remove block tools and keychain globals (#10358)
* Use bt fixture

* rebase

* Use local_hostname

* Fix test_json (inheritance from unittest.TestCase)

* Use correct BlockTools fixture for test_simulation

* Pass bt fixture into cost calculation tests

* flake8

* Add missing parameters to test functions

* Fix from rebase issues

* Remove set_shared_instance

* Update comment

* Remove unneeded comments

* Remove unused code

* Remove unused code, run `multiprocessing.set_start_method("spawn")` at correct time.

* Revert unrelated change

* Set daemon_port. Teardown services in correct order.
    BIG thanks to Mariano Sorgente for debugging help.

* Add back type signature - rebase issue

* Apply review fixes from Jeff

* Document why we need a later pytest-asyncio version

* Correct type for _configure_legacy_backend

* See what's going on during CI mypy run

* github workflows

* mypy typing

* Remove legacy Keyring create method

* Start daemon first

* Shutdown daemon coroutine properly

* Remove un-needed daemon_port argument

* Set chia-blockchain-gui to hash in main

* Remove connect_to_daemon_port

* Remove code that set "daemon_port" before calling `setup_daemon`

* Remove self_hostname fixture and extra self_hostname global

* Fix two test files that were not importing self_hostname

* self_hostname fixture

* Remove more unused test code

* Simplify  fixture
2022-03-10 11:06:49 -08:00
Arvid Norberg
0e29dbc6d4
Bump CAT wallet test timeout to 40 minutes (#10605) 2022-03-09 03:41:18 -08:00
Kyle Altendorf
a0897d8d31
context manager for socket in find_available_listen_port(), catch OSError (#10567) 2022-03-09 03:40:52 -08:00