Skip to content
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

[CHIA-307] (long-lived) Vault #16610

Draft
wants to merge 575 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
575 commits
Select commit Hold shift + click to select a range
90a5538
Merge branch 'quex.pubkey_to_observation_root' into quex.wallet_obser…
Quexington Feb 28, 2024
54dc54a
Merge branch 'quex.wallet_observation_root' into quex.main_wallet_pro…
Quexington Feb 28, 2024
ba64835
Merge branch 'quex.main_wallet_protocol' into quex.prep_for_vault_wallet
Quexington Feb 28, 2024
8d431a1
Tweak keychain_proxy.get_key_for_fingerprint
Quexington Feb 28, 2024
d9443e7
Fix wallet RPC test?
Quexington Feb 28, 2024
eb5eb59
pragma: no cover
Quexington Feb 28, 2024
7aa2449
Merge branch 'quex.transport_layer' into quex.signer_commands
Quexington Feb 28, 2024
8d228af
make_solution and remove old launcher_id
geoffwalmsley Feb 28, 2024
37117fc
store vault_info in singleton_store's custom data field
geoffwalmsley Feb 29, 2024
306f066
Merge branch 'quex.prep_for_vault_wallet' into gw.vault_creation
geoffwalmsley Feb 29, 2024
8ad5e36
add vault keytype to keychain.add_key
geoffwalmsley Feb 29, 2024
6c940c6
Make WalletStateManager.private_key optional (#16897)
Quexington Feb 29, 2024
6bbc436
cleanup from quex's comments
geoffwalmsley Mar 5, 2024
8890364
make vault_wallet a dataclass and restructure vault_info and recovery…
geoffwalmsley Mar 11, 2024
7eb45ab
Redesign clvm_streamable
Quexington Mar 15, 2024
b44e595
Merge commit '83f090133f' into catchup/long_lived_vault_from_main_4df…
Quexington Mar 18, 2024
6e2c7c5
Fix test imports
Quexington Mar 18, 2024
fa96d05
black
Quexington Mar 18, 2024
334b4bd
fix one more test
Quexington Mar 18, 2024
713bf95
Address comments by @altendky
Quexington Mar 19, 2024
eb34622
remove negative_change_allowed var, clarify pk in keychain.get_key_data
geoffwalmsley Mar 20, 2024
7ca3002
Test coverage
Quexington Mar 20, 2024
c793920
bytes32
Quexington Mar 20, 2024
2fec730
Better CLI mnemonic check
Quexington Mar 20, 2024
e7a7a11
Merge branch 'quex.observer_mode' into quex.pubkey_to_observation_root
Quexington Mar 20, 2024
acaf5aa
get launcher_id from ObservationRoot
geoffwalmsley Mar 20, 2024
6f46486
Use functools.partial
Quexington Mar 21, 2024
5680253
Rename full jsonify to chip 29
Quexington Mar 21, 2024
70f5665
whoops missed a couple
Quexington Mar 21, 2024
8fbc831
Update key functions to handle observer only functionality (#16903)
Quexington Mar 21, 2024
482e240
Merge remote-tracking branch 'origin/long_lived/vault' into quex.rede…
Quexington Mar 21, 2024
ac2f2e4
Merge commit 'long_lived/vault' into HEAD
Quexington Mar 21, 2024
e28b05f
Merge remote-tracking branch 'origin/main' into catchup/long_lived_va…
Quexington Mar 22, 2024
99a58af
Merge branch 'catchup/long_lived_vault_from_main_4df4496f57423173acd6…
Quexington Mar 22, 2024
6221093
Better CLI mnemonic check
Quexington Mar 20, 2024
c6143a8
Merge remote-tracking branch 'origin/catchup/long_lived_vault_from_ma…
Quexington Mar 22, 2024
0ac8aef
black
Quexington Mar 22, 2024
3dc341d
pylint
Quexington Mar 22, 2024
84ed3c8
Merge branch 'quex.wallet_rpc_client_types' into quex.tx_out_decorator
Quexington Mar 22, 2024
16a28b3
Merge branch 'quex.pubkey_to_observation_root' into quex.wallet_obser…
Quexington Mar 22, 2024
1fd43c1
Missed one
Quexington Mar 22, 2024
614c0e9
Merge remote-tracking branch 'origin/catchup/long_lived_vault_from_ma…
Quexington Mar 22, 2024
d49af2f
Merge branch 'quex.wallet_observation_root' into quex.main_wallet_pro…
Quexington Mar 22, 2024
917fe0f
black
Quexington Mar 22, 2024
c391c5f
Merge branch 'quex.tx_out_decorator' into quex.execute_signing_instru…
Quexington Mar 22, 2024
29ddd41
Merge branch 'quex.main_wallet_protocol' into quex.prep_for_vault_wallet
Quexington Mar 22, 2024
48dd429
Farm at least one block
Quexington Mar 25, 2024
cb6ab4f
Revert last change and fix 0 block farming
Quexington Mar 25, 2024
d536623
Merge branch 'quex.execute_signing_instructions_rpc' into quex.transp…
Quexington Mar 25, 2024
5fea5e5
black
Quexington Mar 25, 2024
b318b63
Merge branch 'quex.transport_layer' into quex.signer_commands
Quexington Mar 25, 2024
2481f78
bad merge
Quexington Mar 25, 2024
4003bca
Merge fix
Quexington Mar 25, 2024
061ee98
catchup: long_lived/vault from main @ b08713f3db9931ea16b1005b7676dd7…
Quexington Mar 26, 2024
1be0d0d
Merge remote-tracking branch 'origin/long_lived/vault' into quex.wall…
Quexington Mar 26, 2024
9ba9060
Inadvertent changes
Quexington Mar 26, 2024
d84cad1
Merge remote-tracking branch 'origin/long_lived/vault' into quex.pubk…
Quexington Mar 26, 2024
eb62c81
Inadvertent changes
Quexington Mar 26, 2024
23c9ee8
Broaden the `Keychain` definition of public keys to include more than…
Quexington Mar 26, 2024
e62e08c
Syncronize with quex.tx_out_decorator2
Quexington Mar 27, 2024
65e1c48
Merge branch 'quex.tx_out_decorator' into quex.execute_signing_instru…
Quexington Mar 27, 2024
04bed9b
Redesign `@clvm_streamable` (#17715)
Quexington Mar 28, 2024
98dda39
These are no longer dictionaries.
AmineKhaldi Mar 28, 2024
57b9eec
Use new clvm_streamable pattern
Quexington Mar 28, 2024
7df2114
Merge remote-tracking branch 'origin/long_lived/vault' into quex.wall…
Quexington Mar 29, 2024
5e13d4c
Fix offer endpoint
Quexington Mar 29, 2024
aacc9f0
Add support in wallet for non-G1Element observation roots (#16976)
Quexington Apr 1, 2024
c5da8ce
add recovery endpoint and cli
geoffwalmsley Apr 5, 2024
9791a37
use p2_singleton_via_delegated
geoffwalmsley Apr 8, 2024
5484654
Wallet -> MainWalletProtocol (#16978)
Quexington Apr 8, 2024
bcc7ebe
Add @tx_out_cmd decorator
Quexington Mar 25, 2024
ec6957f
Convert wallet RPC client to deserialized types (#17393)
Quexington Apr 8, 2024
92b1cc5
Merge commit '02a7e8b1b55b0f43add5c224fb5744313872b5b6' into catchup/…
Quexington Apr 8, 2024
2edabcb
Bump ecdsa version
Quexington Apr 8, 2024
87d472c
Revert to original p2_delegated_or_hidden_secp
geoffwalmsley Apr 9, 2024
8144884
Merge branch 'catchup/long_lived_vault_from_main_02a7e8b1b55b0f43add5…
Quexington Apr 9, 2024
fa800d5
Merge branch 'catchup/long_lived_vault_from_main_02a7e8b1b55b0f43add5…
Quexington Apr 9, 2024
ff8b5a8
catchup: long_lived/vault from main @ 02a7e8b1b55b0f43add5c224fb57443…
Quexington Apr 16, 2024
47fdf88
Prep for Vault Wallet (#17138)
Quexington Apr 25, 2024
41b9384
Merge commit '646c416622b4512097bdee7a9d48259136d41f1a' into catchup/…
Quexington May 6, 2024
ed66cc7
Fix @marshal util to return proper transactions
Quexington May 6, 2024
ff0b92f
catchup: into long_lived/vault from main @ 646c416622b4512097bdee7a9…
Quexington May 7, 2024
1abae41
Add get_public_key
Quexington May 8, 2024
d352c11
Add @tx_out_cmd decorator (#17842)
Quexington May 9, 2024
9fd0c86
port `chia wallet send` to @tx_out_cmd
Quexington Mar 25, 2024
96dd9e4
[CHIA-423] Port `chia wallet send` to @tx_out_cmd (#18002)
Quexington May 15, 2024
667d795
Merge commit 'bd3a638db10ee92a15f138ceaef06648c3c7b480' into catchup/…
Quexington May 15, 2024
618e4f9
merge fix of puzzle hash derivation
Quexington May 15, 2024
d423e18
Port `chia wallet coins` to @tx_out_cmd
Quexington Mar 25, 2024
15dfd0e
catchup: into long_lived/vault from main @ bd3a638db10ee92a15f138ceae…
Quexington May 16, 2024
a1bccab
Port chia wallet clawback to @tx_out_cmd
Quexington Mar 25, 2024
8f43e6c
[CHIA-424] Port `chia wallet coins` to @tx_out_cmd (#18023)
Quexington May 16, 2024
6a51fdc
[CHIA-426] Port `chia wallet clawback` to @tx_out_cmd (#18036)
Quexington May 17, 2024
c598f70
Port `chia wallet take/cancel_offer` to @tx_out_cmd
Quexington Mar 25, 2024
0afa088
[CHIA-427] Port `chia wallet take/cancel_offer` to @tx_out_cmd (#18038)
Quexington May 20, 2024
52ad57c
Port `chia wallet did ...` to @tx_out_cmd
Quexington Mar 26, 2024
2a7e0c8
update vault_p2_recovery.clsp and drivers
geoffwalmsley May 20, 2024
d4edcca
update recovery process in wallet
geoffwalmsley May 20, 2024
7acf624
add recovery API and CLI
geoffwalmsley May 20, 2024
be3edd0
[CHIA-428] Port `chia wallet did ...` to @tx_out_cmd (#18041)
Quexington May 20, 2024
19a70e7
Port `chia wallet nft ...` to @tx_out_cmd
Quexington Mar 26, 2024
a638773
Simplify vault recovery test
Quexington May 20, 2024
fcc772e
[CHIA-429] Port `chia wallet nft ...` to @tx_out_cmd (#18044)
Quexington May 21, 2024
7adbf94
Port `chia wallet notifications send` to @tx_out_cmd
Quexington Mar 26, 2024
f10d13f
[CHIA-430] Port `chia wallet notifications send` to @tx_out_cmd (#18047)
Quexington May 22, 2024
c23b890
Port `chia wallet vcs ...` to @tx_out_cmd
Quexington Mar 26, 2024
a7a0cc8
[CHIA-431] Port `chia wallet vcs ...` to @tx_out_cmd (#18062)
Quexington May 22, 2024
e9c7d32
Port `chia dao ...` to @tx_out_cmd
Quexington Mar 26, 2024
a67e54f
Exclude data layer and plotnft functions
Quexington Mar 25, 2024
efb39bf
Merge branch 'quex.port_dao_cmds_to_tx_out_cmd' into quex.execute_sig…
Quexington May 22, 2024
c2c4a04
[no ci]
Quexington May 22, 2024
1ba3b3a
Address comments by @AmineKhaldi
Quexington May 22, 2024
8b7d391
Merge branch 'quex.execute_signing_instructions_rpc' into quex.transp…
Quexington May 23, 2024
a12341b
Fix rpc util
Quexington May 23, 2024
205045c
Merge branch 'quex.transport_layer' into quex.signer_commands
Quexington May 23, 2024
7424942
[CHIA-432] Port `chia dao ...` to @tx_out_cmd (and exclude DL and poo…
Quexington May 23, 2024
5c407ea
Merge commit '32fd48159f761ad7c59e5b8f02a7aed17e2503e9' into catchup/…
Quexington May 23, 2024
6fbee4d
catchup: long_lived/vault from main @ 32fd48159f761ad7c59e5b8f02a7aed…
Quexington May 28, 2024
78c8fb7
[CHIA-433] Make execute_signing_instructions RPC (#17398)
Quexington Jun 3, 2024
95ac9f1
add test for BSTLSigningInstructions
Quexington Jun 4, 2024
8e5add1
[CHIA-434] Add translation layer for blind signing (#16993)
Quexington Jun 5, 2024
18d46ed
[CHIA-435] Add `chia wallet signer` commands (#17399)
Quexington Jun 11, 2024
13ccfa7
Merge commit '9ea4609618cba2229dc9f4b916ec82927c79a0d6' into catchup/…
Quexington Jun 11, 2024
f370c45
Rename p2_singeton_via_delegated_puzzle -> p2_singeton_via_delegated_…
Quexington Jun 17, 2024
4091d79
catchup: long_lived/vault from main @ 9ea4609618cba2229dc9f4b916ec829…
Quexington Jun 17, 2024
d9c30a2
Add Add p2_singleton_via_delegated_puzzle_safe.clsp
Quexington Jun 17, 2024
0c993a0
Add test coverage
Quexington Jun 18, 2024
ba1e60d
Merge branch 'quex.fix_vault_recovery_test' into gw.vault_creation
geoffwalmsley Jun 20, 2024
6d1abaf
Merge branch 'long_lived/vault' into gw.vault_creation
geoffwalmsley Jun 20, 2024
62e73a0
test coverage again
Quexington Jun 20, 2024
5c7364d
move gather_signing_info to main wallet
geoffwalmsley Jun 24, 2024
e583831
[CHIA-777] Generalize `p2_singleton_via_delegated_puzzle` (#18197)
Quexington Jun 25, 2024
17e52c5
Merge commit '9e1a4dceb724d7ebf56e3d8a75e8692184997805' into catchup/…
Quexington Jun 26, 2024
844cb8e
Bring Wallet into conformity with MainWalletProtocol
Quexington Jun 26, 2024
57198e2
catchup: long_lived/vault from main @ 9e1a4dceb724d7ebf56e3d8a75e8692…
Quexington Jul 8, 2024
6f55be0
move gather_signing_info to main wallet (#18240)
Quexington Jul 8, 2024
d8e8011
updates from long_lived merge
geoffwalmsley Jul 9, 2024
268f300
Merge branch 'long_lived/vault' into gw.vault_creation
geoffwalmsley Jul 9, 2024
8eb18d3
merge cleanup and use p2_singleton_via_delegated_safe
geoffwalmsley Jul 9, 2024
dc0be9c
tidy up tests and mypy etc
geoffwalmsley Jul 15, 2024
7606a14
fix spend bundle assertion so we don't break offers
geoffwalmsley Jul 15, 2024
e56c52f
add singletons table to db_resync, fix naming issue breaking nft tests
geoffwalmsley Jul 16, 2024
c270810
lint and mypy
geoffwalmsley Jul 16, 2024
301231a
check for vault puz when confirming recovery txs
geoffwalmsley Jul 17, 2024
8323b11
coverage fixes
geoffwalmsley Jul 18, 2024
2920b72
Address Quex's comments
geoffwalmsley Jul 22, 2024
2dc678e
Add keychain support and placeholder for vault wallet (#17196)
Quexington Jul 22, 2024
7237929
replace ecdsa with cryptography
geoffwalmsley Jul 23, 2024
ef7b17e
mypy ignore call-arg for deterministic_signing
geoffwalmsley Jul 23, 2024
7d3a262
remove types-cryptography
geoffwalmsley Jul 23, 2024
330945c
Merge commit '5462631d998234720e5fb053be7485777cad47ac' into catchup/…
Quexington Jul 23, 2024
45b45d9
update cryptography, remove ecdsa dependency (#18344)
Quexington Jul 23, 2024
fdb5eed
Merge remote-tracking branch 'origin/long_lived/vault' into catchup/l…
Quexington Jul 23, 2024
968293f
Fix tests
Quexington Jul 23, 2024
5edd81a
Fix more tests
Quexington Jul 23, 2024
9e01679
Catchup: long_lived/vault from main @ 5462631d998234720e5fb053be74857…
Quexington Jul 24, 2024
349936d
Port vault_create to @marshal decorator
Quexington Jul 24, 2024
6ecdea0
Port vault_recovery to @marshal decorator
Quexington Jul 24, 2024
1a0d8a0
Port client implementations
Quexington Jul 24, 2024
bf83cb6
Extract out tx_endpoint commonalities
Quexington Jul 24, 2024
1211dff
Raise on inproper fee value
Quexington Jul 24, 2024
0fb2c46
Move TXConfig outside of request type
Quexington Jul 24, 2024
5c39a6c
Special case kw_only
Quexington Jul 24, 2024
e43817c
Fix cmd tests
Quexington Jul 25, 2024
8204e28
Fix < 3.10 kw_only compatibility
Quexington Jul 25, 2024
ee18f82
Fix < 3.10 kw_only compatibility
Quexington Jul 25, 2024
b07359f
Fix < 3.10 kw_only compatibility
Quexington Jul 25, 2024
7ce5a25
pylint
Quexington Jul 25, 2024
0862967
pragma: no cover
Quexington Jul 25, 2024
f9b45d2
[CHIA-1008] Make vault endpoints more paradigmatic (#18359)
Quexington Jul 29, 2024
0d705b2
Add @tx_out_cmd to vault_create and dedup transaction output code
Quexington Jul 30, 2024
d993b86
convert make_solution to async (#18368)
geoffwalmsley Jul 30, 2024
107fd87
[CHIA-1009] Add @tx_out_cmd to vault_create and dedup transaction out…
Quexington Jul 31, 2024
6d3195a
make action_scope mandatory for make_solution
geoffwalmsley Jul 31, 2024
0118843
missed a couple
geoffwalmsley Jul 31, 2024
1e2ac8a
Add cost logging
Quexington Aug 6, 2024
ca1dcdb
[CHIA-1010] Add cost logging to vault CLVM tests (#18409)
Quexington Aug 7, 2024
82957c0
Merge commit '6da47c26a258cd93beafc1f9e9bea4cb0e6bd4bb' into catchup/…
Quexington Aug 7, 2024
c381426
Fix tests
Quexington Aug 7, 2024
d1ca957
[CHIA-1081] catchup: long_lived/vault from main @ 6da47c26a258cd93bea…
Quexington Aug 9, 2024
03177a0
Merge commit '495593089b106371bf9dacd2ee5ece7f156a25f1' into long_liv…
Quexington Aug 12, 2024
3bf382d
Update wallets for mandatory action_scope in make_solution (#18384)
Quexington Aug 12, 2024
44c1d75
Merge remote-tracking branch 'origin/long_lived/vault' into catchup/l…
Quexington Aug 13, 2024
a6df3ea
mypy
Quexington Aug 13, 2024
7d6cce1
Add SecretInfo to key scheme protocols
Quexington Jul 19, 2024
27dda22
Deduplicate keychain code a bit
Quexington Aug 13, 2024
5755cf6
Implement secp256r1 wrappers
Quexington Aug 13, 2024
586cab7
Remove `PrivateKey` type from wallet
Quexington Aug 13, 2024
a4c0f62
Merge branch 'quex.secp_wrappers' into HEAD
Quexington Aug 13, 2024
03243b0
Add Secp256r1 to KeyTypes
Quexington Aug 13, 2024
586bcd6
Merge branch 'quex.dedup_keychain_code' into HEAD
Quexington Aug 13, 2024
82296e5
Make ._get_key_data return `Optional[KeyData]`
Quexington Jul 10, 2024
58eb0a0
Generalize KeyDataSecrets
Quexington Jul 11, 2024
de9f542
Generalize rest of keychain
Quexington Jul 19, 2024
81ab94f
pre-commit
Quexington Aug 13, 2024
6314fd9
use PKCS8 format
Quexington Aug 14, 2024
12f4e77
[CHIA-1102] catchup: long_lived/vault from main @ 495593089b106371bf9…
Quexington Aug 14, 2024
302e929
Test coverage
Quexington Aug 14, 2024
aa520d3
[CHIA-1123] Add `SecretInfo` and `Signature` to key scheme protocols …
Quexington Aug 14, 2024
1f50bcc
[CHIA-1124] Deduplicate keychain code a bit (#18455)
Quexington Aug 14, 2024
be9d488
Pipe through values everywhere
Quexington Aug 14, 2024
230e53e
pylint
Quexington Aug 14, 2024
8af8ecc
fix tests
Quexington Aug 14, 2024
0dad751
typo
Quexington Aug 15, 2024
05fcad5
Fix one last test
Quexington Aug 15, 2024
4b62887
Tweak `gather_signing_info` to work with multiple vaults and finish t…
Quexington Aug 15, 2024
13b9a41
Refer to separate recovery transactions by IDs
Quexington Aug 15, 2024
62739f5
Merge commit '0a76e22489513ac0add5e31ca27b78a1c074536b' into catchup/…
Quexington Aug 19, 2024
af8be12
[CHIA-1125] Implement secp256r1 wrappers (#18456)
Quexington Aug 19, 2024
dc74970
[CHIA-1182] catchup: long_lived/vault from main @ 0a76e22489513ac0add…
Quexington Aug 19, 2024
58d25b1
[CHIA-1126] Remove `PrivateKey` type from wallet (#18458)
Quexington Aug 19, 2024
e5f73f3
Merge remote-tracking branch 'origin/long_lived/vault' into quex.add_…
Quexington Aug 19, 2024
08b210f
[CHIA-1127] Add Secp256r1 to `KeyTypes` (#18464)
Quexington Aug 20, 2024
5847164
[CHIA-1156] Tweak `gather_signing_info` to work with multiple vaults …
Quexington Aug 20, 2024
54b78d2
Merge remote-tracking branch 'origin/long_lived/vault' into quex.gene…
Quexington Aug 20, 2024
7e235da
Test coverage
Quexington Aug 21, 2024
32652a0
[CHIA-1036] Refer to separate recovery transactions by IDs (#18477)
Quexington Aug 22, 2024
19e917b
Merge commit '483ec60771304798ce7187e81a361fc1d3e7225d' into catchup/…
Quexington Aug 26, 2024
7bd9199
[CHIA-1215] catchup: long_lived/vault from main @ 483ec60771304798ce7…
Quexington Aug 26, 2024
096c88d
Merge commit '2b3999ddedaca53f28d0c474badb588e9d70e0be' into catchup/…
Quexington Sep 3, 2024
961b618
[CHIA-1255] catchup: long_lived/vault from main @ 2b3999ddedaca53f28d…
Quexington Sep 3, 2024
ce3b919
Merge commit '95592957254f8c548f189d70c8a36b1a55f327f2' into catchup/…
Quexington Sep 9, 2024
a996208
Fix cmd tests
Quexington Sep 9, 2024
df53def
[CHIA-1356] catchup: long_lived/vault from main @ 95592957254f8c548f1…
Quexington Sep 9, 2024
2f30b6a
Merge remote-tracking branch 'origin/long_lived/vault' into quex.gene…
Quexington Sep 9, 2024
d2f5d0a
[CHIA-1128] Generalize Keychain to support multiple key types (#18466)
Quexington Sep 16, 2024
1e0de4c
Merge commit '1b4b8e8df517cb38d1637c54444ba3ab12286624' into catchup/…
Quexington Sep 16, 2024
2cd3e64
Remove pointless (?) check
Quexington Sep 16, 2024
328948e
Set vault transaction removals
Quexington Sep 17, 2024
4cb5948
catchup: long_lived/vault from main @ 1b4b8e8df517cb38d1637c54444ba3a…
Quexington Sep 17, 2024
155bebf
Merge commit '111b0e57d5995d760cac877c45ef8822506800b6' into catchup/…
Quexington Sep 23, 2024
f9a01d9
[CHIA-1453] catchup: long_lived/vault from main @ 111b0e57d5995d760ca…
Quexington Sep 24, 2024
ab44332
Merge commit 'b4137651b6b2107f88b4a83e64b7b2c918c5c3f3' into catchup/…
Quexington Sep 30, 2024
9087259
whoops
Quexington Sep 30, 2024
c893846
Fix vault client endpoints
Quexington Sep 30, 2024
ea3101c
catchup: long_lived/vault from main @ b4137651b6b2107f88b4a83e64b7b2c…
Quexington Oct 8, 2024
61cb545
Merge commit 'd678131ded709e6264127984ae5fc12c6823cafa' into long_liv…
Quexington Oct 15, 2024
7c71915
whoops
Quexington Oct 15, 2024
210fa83
pylint
Quexington Oct 15, 2024
e73ceb5
[CHIA-1634] catchup: long_lived/vault from main @ d678131ded709e62641…
Quexington Oct 16, 2024
3dfb08a
Merge commit '470ae0ff0291a337253609f17cb394370cbe1ffd' into catchup/…
Quexington Oct 21, 2024
9f35df0
catchup: long_lived/vault from main @ 470ae0ff0291a337253609f17cb3943…
Quexington Oct 22, 2024
6ee9fa4
Merge commit '6084112d485fd6061a238b9c1a4882d845280feb' into catchup/…
Quexington Oct 28, 2024
140ce7d
Fix imports
Quexington Oct 28, 2024
4e91ae7
[CHIA-1675] catchup: long_lived/vault from main @ 6084112d485fd6061a2…
Quexington Oct 30, 2024
e327b08
Merge commit '2b19c289a9488bfd813541e44745be52df413439' into catchup/…
Quexington Nov 4, 2024
037abda
[CHIA-1706] catchup: long_lived/vault from main @ 2b19c289a9488bfd813…
Quexington Nov 5, 2024
3388690
Merge commit '08730a266b201e487ca1d361e108491f7862d81b' into catchup/…
Quexington Nov 12, 2024
e235ed5
Ruff format
Quexington Nov 12, 2024
fecb484
[CHIA-1736] catchup: long_lived/vault from main @ 08730a266b201e487ca…
Quexington Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chia-blockchain-gui
Empty file modified chia/_tests/build-init-files.py
100755 → 100644
Empty file.
Empty file modified chia/_tests/check_pytest_monitor_output.py
100755 → 100644
Empty file.
Empty file modified chia/_tests/check_sql_statements.py
100755 → 100644
Empty file.
Empty file modified chia/_tests/chia-start-sim
100755 → 100644
Empty file.
158 changes: 158 additions & 0 deletions chia/_tests/clvm/test_p2_singletons.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
from __future__ import annotations

import pytest
from chia_rs import G2Element

from chia._tests.util.spend_sim import CostLogger, sim_and_client
from chia.types.blockchain_format.program import Program
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.coin_spend import make_spend
from chia.types.mempool_inclusion_status import MempoolInclusionStatus
from chia.types.spend_bundle import SpendBundle
from chia.util.errors import Err
from chia.util.ints import uint64
from chia.wallet.conditions import CreateCoin
from chia.wallet.puzzles import p2_singleton_via_delegated_puzzle_safe as dp_safe
from chia.wallet.util.curry_and_treehash import shatree_atom

ACS = Program.to(1)
ACS_HASH = ACS.get_tree_hash()

MOCK_SINGLETON_MOD = Program.to([2, 5, 7]) # (a 5 11) - (mod (_ PUZZLE . solution) (a PUZZLE solution))
MOCK_SINGLETON_MOD_HASH = MOCK_SINGLETON_MOD.get_tree_hash()
MOCK_SINGLETON_LAUNCHER_ID = bytes32([0] * 32)
MOCK_SINGLETON_LAUNCHER_HASH = bytes32([1] * 32)
MOCK_SINGLETON = MOCK_SINGLETON_MOD.curry(
Program.to((MOCK_SINGLETON_MOD_HASH, (MOCK_SINGLETON_LAUNCHER_ID, MOCK_SINGLETON_LAUNCHER_HASH))),
ACS,
)
MOCK_SINGLETON_HASH = MOCK_SINGLETON.get_tree_hash()
dp_safe.PRE_HASHED_HASHES[MOCK_SINGLETON_MOD_HASH] = shatree_atom(MOCK_SINGLETON_MOD_HASH)
dp_safe.PRE_HASHED_HASHES[MOCK_SINGLETON_LAUNCHER_HASH] = shatree_atom(MOCK_SINGLETON_LAUNCHER_HASH)


@pytest.mark.anyio
async def test_dp_safe_lifecycle(cost_logger: CostLogger) -> None:
P2_SINGLETON = dp_safe.construct(MOCK_SINGLETON_LAUNCHER_ID, MOCK_SINGLETON_MOD_HASH, MOCK_SINGLETON_LAUNCHER_HASH)
P2_SINGLETON_HASH = dp_safe.construct_hash(
MOCK_SINGLETON_LAUNCHER_ID, MOCK_SINGLETON_MOD_HASH, MOCK_SINGLETON_LAUNCHER_HASH
)
assert dp_safe.match(P2_SINGLETON) is not None
assert dp_safe.match(ACS) is None
assert dp_safe.match(MOCK_SINGLETON) is None

async with sim_and_client() as (sim, sim_client):
await sim.farm_block(P2_SINGLETON_HASH)
await sim.farm_block(MOCK_SINGLETON_HASH)
p2_singleton = (await sim_client.get_coin_records_by_puzzle_hash(P2_SINGLETON_HASH, include_spent_coins=False))[
0
].coin
singleton = (await sim_client.get_coin_records_by_puzzle_hash(MOCK_SINGLETON_HASH, include_spent_coins=False))[
0
].coin

dp = Program.to(1)
dp_hash = dp.get_tree_hash()
bundle = cost_logger.add_cost(
"p2_singleton_w_mock_singleton",
SpendBundle(
[
make_spend(
p2_singleton,
P2_SINGLETON,
dp_safe.solve(
ACS_HASH,
dp,
Program.to([CreateCoin(bytes32([0] * 32), uint64(0)).to_program()]),
p2_singleton.name(),
),
),
make_spend(
singleton,
MOCK_SINGLETON,
Program.to([dp_safe.required_announcement(dp_hash, p2_singleton.name()).to_program()]),
),
],
G2Element(),
),
)
result = await sim_client.push_tx(bundle)
assert result == (MempoolInclusionStatus.SUCCESS, None)
checkpoint = sim.block_height
await sim.farm_block()

assert len(await sim_client.get_coin_records_by_puzzle_hash(bytes32([0] * 32), include_spent_coins=False)) == 1

await sim.rewind(checkpoint)

result = await sim_client.push_tx(
SpendBundle(
[
make_spend(
p2_singleton,
P2_SINGLETON,
dp_safe.solve(
ACS_HASH,
dp,
Program.to([CreateCoin(bytes32([0] * 32), uint64(0)).to_program()]),
bytes32([0] * 32),
),
),
make_spend(
singleton,
MOCK_SINGLETON,
Program.to([dp_safe.required_announcement(dp_hash, p2_singleton.name()).to_program()]),
),
],
G2Element(),
)
)
assert result == (MempoolInclusionStatus.FAILED, Err.ASSERT_MY_COIN_ID_FAILED)

result = await sim_client.push_tx(
SpendBundle(
[
make_spend(
p2_singleton,
P2_SINGLETON,
dp_safe.solve(
ACS_HASH,
dp,
Program.to([CreateCoin(bytes32([0] * 32), uint64(0)).to_program()]),
p2_singleton.name(),
),
),
make_spend(
singleton,
MOCK_SINGLETON,
Program.to([]),
),
],
G2Element(),
)
)
assert result == (MempoolInclusionStatus.FAILED, Err.ASSERT_ANNOUNCE_CONSUMED_FAILED)

result = await sim_client.push_tx(
SpendBundle(
[
make_spend(
p2_singleton,
P2_SINGLETON,
dp_safe.solve(
ACS_HASH,
dp,
Program.to([CreateCoin(bytes32([0] * 32), uint64(0)).to_program()]),
p2_singleton.name(),
),
),
make_spend(
singleton,
MOCK_SINGLETON,
Program.to([dp_safe.required_announcement(dp_hash, bytes32([0] * 32)).to_program()]),
),
],
G2Element(),
)
)
assert result == (MempoolInclusionStatus.FAILED, Err.ASSERT_ANNOUNCE_CONSUMED_FAILED)
104 changes: 104 additions & 0 deletions chia/_tests/cmds/wallet/test_vault.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
from __future__ import annotations

from pathlib import Path

from chia_rs import G1Element

from chia._tests.cmds.cmd_test_utils import TestRpcClients, TestWalletRpcClient, run_cli_command_and_assert
from chia._tests.cmds.wallet.test_consts import FINGERPRINT_ARG, STD_TX, STD_UTX, WALLET_ID_ARG
from chia.rpc.wallet_request_types import VaultCreate, VaultCreateResponse, VaultRecovery, VaultRecoveryResponse
from chia.util.ints import uint64
from chia.wallet.conditions import ConditionValidTimes
from chia.wallet.util.tx_config import TXConfig

test_condition_valid_times: ConditionValidTimes = ConditionValidTimes(min_time=uint64(100), max_time=uint64(150))


def test_vault_create(capsys: object, get_test_cli_clients: tuple[TestRpcClients, Path]) -> None:
test_rpc_clients, root_dir = get_test_cli_clients

# set RPC clients
class CreateVaultRpcClient(TestWalletRpcClient):
async def vault_create(
self,
args: VaultCreate,
tx_config: TXConfig,
timelock_info: ConditionValidTimes,
) -> VaultCreateResponse:
return VaultCreateResponse([STD_UTX], [STD_TX])

inst_rpc_client = CreateVaultRpcClient() # pylint: disable=no-value-for-parameter
test_rpc_clients.wallet_rpc_client = inst_rpc_client
pk = bytes(G1Element()).hex()
recovery_pk = bytes(G1Element()).hex()
timelock = "100"
hidden_puzzle_index = "10"
fee = "0.1"
command_args = [
"vault",
"create",
FINGERPRINT_ARG,
"-pk",
pk,
"-rk",
recovery_pk,
"-rt",
timelock,
"-i",
hidden_puzzle_index,
"-m",
fee,
"--valid-at",
"100",
"--expires-at",
"150",
]
assert_list = ["Successfully created a Vault wallet"]
run_cli_command_and_assert(capsys, root_dir, command_args, assert_list)


def test_vault_recovery(capsys: object, get_test_cli_clients: tuple[TestRpcClients, Path], tmp_path: Path) -> None:
test_rpc_clients, root_dir = get_test_cli_clients

# set RPC clients
class CreateVaultRpcClient(TestWalletRpcClient):
async def vault_recovery(
self,
args: VaultRecovery,
tx_config: TXConfig,
timelock_info: ConditionValidTimes,
) -> VaultRecoveryResponse:
return VaultRecoveryResponse([STD_UTX, STD_UTX], [STD_TX, STD_TX], STD_TX.name, STD_TX.name)

inst_rpc_client = CreateVaultRpcClient() # pylint: disable=no-value-for-parameter
test_rpc_clients.wallet_rpc_client = inst_rpc_client
pk = bytes(G1Element()).hex()
recovery_pk = bytes(G1Element()).hex()
timelock = "100"
hidden_puzzle_index = "10"
command_args = [
"vault",
"recover",
"-pk",
pk,
"-rk",
recovery_pk,
"-rt",
timelock,
"-i",
hidden_puzzle_index,
"-ri",
str(tmp_path / "recovery_init.json"),
"-rf",
str(tmp_path / "recovery_finish.json"),
"--valid-at",
"100",
"--expires-at",
"150",
]
assert_list = [
"Writing transactions to file ",
"recovery_init.json",
"recovery_finish.json",
]
run_cli_command_and_assert(capsys, root_dir, command_args + [FINGERPRINT_ARG, WALLET_ID_ARG], assert_list)
7 changes: 5 additions & 2 deletions chia/_tests/core/daemon/test_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import pytest
from aiohttp import WSMessage
from aiohttp.web_ws import WebSocketResponse
from chia_rs import G1Element
from chia_rs import G1Element, PrivateKey
from pytest_mock import MockerFixture

from chia._tests.util.misc import Marks, datacases
Expand All @@ -32,7 +32,7 @@
from chia.simulator.setup_services import setup_full_node
from chia.util.config import load_config
from chia.util.json_util import dict_to_json_str
from chia.util.keychain import Keychain, KeyData, supports_os_passphrase_storage
from chia.util.keychain import Keychain, KeyData, KeyTypes, supports_os_passphrase_storage
from chia.util.keyring_wrapper import DEFAULT_PASSPHRASE_IF_NO_MASTER_PASSPHRASE, KeyringWrapper
from chia.util.ws_message import create_payload, create_payload_dict
from chia.wallet.derive_keys import master_sk_to_farmer_sk, master_sk_to_pool_sk
Expand Down Expand Up @@ -205,6 +205,8 @@ async def get_keys_for_plotting(self, request: dict[str, Any]) -> dict[str, Any]
"hammer stable page grunt venture purse canyon discover "
"egg vivid spare immune awake code announce message"
)
assert isinstance(test_key_data.private_key, PrivateKey)
assert isinstance(test_key_data_2.private_key, PrivateKey)

success_response_data = {
"success": True,
Expand Down Expand Up @@ -237,6 +239,7 @@ async def get_keys_for_plotting(self, request: dict[str, Any]) -> dict[str, Any]
def add_private_key_response_data(fingerprint: int) -> dict[str, object]:
return {
"success": True,
"key_type": KeyTypes.G1_ELEMENT.value,
"fingerprint": fingerprint,
}

Expand Down
28 changes: 21 additions & 7 deletions chia/_tests/core/daemon/test_keychain_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import Any

import pytest
from chia_rs import G1Element

from chia.daemon.keychain_proxy import KeychainProxy, connect_to_keychain_and_validate
from chia.simulator.block_tools import BlockTools
Expand Down Expand Up @@ -48,21 +49,22 @@ async def test_add_private_key(keychain_proxy: KeychainProxy) -> None:
@pytest.mark.anyio
async def test_add_public_key(keychain_proxy: KeychainProxy) -> None:
keychain = keychain_proxy
await keychain.add_key(bytes(TEST_KEY_3.public_key).hex(), TEST_KEY_3.label, private=False)
assert isinstance(TEST_KEY_3.observation_root, G1Element)
await keychain.add_key(TEST_KEY_3.public_key.hex(), TEST_KEY_3.label, private=False)
with pytest.raises(Exception, match="already exists"):
await keychain.add_key(bytes(TEST_KEY_3.public_key).hex(), "", private=False)
await keychain.add_key(TEST_KEY_3.public_key.hex(), "", private=False)
key = await keychain.get_key(TEST_KEY_3.fingerprint, include_secrets=False)
assert key is not None
assert key.public_key == TEST_KEY_3.public_key
assert key.observation_root == TEST_KEY_3.observation_root
assert key.secrets is None

pk = await keychain.get_key_for_fingerprint(TEST_KEY_3.fingerprint, private=False)
assert pk is not None
assert pk == TEST_KEY_3.public_key
assert pk == TEST_KEY_3.observation_root

pk = await keychain.get_key_for_fingerprint(None, private=False)
assert pk is not None
assert pk == TEST_KEY_3.public_key
assert pk == TEST_KEY_3.observation_root

with pytest.raises(KeychainKeyNotFound):
pk = await keychain.get_key_for_fingerprint(1234567890, private=False)
Expand All @@ -83,8 +85,8 @@ async def test_get_key_for_fingerprint(keychain_proxy: KeychainProxy) -> None:
with pytest.raises(KeychainIsEmpty):
await keychain.get_key_for_fingerprint(None, private=False)
await keychain_proxy.add_key(TEST_KEY_1.mnemonic_str(), TEST_KEY_1.label)
assert await keychain.get_key_for_fingerprint(TEST_KEY_1.fingerprint, private=False) == TEST_KEY_1.public_key
assert await keychain.get_key_for_fingerprint(None, private=False) == TEST_KEY_1.public_key
assert await keychain.get_key_for_fingerprint(TEST_KEY_1.fingerprint, private=False) == TEST_KEY_1.observation_root
assert await keychain.get_key_for_fingerprint(None, private=False) == TEST_KEY_1.observation_root
with pytest.raises(KeychainKeyNotFound):
await keychain.get_key_for_fingerprint(1234567890, private=False)

Expand All @@ -99,3 +101,15 @@ async def test_get_keys(keychain_proxy_with_keys: KeychainProxy, include_secrets
else:
expected_keys = [replace(TEST_KEY_1, secrets=None), replace(TEST_KEY_2, secrets=None)]
assert keys == expected_keys


@pytest.mark.anyio
async def test_get_first_private_key(keychain_proxy_with_keys: KeychainProxy) -> None:
assert TEST_KEY_1.private_key == await keychain_proxy_with_keys.get_first_private_key()


@pytest.mark.anyio
async def test_get_all_private_keys(keychain_proxy_with_keys: KeychainProxy) -> None:
assert [TEST_KEY_1.private_key, TEST_KEY_2.private_key] == [
k for k, e in await keychain_proxy_with_keys.get_all_private_keys()
]
8 changes: 4 additions & 4 deletions chia/_tests/core/data_layer/test_data_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
from chia.util.timing import adjusted_timeout, backoff_times
from chia.wallet.trading.offer import Offer as TradingOffer
from chia.wallet.transaction_record import TransactionRecord
from chia.wallet.wallet import Wallet
from chia.wallet.wallet_node import WalletNode
from chia.wallet.wallet_protocol import MainWalletProtocol

pytestmark = pytest.mark.data_layer
nodes = tuple[WalletNode, FullNodeSimulator]
Expand Down Expand Up @@ -825,7 +825,7 @@ async def offer_setup_fixture(
[full_node_service], wallet_services, bt = two_wallet_nodes_services
enable_batch_autoinsertion_settings = getattr(request, "param", (True, True))
full_node_api = full_node_service._api
wallets: list[Wallet] = []
wallets: list[MainWalletProtocol] = []
for wallet_service in wallet_services:
wallet_node = wallet_service._node
assert wallet_node.server is not None
Expand Down Expand Up @@ -2373,8 +2373,8 @@ async def test_wallet_log_in_changes_active_fingerprint(

mnemonic = create_mnemonic()
assert wallet_rpc_api.service.local_keychain is not None
private_key = wallet_rpc_api.service.local_keychain.add_key(mnemonic_or_pk=mnemonic)
secondary_fingerprint: int = private_key.get_g1().get_fingerprint()
private_key, _ = wallet_rpc_api.service.local_keychain.add_key(mnemonic_or_pk=mnemonic)
secondary_fingerprint: int = private_key.public_key().get_fingerprint()

await wallet_rpc_api.log_in(request={"fingerprint": primary_fingerprint})

Expand Down
Loading
Loading