Commit Graph

3005 Commits

Author SHA1 Message Date
Kyle Altendorf
c678f00acb
cleanup adjacent string literals (#14650) 2023-02-22 17:16:07 -06:00
dustinface
c836093fd5
wallet: Fix sync mode indication (#14524)
* Make `WalletNode.set_sync_mode` an `asynccontextmanager`

* Only fetch the height if debug logs are enabled

* `yield` the start height of the sync context in `set_sync_mode`.
2023-02-22 13:41:36 -06:00
Arvid Norberg
ed8cee2b4b
Mempool private implementation (#14593)
* fix test asserts to not require the same object, just the same value

* make Mempool's implementation private and give it a public interface

* fixup test that used to count fee *levels* but now count transactions
2023-02-22 12:26:04 -06:00
Arvid Norberg
6e6325b1b5
make conditions_for_solution() support untrusted input (#14615)
* make conditions_for_solution able to parse untrusted CLVM structures

* demote as_atom_list() to be a test-only function in test_rom.py, which is the only place it's used now
2023-02-22 12:11:42 -06:00
Kyle Altendorf
93fe2f8692
exploring loop test adjustments (#14613)
* exploring loop test adjustments

* simplify the test

* drop unused variable hint
2023-02-22 12:11:06 -06:00
dustinface
18e88e8476
types: Use IPAddress instead of str in PeerInfo (#14167)
* Use `IPAddress` instead of `str` in `PeerInfo`

* Add comment about `get_host_addr`
2023-02-22 12:03:41 -06:00
dustinface
0e309d6c6b
tests: Merge some fixtures and drop other redundant ones (#14629)
* Drop redundant fixtures in `test_dl_wallet.py`

* Drop `two_wallet_nodes_five_freeze`

Maybe im just not getting it but the `five_freeze` doesn't sound right 
here to me and the fixture does the same as `two_wallet_nodes` so i 
guess we can just drop it?

* Drop `wallet_and_node` fixture

* Drop both `wallet_node` fixtures

The one in `conftest.py` and the one in `test_dl_wallet.py`.

* Drop both `wallet_node` fixtures

The one in `conftest.py` and the one in `test_dl_wallet.py`.

* Drop `wallet_node_sim_and_wallet` fixture

* Drop `wallet_node_simulator` fixture

* Drop `one_wallet_node` fixture
2023-02-21 18:37:33 -06:00
Arvid Norberg
23483b6b7b
make SpendBundle.additions() count complete cost (#14612)
make SpendBundle.additions() properly account for the cost of computing additions for all spends it contains
2023-02-21 18:37:12 -06:00
Adam Kelly
db19671827
Check Wallet DB integrity (#14401)
* Check Wallet DB integrity

* Update command line help

* Improve duplicate DerivationPath index error message

* Move tests to chia/tests

* lint

* py init file

* Print WalletType names

* Don't complain about wallets not having derivation entries that don't need them

* Validate addresses used in order

* Update tests with new error output

* Fix check_addresses_used_contiguous in the case when the last address of the previous wallet was unused
2023-02-21 18:35:15 -06:00
dustinface
1094ae21fd
tests: Setup 4 nodes in setup_four_nodes (#14630) 2023-02-21 12:26:29 -06:00
Arvid Norberg
1d4a3ecce8
Softfork2 infrastructure (#14625)
* add soft-fork2 (to be introduced in 1.8.0)

* update unknown-opcode test
2023-02-21 12:25:47 -06:00
Arvid Norberg
b48c91618f
require npc_result to be set in mempool items added to the mempool (#14624) 2023-02-21 12:25:22 -06:00
Kyle Altendorf
4e34ff7982
fixup test_agg_sig_unsafe() softfork fixture usage (#14597) 2023-02-16 19:54:16 -06:00
Sebastjan Trepca
6e632c2531
nft paging at sqlite level (#14561)
* nft paging at sqlite level

* use sqlite params
2023-02-16 03:40:50 -06:00
William Allen
03b007456a
catchup: into main from release/1.7.0 @ 124961a355 (#14575)
Source hash: 124961a355
Remaining commits: 0
2023-02-16 03:39:40 -06:00
Amine Khaldi
197533577b
Augment mempool's total_mempool_fees to int as it shouldn't be limited by type Mojos (#14587)
* Augment mempool's total_mempool_fees to int as it shouldn't be limited by type Mojos.

* Add an assert to make sure the total mempool fees are correct.
2023-02-15 23:06:06 -06:00
Sebastjan Trepca
7694ed0480
rpc endpoint to count nfts per wallet or all wallets (#14570) 2023-02-15 23:01:12 -06:00
Arvid Norberg
fc9da3732c
parameterize TestConditions (#14567) 2023-02-15 23:00:48 -06:00
Amine Khaldi
ac0349f8dc
Simplify request_mempool_transactions() and get_items_not_in_filter() (#14404)
* Only deal with the relevant subset of the MempoolItem (which is SpendBundle here).

* get_items_not_in_filter() doesn't need to be async.

* Use len(items) instead of counter for the limit check.

* Update tests to reflect the improvements.
2023-02-15 22:47:07 -06:00
Kyle Altendorf
b22fe1ea8d
allow signature changes for 3.11 2023-02-15 22:45:28 -05:00
Amine Khaldi
98c412ca5a
Formatting. 2023-02-14 22:15:08 +01:00
Amine Khaldi
7d0d40d7b7
Update SpendBundleConditions use. 2023-02-14 21:56:31 +01:00
Amine Khaldi
cf147458e8
Merge commit '124961a355e6175037067a06f5f2ab18600dfdf1' into catchup/main_from_release_1.7.0_124961a355e6175037067a06f5f2ab18600dfdf1 2023-02-14 21:35:36 +01:00
Kyle Altendorf
124961a355
fixup event loop method testing (#14566)
* get pausable_server in a thread

* drop the server thread name

this is a 3.8+ feature

* enable parallel testing in ci for core.server

* bump the timeout

* strict only for windows on 3.8+

* actually bump the *job_*timeout

* actively timeout connection attempts to speed up linux tests

* skip test_limits_connections() for windows python 3.7

* back to default job timeout
2023-02-14 13:48:44 -06:00
Arvid Norberg
d315097b2a
full node optimizations (#14562)
implement async opt merge

Co-authored-by: William Allen <wallentx@users.noreply.github.com>
Co-authored-by: Florin Chirica <16658074+fchirica@users.noreply.github.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-02-13 22:34:31 -06:00
Adam Kelly
d69ecdda29
Test DID Wallet creation by blockchain singleton update (#14545) 2023-02-13 11:21:32 -06:00
Amine Khaldi
454b1cbc35
Simplify MINTING_COIN and RESERVE_FEE_CONDITION_FAILED unit tests (#14559)
* Simplify MINTING_COIN and RESERVE_FEE_CONDITION_FAILED unit tests now that they're validated in pre_validate_spendbundle.

* Add positive tests.
2023-02-13 11:03:22 -06:00
Arvid Norberg
07450b7dda
use run_block_generator() to run block generators (#14544)
use the new run_block_generator() function from chia_rs
2023-02-13 11:00:21 -06:00
Arvid Norberg
1b6201852a
bump chia_rs to 0.2.2 (#14533)
* bump chia_rs to latest version

* add new error codes for ASSERT_BEFORE_* condition failures, ASSERT_CONCURRENT_SPEND failing, ASSERT_CONCURRENT_PUZZLE_FAILED and for impossible constraints

* add new condition opcodes for ASSERT_BEFORE_*, ASSERT_CONCURRENT_SPEND and ASSERT_CONCURRENT_PUZZLE

* fixup Spend and SpendBundleCondition types

* fixup tests that otherwise fail with MINTING_COIN

* fix test that otherwise would fail with RESERVE_FEE_CONDITION_FAILED

* remove use of NO_NEG_DIV flag. It's now implied

* remove duplicate test parameters
2023-02-10 15:14:56 -06:00
Matt Hauff
59e389968e
Add cost logging to CLVM tests as fixture (#14444) 2023-02-10 15:13:45 -06:00
Kyle Altendorf
6e70868888
move wallet_is_synced/wallets_are_synced to FullNodeSimulator methods (#14403)
* move wallet_is_synced/wallets_are_synced to FullNodeSimulator methods

* black

* gotta catch 'em all
2023-02-10 15:13:23 -06:00
Amine Khaldi
5169f10e50
Merge commit '9cc25cc820accad778bf626500aedd299f62a825' into checkpoint/main_from_release_1.7.0_9cc25cc820accad778bf626500aedd299f62a825 2023-02-09 14:28:39 +01:00
Adam Kelly
d3ad991208
Ak.test nft mint from xch rpc (#14482)
* Mitigate flaky test

* Use already existing wallet_is_synced
2023-02-08 19:44:04 -06:00
Kyle Altendorf
f346de94ba
refactor test_pool_rpc (#14196)
* preliminary test_pool_rpc refactor

* remove todo

* handle some todos

* one more

* wait for wallets to sync in the fixtures

* drop an extra wallet

* drop unused function
2023-02-08 19:43:43 -06:00
Kronus91
67b42c9cc4
Fix get memo API (#14513) 2023-02-07 18:41:02 -06:00
Arvid Norberg
e397aa3abd
remove test aimed at the inital soft-fork to enable transactions (#14477)
remove test aimed at the inital soft-fork to enable transactions, way back in the beginning of time
2023-02-07 18:20:24 -06:00
Amine Khaldi
98d4436f95
Merge commit '9be3c7d00ae99105c40913aff1b07e97657609fb' into checkpoint/main_from_release_1.7.0_9be3c7d00ae99105c40913aff1b07e97657609fb 2023-02-07 21:33:21 +01:00
Amine Khaldi
4ec43caf20
Merge commit '83c864b2f099afcbf93845d9e720a523d11a3eaa' into checkpoint/main_from_release_1.7.0_83c864b2f099afcbf93845d9e720a523d11a3eaa 2023-02-07 17:13:18 +01:00
William Allen
bbf1e1e2d4
checkpoint: into main from release/1.7.0 @ d1a4c579f4 (#14502)
Source hash: d1a4c579f4
Remaining commits: 3
2023-02-07 05:58:38 -06:00
Amine Khaldi
16d76dda9b
Add unit tests for get_items_not_in_filter (#14416)
* Add unit tests for get_items_not_in_filter.

* Adapt the test cases for 0 and negative limits.
2023-02-07 04:31:46 -06:00
Matt Hauff
9cc25cc820
Quex.offer mod tests (#14478)
* add test

* do some forwards compat stuff

* Add a forwards compat example

* fix test

* Add more forwards compat tests

* Add more forwads compat tests

* Add forwards compatibility for nft1s

* add forward compatibility for nft offers

* Add forwards compatibility tests for DL offers

* Update DL test offers

* lint

* isort

* offer mod bytes

* Fix compression test

* isort again

* Add special offers for <=3.7 (CATs)

* Add special offers for <=3.7 (NFT1s)

* Add special offers for <=3.7 (NFT0s)

* Add special offers for <=3.7 (DLs)

* Check for conflicting items during aggregation

* isort

* Return created old offers properly marked
2023-02-06 22:04:39 -06:00
Amine Khaldi
88e2d79905
Merge commit 'd1a4c579f4dd2b058fcd46f2249a876a60b1dec5' into checkpoint/main_from_release_1.7.0_d1a4c579f4dd2b058fcd46f2249a876a60b1dec5 2023-02-06 21:36:02 +01:00
Adam Kelly
9be3c7d00a
Ensure fee estimates monotonically decrease with time (#14368)
* Ensure fee estimates monotonically decrease with time

* Improve function naming and document use

* type checking
2023-02-06 12:53:03 -06:00
Amine Khaldi
09a2c79898
Add unit tests for ephemeral time locks (#14433)
* Add unit tests for ephemeral time locks.

* Make the current block's height and timestamp values clearer in the test.

* Add some comments to explain some cases and opt for an explicit height and timestamp.

* Adapt the test coin timestamp so we can test the ephemeral one with the value we set.

* Document a subtle difference between ASSERT_SECONDS_RELATIVE 0 and ASSERT_HEIGHT_RELATIVE 0.
2023-02-06 03:28:16 -06:00
Arvid Norberg
cbbc8b43b8
make the tests use the real COST_PER_BYTE constant (#14470) 2023-02-04 14:14:52 -06:00
dustinface
3bd6069f04
server: Exclude some attributes from WSChiaConnection.__repr__ (#14466) 2023-02-04 14:14:27 -06:00
Arvid Norberg
2c0dd6b2c1
add unit test for mempool_check_time_locks (#14441) 2023-02-04 14:13:59 -06:00
Sebastjan Trepca
d8d8660dbc
RPC call to reset wallet sync data (#14365)
* Add resync API

* Resolve comments

* Fix precommit

* set_wallet_resync RPC call

* disable resync after reset

* Update chia/wallet/wallet_node.py

Co-authored-by: Jeff <paninaro@gmail.com>

* fixes

* fixes

* rename method

* more tests, schema test

* removed formatting changes in initial-config

* another test case

* another test case

* simplification

* rename fix

* hinting

* added notification id table

---------

Co-authored-by: ytx1991 <t.yu@chia.net>
Co-authored-by: Jeff <paninaro@gmail.com>
2023-02-04 14:12:41 -06:00
Adam Kelly
83c864b2f0
Correct fee estimate calculation to be in mojos, not millimojos (#14474) 2023-02-04 14:09:39 -06:00
Matt Hauff
97230ca3b0
Add a way to import a SpendSim and SimClient as a contextmanager (#14434) 2023-01-31 19:22:06 -06:00