Commit Graph

1022 Commits

Author SHA1 Message Date
dustinface
26c2ca29de
tests: Fix flaky RPC related tests in test_nft_bulk_mint.py (#14834)
* `assert spend_bundle is not None`, required after hinting in next commit

* Don't start duplicated RPC servers, use the already started ones

* Wait for wallet sync before minting
2023-03-17 19:34:46 -05:00
dustinface
f5afa47d85
wallet: Disconnect untrusted peers if we find a trusted synced one (#14640)
* Move `request_time` creation into `is_peer_synced`

* Pass in `height: uint32` instead of `header_block: HeaderBlock`

* Disconnect untrusted peers as soon as we have a synced trusted

* Add `test_long_sync_untrusted_break`

* Ignore already disconnected peers
2023-03-17 19:28:39 -05:00
Amine Khaldi
dca1a2423d
Merge commit '6d09a060379a0eb77d11abf52ba810c93bd4be5f' into checkpoint/main_from_release_1.7.1_6d09a060379a0eb77d11abf52ba810c93bd4be5f 2023-03-16 18:18:35 +01:00
Sebastjan Trepca
6d09a06037
better handling of offer status and failed txs (#14812)
* better handling of offer status and failed txs

* 5 retries before tx is marked failed

* increase test timeouts

* fixed test

* require only difference vs whole fee

* polish + fee coins kick in only if we're missing fee
2023-03-15 20:50:25 -05:00
dustinface
62ee1c8766
wallet: Don't just subscribe to all coin ids from the DB (#14813) 2023-03-15 17:52:56 -05:00
Sebastjan Trepca
a6f423522b
nft royalty edge cases (#14789)
* nft royalty edge cases

* making tests faster

* Update tests/wallet/nft_wallet/test_nft_1_offers.py

Co-authored-by: Matt Hauff <quexington@gmail.com>

* flake

---------

Co-authored-by: Matt Hauff <quexington@gmail.com>
2023-03-14 20:27:15 -05:00
Kronus91
95d05b72c4
Stop sending change to a new address (#14422)
* Stop sending change to a new address

* Fix bug

* Add config & unit tests

* Resolve comments

* Refine based on the requirements

* Change config to str

* Disable addr reuse for unit test since the hardcode offer doesn't compatible with it

* Cover offer trade

* Add unit test and RPC support

* Add reuse option for cli

* Enhance unit test

* Fix unit test
2023-03-09 18:32:21 -06:00
Matt Hauff
adb3fe8082
Don't create a coin for 0 amount royalty payments (#14769)
* Don't create a coin for 0 amount royalty payments

* Tweak tests

* mypy
2023-03-08 10:59:29 -06:00
Sebastjan Trepca
a38da21ebd
no duplicate offers, handle conflict offers correctly (#14722)
* no duplicate offers, handle conflict offers correctly

* don't sync every offer with a bad spend, only pending ones
2023-03-03 15:13:39 -06:00
Adam Kelly
0a6856b498
Fix a DID Wallet issue where an old DID coin causes us to assert during wallet creation (#14668)
* wip

* Change test to reflect current DID Wallet operation

* Typecheck case where we do not know parent yet.
2023-02-27 16:48:10 -06:00
Kyle Altendorf
ff5ef6e073
remove leading newlines from indented code blocks (#14653)
* remove leading newlines from indented code blocks

* catch another one
2023-02-23 21:53:48 -06:00
Kronus91
9dcba09dda
Extend sign API to support hex string (#14448)
* Extend sign API to support hex string

* handle string input

* Resolve comments

* Fix pre-commit
2023-02-23 21:52:57 -06:00
Kyle Altendorf
96dad39392
remove unneeded parentheses (#14654) 2023-02-23 10:42:44 -06:00
dustinface
c098ee9166
full_node: Rename some receive/respond prefixes to add (#14458)
* full_node: Rename `FullNode.resond_block` to `FullNode.add_bock`

The naming `respond_block` is confusing here imo, we have a full node
API method called `respond_block` but here in the `FullNode` class this
method is there to try adding a block to the full nodes's chain so i
think `add_block` is the better choice?

Also change the `respond_block: full_node_protocol.RespondBlock`
parameter to `block: FullBlock` which lets us get rid of many
`full_node_protocol.RespondBlock` wrappings.

* `FullNode.receive_block_batch` -> `FullNode.add_block_batch`

* `receive_unfinished_block` -> `add_unfinished_block` + change parameter

* `FullNode.respond_transaction` -> `FullNode.add_transaction`

* `FullNode.respond_end_of_sub_slot` -> `FullNode.add_end_of_sub_slot`

* `FullNode.respond_compact_vdf` -> `FullNode.add_compact_vdf`

* `respond_compact_proof_of_time` -> `add_compact_proof_of_time`

* `respond_transaction_semaphore` -> `add_transaction_semaphore`
2023-02-23 10:28:29 -06:00
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
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
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
Sebastjan Trepca
7694ed0480
rpc endpoint to count nfts per wallet or all wallets (#14570) 2023-02-15 23:01:12 -06:00
Amine Khaldi
cf147458e8
Merge commit '124961a355e6175037067a06f5f2ab18600dfdf1' into catchup/main_from_release_1.7.0_124961a355e6175037067a06f5f2ab18600dfdf1 2023-02-14 21:35:36 +01: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
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
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
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
Matt Hauff
97230ca3b0
Add a way to import a SpendSim and SimClient as a contextmanager (#14434) 2023-01-31 19:22:06 -06:00
Matt Hauff
d1a4c579f4
Check incoming notification hints (#14450)
* add self notification test

* add a check that hint belongs to us

* lint
2023-01-31 18:58:46 -06:00
Amine Khaldi
b546888614
Merge commit '655eaad639588819beeb8bcac1a2d1ab45acf812' into checkpoint/main_from_release_1.7.0_655eaad639588819beeb8bcac1a2d1ab45acf812 2023-01-31 12:52:52 +01:00
dustinface
c26902a6ec
wallet: Avoid duplicates in get_puzzle_hashes_to_subscribe (#14186)
* wallet: Avoid duplicates in `get_puzzle_hashes_to_subscribe`

We currently store the derived puzzle hashes in both, puzzle store and
interested store and here we combine them as list. There is some code to
mitigate duplicate subscriptions but its based on chunks here
39d733599d/chia/wallet/wallet_node.py (L662)
so if there are less than 1000 puzzle hashes it obviously still can lead
to redundant subscription calls?

* Add `test_unique_puzzle_hash_subscriptions`
2023-01-30 16:23:17 -06:00
Amine Khaldi
3fe53a7acf
Merge commit '655f6c2292fe806a06d2607c5606a5a382861f92' into checkpoint/main_from_release_1.7.0_655f6c2292fe806a06d2607c5606a5a382861f92 2023-01-30 13:02:36 +01:00
Kronus91
655eaad639
Rename notification config (#14397)
* Rename notification config

* Change unit test

* Fix test

* Set minimum required notification amount

---------

Co-authored-by: Matt Hauff <quexington@gmail.com>
2023-01-27 17:20:34 -06:00
Arvid Norberg
68c9aafc0a
move SerializedProgram to its own file (#14391)
* move SerializedProgram into its own file (to fixup type annotations)

* fix type annotations for SerializedProgram

* fixup import statements for new SerializedProgram module
2023-01-27 17:20:23 -06:00
Matt Hauff
655f6c2292
Add a persitent id table to notification store (#14418)
* Add a persitent id table to notification store

* rename table

* Add a test

* lint
2023-01-27 17:20:01 -06:00
Kronus91
c541d49afe
Get memo api (#14377)
* Add NFT bulk transfer API

* Fix pre-commit

* Improve unit test

* Fix precommit

* Improve unit test

* Fix response json serialization

* Fix bulk API missing transaction

* Remove print

* Add get_transaction_memo API

* Add unit test for XCH

* Cover received coins

* Revert test hack

* Remove irrelevant change

* Add parameter override

* Fix pre-commit
2023-01-27 17:16:30 -06:00
Adam Kelly
22dfc83d51
Reorganize reusable singleton wallet code (#14339) 2023-01-27 17:09:13 -06:00
Arvid Norberg
fda2163b6b
remove additions() and reserved_fee() from CoinSpend (#14394) 2023-01-26 11:16:14 -06:00
Matt Hauff
1d4700dceb
Add some extra checks for size and existence to notification backend (#14398)
* Add some extra checks for size and existence to notification backend

* mypy
2023-01-25 23:45:23 -06:00
Jeff
c107001334
Add SigningMode and update verify_signature RPC to work with sign_message_by_* RPCs (#14213)
* Updated `verify_signature` RPC to support signatures made by `sign_message_by_*` RPCs

* Updated RPC to use "signing_mode" param name with value "chip_0002"
Added CHIP_0002_SIGN_MESSAGE_PREFIX string constant

* Tests for verify_signature

* Update chia/wallet/wallet.py

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

* Adds SigningMode enum with CHIP-0002 and BLS message augmentation schemes
chia keys sign/verify support JSON output
chia keys verify now accepts the -b as_bytes option

* Fix a mypy warning

* Updated link to CHIP-0002

* isort

* Fix tests

* improve error handling

* comment how test data was generated

* Update chia/rpc/wallet_rpc_api.py

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

* Update chia/rpc/wallet_rpc_api.py

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

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-01-25 12:44:37 -06:00
Jack Nelson
99fbb056e1
Fix chia wallet coins cli bugs (#14388)
* fix fee bug

The fee should not be taken into account when dealing with CAT's or other non XCH coins.

* fix broken CAT removals

it was never implemented ...

* Update wallet_rpc_api.py
2023-01-24 19:33:25 -06:00
Geoff Walmsley
b480aded31
Fix target puz hash index for bulk mint nfts with airdrop (#14370)
* fix indexing for target puzhashes in nft bulk minting

* make pylint happy
2023-01-21 13:00:31 -06:00
Kronus91
ad51c3c251
Fix bulk tx (#14372)
* Add NFT bulk transfer API

* Fix pre-commit

* Improve unit test

* Fix precommit

* Improve unit test

* Fix response json serialization

* Fix bulk API missing transaction

* Remove print
2023-01-20 12:02:17 -06:00