chia-blockchain 2.5.6rc2__py3-none-any.whl → 2.5.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. chia/_tests/blockchain/blockchain_test_utils.py +6 -7
  2. chia/_tests/blockchain/test_augmented_chain.py +4 -3
  3. chia/_tests/blockchain/test_blockchain.py +10 -5
  4. chia/_tests/clvm/coin_store.py +1 -1
  5. chia/_tests/cmds/cmd_test_utils.py +84 -97
  6. chia/_tests/cmds/test_dev_gh.py +1 -1
  7. chia/_tests/cmds/test_farm_cmd.py +56 -2
  8. chia/_tests/cmds/wallet/test_consts.py +3 -1
  9. chia/_tests/cmds/wallet/test_did.py +3 -8
  10. chia/_tests/cmds/wallet/test_nft.py +6 -6
  11. chia/_tests/cmds/wallet/test_notifications.py +39 -21
  12. chia/_tests/cmds/wallet/test_vcs.py +2 -1
  13. chia/_tests/cmds/wallet/test_wallet.py +160 -136
  14. chia/_tests/conftest.py +51 -26
  15. chia/_tests/core/cmds/test_wallet.py +4 -3
  16. chia/_tests/core/consensus/test_pot_iterations.py +71 -24
  17. chia/_tests/core/custom_types/test_proof_of_space.py +60 -30
  18. chia/_tests/core/custom_types/test_spend_bundle.py +1 -4
  19. chia/_tests/core/data_layer/conftest.py +7 -2
  20. chia/_tests/core/data_layer/old_format/__init__.py +0 -0
  21. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-005876c1cdc4d5f1726551b207b9f63efc9cd2f72df80a3a26a1ba73d40d6745-delta-23-v1.0.dat +0 -0
  22. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-005876c1cdc4d5f1726551b207b9f63efc9cd2f72df80a3a26a1ba73d40d6745-full-23-v1.0.dat +0 -0
  23. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-01b36e72a975cdc00d6514eea81668d19e8ea3150217ae98cb3361688a016fab-delta-9-v1.0.dat +0 -0
  24. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-01b36e72a975cdc00d6514eea81668d19e8ea3150217ae98cb3361688a016fab-full-9-v1.0.dat +0 -0
  25. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-06147c3b12d73e9b83b686a8c10b4a36a513c8a93c0ff99ae197f06326278be9-delta-5-v1.0.dat +0 -0
  26. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-06147c3b12d73e9b83b686a8c10b4a36a513c8a93c0ff99ae197f06326278be9-full-5-v1.0.dat +0 -0
  27. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-073c051a5934ad3b8db39eee2189e4300e55f48aaa17ff4ae30eeae088ff544a-delta-22-v1.0.dat +0 -0
  28. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-073c051a5934ad3b8db39eee2189e4300e55f48aaa17ff4ae30eeae088ff544a-full-22-v1.0.dat +0 -0
  29. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-0cc077559b9c7b4aefe8f8f591c195e0779bebdf89f2ad8285a00ea5f859d965-delta-1-v1.0.dat +0 -0
  30. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-0cc077559b9c7b4aefe8f8f591c195e0779bebdf89f2ad8285a00ea5f859d965-full-1-v1.0.dat +0 -0
  31. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-16377275567b723b20936d3f1ec0a2fd83f6ac379b922351a5e4c54949069f3b-delta-2-v1.0.dat +0 -0
  32. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-16377275567b723b20936d3f1ec0a2fd83f6ac379b922351a5e4c54949069f3b-full-2-v1.0.dat +0 -0
  33. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-1cb824a7a5f02cd30ac6c38e8f6216780d9bfa2d24811d282a368dcd541438a7-delta-29-v1.0.dat +0 -0
  34. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-1cb824a7a5f02cd30ac6c38e8f6216780d9bfa2d24811d282a368dcd541438a7-full-29-v1.0.dat +0 -0
  35. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-27b89dc4809ebc5a3b87757d35e95e2761d978cf121e44fa2773a5c06e4cc7b5-delta-28-v1.0.dat +0 -0
  36. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-27b89dc4809ebc5a3b87757d35e95e2761d978cf121e44fa2773a5c06e4cc7b5-full-28-v1.0.dat +0 -0
  37. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-28a6b7c134abfaeb0ab58a018313f6c87a61a40a4d9ec9bedf53aa1d12f3ee37-delta-7-v1.0.dat +0 -0
  38. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-28a6b7c134abfaeb0ab58a018313f6c87a61a40a4d9ec9bedf53aa1d12f3ee37-full-7-v1.0.dat +0 -0
  39. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-30a6bfe7cecbeda259a295dc6de3a436357f52388c3b03d86901e7da68565aeb-delta-19-v1.0.dat +0 -0
  40. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-30a6bfe7cecbeda259a295dc6de3a436357f52388c3b03d86901e7da68565aeb-full-19-v1.0.dat +0 -0
  41. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-343a2bf9add798e3ac2e6a571823cf9fa7e8a1bed532143354ead2648bd036ef-delta-10-v1.0.dat +0 -0
  42. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-343a2bf9add798e3ac2e6a571823cf9fa7e8a1bed532143354ead2648bd036ef-full-10-v1.0.dat +0 -0
  43. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-4d90efbc1fb3df324193831ea4a57dd5e10e67d9653343eb18d178272adb0447-delta-17-v1.0.dat +0 -0
  44. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-4d90efbc1fb3df324193831ea4a57dd5e10e67d9653343eb18d178272adb0447-full-17-v1.0.dat +0 -0
  45. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-4dd2ea099e91635c441f40b36d3f84078a2d818d2dc601c7278e72cbdfe3eca8-delta-20-v1.0.dat +0 -0
  46. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-4dd2ea099e91635c441f40b36d3f84078a2d818d2dc601c7278e72cbdfe3eca8-full-20-v1.0.dat +0 -0
  47. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-509effbdca78639023b933ce6c08a0465fb247e1cd5329e9e9c553940e4b6e46-delta-31-v1.0.dat +0 -0
  48. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-509effbdca78639023b933ce6c08a0465fb247e1cd5329e9e9c553940e4b6e46-full-31-v1.0.dat +0 -0
  49. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-5379a4d9ff29c29d1ef0906d22e82c52472753d31806189ab813c43365341b78-delta-40-v1.0.dat +0 -0
  50. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-5379a4d9ff29c29d1ef0906d22e82c52472753d31806189ab813c43365341b78-full-40-v1.0.dat +0 -0
  51. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-55908eda5686a8f89e4c50672cbe893ec1734fb23449dc03325efe7c414f9aa4-delta-49-v1.0.dat +0 -0
  52. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-55908eda5686a8f89e4c50672cbe893ec1734fb23449dc03325efe7c414f9aa4-full-49-v1.0.dat +0 -0
  53. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-57cc2691fb1fb986c99a58bcb0e029d0cd0cff41553d703147c54196d7d9ca63-delta-14-v1.0.dat +0 -0
  54. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-57cc2691fb1fb986c99a58bcb0e029d0cd0cff41553d703147c54196d7d9ca63-full-14-v1.0.dat +0 -0
  55. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-5943bf8ae4f5e59969d8570e4f40a8223299febdcfbcf188b3b3e2ab11044e18-delta-34-v1.0.dat +0 -0
  56. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-5943bf8ae4f5e59969d8570e4f40a8223299febdcfbcf188b3b3e2ab11044e18-full-34-v1.0.dat +0 -0
  57. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-6518527b7c939bee60ce6b024cbe90d3b9d8913c56b8ce11a4df5da7ff7db1c8-delta-8-v1.0.dat +0 -0
  58. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-6518527b7c939bee60ce6b024cbe90d3b9d8913c56b8ce11a4df5da7ff7db1c8-full-8-v1.0.dat +0 -0
  59. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-66ff26a26620379e14a7c91252d27ee4dbe06ad69a3a390a88642fe757f2b288-delta-45-v1.0.dat +0 -0
  60. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-66ff26a26620379e14a7c91252d27ee4dbe06ad69a3a390a88642fe757f2b288-full-45-v1.0.dat +0 -0
  61. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-6bd0a508ee2c4afbe9d4daa811139fd6e54e7f4e16850cbce999fa30f8bdccd2-delta-6-v1.0.dat +0 -0
  62. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-6bd0a508ee2c4afbe9d4daa811139fd6e54e7f4e16850cbce999fa30f8bdccd2-full-6-v1.0.dat +0 -0
  63. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-6ce850d0d77ca743fcc2fc792747472e5d2c1c0813aa43abbb370554428fc897-delta-48-v1.0.dat +0 -0
  64. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-6ce850d0d77ca743fcc2fc792747472e5d2c1c0813aa43abbb370554428fc897-full-48-v1.0.dat +0 -0
  65. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-6eb4ca2e1552b156c5969396b49070eb08ad6c96b347359387519be59f7ccaed-delta-26-v1.0.dat +0 -0
  66. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-6eb4ca2e1552b156c5969396b49070eb08ad6c96b347359387519be59f7ccaed-full-26-v1.0.dat +0 -0
  67. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-71c797fb7592d3f0a5a20c79ab8497ddaa0fd9ec17712e109d25c91b3f3c76e5-delta-3-v1.0.dat +0 -0
  68. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-71c797fb7592d3f0a5a20c79ab8497ddaa0fd9ec17712e109d25c91b3f3c76e5-full-3-v1.0.dat +0 -0
  69. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-73357026053d5a4969e7a6b9aeeef91c14cc6d5f32fc700fe6d21d2a1b22496c-delta-25-v1.0.dat +0 -0
  70. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-73357026053d5a4969e7a6b9aeeef91c14cc6d5f32fc700fe6d21d2a1b22496c-full-25-v1.0.dat +0 -0
  71. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-7c897e5c46e834ced65bde7de87716acfaa5dffbdb30b5cd9377d8c319df2034-delta-35-v1.0.dat +0 -0
  72. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-7c897e5c46e834ced65bde7de87716acfaa5dffbdb30b5cd9377d8c319df2034-full-35-v1.0.dat +0 -0
  73. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-87b8394d80d08117a5a1cd04ed8a682564eab7197a2c090159863591b5108874-delta-4-v1.0.dat +0 -0
  74. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-87b8394d80d08117a5a1cd04ed8a682564eab7197a2c090159863591b5108874-full-4-v1.0.dat +0 -0
  75. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-89eb40b9cc0921c5f5c3feb20927c13a9ada5760f82d219dcee153b7d400165c-delta-41-v1.0.dat +0 -0
  76. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-89eb40b9cc0921c5f5c3feb20927c13a9ada5760f82d219dcee153b7d400165c-full-41-v1.0.dat +0 -0
  77. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-8b649433156b8c924436cdec9c6de26106fd6f73a0528570f48748f7b40d7f8a-delta-21-v1.0.dat +0 -0
  78. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-8b649433156b8c924436cdec9c6de26106fd6f73a0528570f48748f7b40d7f8a-full-21-v1.0.dat +0 -0
  79. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-8d364023a0834c8c3077e236a465493acbf488e4f9d1f4c6cc230343c10a8f7d-delta-42-v1.0.dat +0 -0
  80. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-8d364023a0834c8c3077e236a465493acbf488e4f9d1f4c6cc230343c10a8f7d-full-42-v1.0.dat +0 -0
  81. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-925689e24a3d98d98676d816cdd8b73e7b2df057d9d4503da9b27bf91d79666c-delta-38-v1.0.dat +0 -0
  82. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-925689e24a3d98d98676d816cdd8b73e7b2df057d9d4503da9b27bf91d79666c-full-38-v1.0.dat +0 -0
  83. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-937be3d428b19f521be4f98faecc3307ae11ee731c76992f417fa4268d13859e-delta-11-v1.0.dat +0 -0
  84. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-937be3d428b19f521be4f98faecc3307ae11ee731c76992f417fa4268d13859e-full-11-v1.0.dat +0 -0
  85. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-97f34af499b79e2111fc296a598fc9654c2467ea038dfea41fd58241fb3642de-delta-32-v1.0.dat +0 -0
  86. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-97f34af499b79e2111fc296a598fc9654c2467ea038dfea41fd58241fb3642de-full-32-v1.0.dat +0 -0
  87. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-9d1b737243b8a1d0022f2b36ac53333c6280354a74d77f2a3642dcab35204e59-delta-33-v1.0.dat +0 -0
  88. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-9d1b737243b8a1d0022f2b36ac53333c6280354a74d77f2a3642dcab35204e59-full-33-v1.0.dat +0 -0
  89. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-a6663f98ef6ddf6db55f01163e34bb2e87aa82f0347e79ce31e8dbfa390c480c-delta-47-v1.0.dat +0 -0
  90. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-a6663f98ef6ddf6db55f01163e34bb2e87aa82f0347e79ce31e8dbfa390c480c-full-47-v1.0.dat +0 -0
  91. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-aa77376d1ccd3664e5c6366e010c52a978fedbf40f5ce262fee71b2e7fe0c6a9-delta-50-v1.0.dat +0 -0
  92. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-aa77376d1ccd3664e5c6366e010c52a978fedbf40f5ce262fee71b2e7fe0c6a9-full-50-v1.0.dat +0 -0
  93. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-b0f28514741ed1a71f5c6544bf92f9e0e493c5f3cf28328909771d8404eff626-delta-24-v1.0.dat +0 -0
  94. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-b0f28514741ed1a71f5c6544bf92f9e0e493c5f3cf28328909771d8404eff626-full-24-v1.0.dat +0 -0
  95. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-b3efee5358e6eb89ab3b60db2d128d57eef39e8538fb63c5632412d4f8e7d09e-delta-44-v1.0.dat +0 -0
  96. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-b3efee5358e6eb89ab3b60db2d128d57eef39e8538fb63c5632412d4f8e7d09e-full-44-v1.0.dat +0 -0
  97. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-bb0b56b6eb7acbb4e80893b04c72412fe833418232e1ed7b06d97d7a7f08b4e1-delta-16-v1.0.dat +0 -0
  98. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-bb0b56b6eb7acbb4e80893b04c72412fe833418232e1ed7b06d97d7a7f08b4e1-full-16-v1.0.dat +0 -0
  99. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-bc45262b757ff494b53bd2a8fba0f5511cc1f9c2a2c5360e04ea8cebbf6409df-delta-13-v1.0.dat +0 -0
  100. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-bc45262b757ff494b53bd2a8fba0f5511cc1f9c2a2c5360e04ea8cebbf6409df-full-13-v1.0.dat +0 -0
  101. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-bd0494ba430aff13458b557113b073d226eaf11257dfe26ff3323fa1cfe1335b-delta-39-v1.0.dat +0 -0
  102. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-bd0494ba430aff13458b557113b073d226eaf11257dfe26ff3323fa1cfe1335b-full-39-v1.0.dat +0 -0
  103. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-cd04f5fbba1553fa728b4dd8131d4723aaac288e0c7dc080447fbf0872c0a6eb-delta-36-v1.0.dat +0 -0
  104. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-cd04f5fbba1553fa728b4dd8131d4723aaac288e0c7dc080447fbf0872c0a6eb-full-36-v1.0.dat +0 -0
  105. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-cdd2399557fb3163a848f08831fdc833703354edb19a0d32a965fdb140f160c2-delta-18-v1.0.dat +0 -0
  106. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-cdd2399557fb3163a848f08831fdc833703354edb19a0d32a965fdb140f160c2-full-18-v1.0.dat +0 -0
  107. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-cf7a08fca7b1332095242e4d9800f4b94a3f4eaae88fe8407da42736d54b9e18-delta-37-v1.0.dat +0 -0
  108. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-cf7a08fca7b1332095242e4d9800f4b94a3f4eaae88fe8407da42736d54b9e18-full-37-v1.0.dat +0 -0
  109. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-d1f97465a9f52187e2ef3a0d811a1258f52380a65340c55f3e8e65b92753bc13-delta-15-v1.0.dat +0 -0
  110. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-d1f97465a9f52187e2ef3a0d811a1258f52380a65340c55f3e8e65b92753bc13-full-15-v1.0.dat +0 -0
  111. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-e475eccd4ee597e5ff67b1a249e37d65d6e3f754c3f0379fdb43692513588fef-delta-46-v1.0.dat +0 -0
  112. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-e475eccd4ee597e5ff67b1a249e37d65d6e3f754c3f0379fdb43692513588fef-full-46-v1.0.dat +0 -0
  113. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-e82e63517d78fd65b23a05c3b9a98cf905ddad7026995a238bfe634006b84cd0-delta-27-v1.0.dat +0 -0
  114. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-e82e63517d78fd65b23a05c3b9a98cf905ddad7026995a238bfe634006b84cd0-full-27-v1.0.dat +0 -0
  115. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-ed2cf0fd6c0f6237c87c161e1fca303b3fbe6c04e01f652b88720b4572143349-delta-12-v1.0.dat +0 -0
  116. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-ed2cf0fd6c0f6237c87c161e1fca303b3fbe6c04e01f652b88720b4572143349-full-12-v1.0.dat +0 -0
  117. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-f6e454eaf24a83c46a7bed4c19260a0a3ce0ed5c51739cb6d748d4913dc2ef58-delta-30-v1.0.dat +0 -0
  118. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-f6e454eaf24a83c46a7bed4c19260a0a3ce0ed5c51739cb6d748d4913dc2ef58-full-30-v1.0.dat +0 -0
  119. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-f7ad2bdf86d9609b4d6381086ec1e296bf558e2ff467ead29dd7fa6e31bacc56-delta-43-v1.0.dat +0 -0
  120. chia/_tests/core/data_layer/old_format/files/2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e612073746f7265206964-f7ad2bdf86d9609b4d6381086ec1e296bf558e2ff467ead29dd7fa6e31bacc56-full-43-v1.0.dat +0 -0
  121. chia/_tests/core/data_layer/old_format/files/__init__.py +0 -0
  122. chia/_tests/core/data_layer/old_format/old_db.sqlite +0 -0
  123. chia/_tests/core/data_layer/test_data_layer_util.py +18 -21
  124. chia/_tests/core/data_layer/test_data_rpc.py +77 -28
  125. chia/_tests/core/data_layer/test_data_store.py +637 -700
  126. chia/_tests/core/data_layer/test_data_store_schema.py +2 -209
  127. chia/_tests/core/full_node/ram_db.py +1 -1
  128. chia/_tests/core/full_node/stores/test_block_store.py +4 -10
  129. chia/_tests/core/full_node/stores/test_coin_store.py +1 -1
  130. chia/_tests/core/full_node/test_address_manager.py +3 -3
  131. chia/_tests/core/full_node/test_block_height_map.py +1 -1
  132. chia/_tests/core/full_node/test_full_node.py +91 -30
  133. chia/_tests/core/full_node/test_generator_tools.py +17 -10
  134. chia/_tests/core/mempool/test_mempool.py +190 -90
  135. chia/_tests/core/mempool/test_mempool_fee_estimator.py +2 -4
  136. chia/_tests/core/mempool/test_mempool_item_queries.py +1 -1
  137. chia/_tests/core/mempool/test_mempool_manager.py +252 -77
  138. chia/_tests/core/mempool/test_singleton_fast_forward.py +9 -27
  139. chia/_tests/core/server/serve.py +0 -2
  140. chia/_tests/core/server/test_rate_limits.py +400 -347
  141. chia/_tests/core/server/test_server.py +2 -2
  142. chia/_tests/core/services/test_services.py +7 -7
  143. chia/_tests/core/test_cost_calculation.py +31 -10
  144. chia/_tests/core/test_crawler.py +4 -4
  145. chia/_tests/core/test_db_conversion.py +7 -14
  146. chia/_tests/core/test_db_validation.py +2 -6
  147. chia/_tests/core/test_farmer_harvester_rpc.py +34 -1
  148. chia/_tests/core/test_full_node_rpc.py +28 -24
  149. chia/_tests/core/test_merkle_set.py +1 -4
  150. chia/_tests/core/test_seeder.py +1 -1
  151. chia/_tests/core/util/test_keychain.py +2 -2
  152. chia/_tests/core/util/test_lru_cache.py +16 -0
  153. chia/_tests/core/util/test_streamable.py +85 -4
  154. chia/_tests/environments/wallet.py +4 -1
  155. chia/_tests/farmer_harvester/test_farmer.py +8 -6
  156. chia/_tests/farmer_harvester/test_farmer_harvester.py +306 -8
  157. chia/_tests/farmer_harvester/test_filter_prefix_bits.py +3 -3
  158. chia/_tests/farmer_harvester/test_third_party_harvesters.py +11 -11
  159. chia/_tests/fee_estimation/test_fee_estimation_integration.py +2 -2
  160. chia/_tests/fee_estimation/test_fee_estimation_rpc.py +1 -1
  161. chia/_tests/fee_estimation/test_fee_estimation_unit_tests.py +1 -2
  162. chia/_tests/generator/test_rom.py +2 -1
  163. chia/_tests/harvester/__init__.py +0 -0
  164. chia/_tests/harvester/config.py +4 -0
  165. chia/_tests/harvester/test_harvester_api.py +157 -0
  166. chia/_tests/plot_sync/test_plot_sync.py +6 -3
  167. chia/_tests/plot_sync/test_receiver.py +16 -4
  168. chia/_tests/plot_sync/test_sender.py +8 -7
  169. chia/_tests/plot_sync/test_sync_simulated.py +15 -13
  170. chia/_tests/plot_sync/util.py +3 -2
  171. chia/_tests/plotting/test_plot_manager.py +21 -5
  172. chia/_tests/plotting/test_prover.py +106 -0
  173. chia/_tests/pools/test_pool_cmdline.py +7 -6
  174. chia/_tests/pools/test_pool_puzzles_lifecycle.py +10 -3
  175. chia/_tests/pools/test_pool_rpc.py +92 -64
  176. chia/_tests/solver/__init__.py +0 -0
  177. chia/_tests/solver/config.py +4 -0
  178. chia/_tests/solver/test_solver_service.py +29 -0
  179. chia/_tests/timelord/test_new_peak.py +1 -1
  180. chia/_tests/timelord/test_timelord.py +1 -1
  181. chia/_tests/util/benchmarks.py +5 -12
  182. chia/_tests/util/blockchain.py +1 -1
  183. chia/_tests/util/build_network_protocol_files.py +7 -0
  184. chia/_tests/util/network_protocol_data.py +26 -0
  185. chia/_tests/util/protocol_messages_bytes-v1.0 +0 -0
  186. chia/_tests/util/protocol_messages_json.py +19 -0
  187. chia/_tests/util/setup_nodes.py +21 -2
  188. chia/_tests/util/spend_sim.py +9 -3
  189. chia/_tests/util/test_condition_tools.py +3 -2
  190. chia/_tests/util/test_full_block_utils.py +10 -9
  191. chia/_tests/util/test_misc.py +10 -10
  192. chia/_tests/util/test_network.py +32 -1
  193. chia/_tests/util/test_network_protocol_files.py +333 -318
  194. chia/_tests/util/test_network_protocol_json.py +6 -0
  195. chia/_tests/util/test_network_protocol_test.py +27 -0
  196. chia/_tests/util/test_priority_mutex.py +1 -1
  197. chia/_tests/util/test_replace_str_to_bytes.py +6 -6
  198. chia/_tests/wallet/cat_wallet/test_cat_wallet.py +17 -13
  199. chia/_tests/wallet/cat_wallet/test_trades.py +55 -55
  200. chia/_tests/wallet/did_wallet/test_did.py +118 -1229
  201. chia/_tests/wallet/nft_wallet/config.py +1 -1
  202. chia/_tests/wallet/nft_wallet/test_nft_1_offers.py +73 -96
  203. chia/_tests/wallet/nft_wallet/test_nft_bulk_mint.py +15 -12
  204. chia/_tests/wallet/nft_wallet/test_nft_offers.py +67 -134
  205. chia/_tests/wallet/nft_wallet/test_nft_wallet.py +31 -26
  206. chia/_tests/wallet/rpc/test_wallet_rpc.py +765 -371
  207. chia/_tests/wallet/sync/test_wallet_sync.py +6 -0
  208. chia/_tests/wallet/test_new_wallet_protocol.py +1 -1
  209. chia/_tests/wallet/test_signer_protocol.py +2 -2
  210. chia/_tests/wallet/test_singleton_lifecycle_fast.py +3 -4
  211. chia/_tests/wallet/test_transaction_store.py +42 -33
  212. chia/_tests/wallet/test_wallet.py +22 -31
  213. chia/_tests/wallet/test_wallet_state_manager.py +14 -7
  214. chia/_tests/wallet/vc_wallet/test_vc_wallet.py +53 -32
  215. chia/apis.py +2 -0
  216. chia/cmds/beta.py +7 -3
  217. chia/cmds/chia.py +2 -0
  218. chia/cmds/cmd_classes.py +11 -27
  219. chia/cmds/cmds_util.py +3 -0
  220. chia/cmds/coin_funcs.py +27 -22
  221. chia/cmds/configure.py +42 -18
  222. chia/cmds/dev/data.py +22 -3
  223. chia/cmds/farm.py +32 -0
  224. chia/cmds/farm_funcs.py +54 -5
  225. chia/cmds/init_funcs.py +4 -0
  226. chia/cmds/keys_funcs.py +8 -10
  227. chia/cmds/peer_funcs.py +8 -10
  228. chia/cmds/plotnft_funcs.py +24 -16
  229. chia/cmds/rpc.py +11 -1
  230. chia/cmds/show_funcs.py +5 -5
  231. chia/cmds/solver.py +33 -0
  232. chia/cmds/solver_funcs.py +21 -0
  233. chia/cmds/wallet.py +1 -1
  234. chia/cmds/wallet_funcs.py +149 -96
  235. chia/consensus/block_body_validation.py +8 -9
  236. chia/consensus/block_creation.py +9 -10
  237. chia/consensus/block_header_validation.py +61 -69
  238. chia/{full_node → consensus}/block_height_map.py +2 -1
  239. chia/consensus/block_height_map_protocol.py +21 -0
  240. chia/consensus/block_rewards.py +12 -12
  241. chia/consensus/blockchain.py +8 -18
  242. chia/consensus/default_constants.py +6 -6
  243. chia/consensus/generator_tools.py +1 -1
  244. chia/consensus/get_block_challenge.py +24 -25
  245. chia/consensus/pos_quality.py +28 -2
  246. chia/consensus/pot_iterations.py +15 -17
  247. chia/daemon/keychain_proxy.py +5 -0
  248. chia/daemon/server.py +2 -3
  249. chia/data_layer/data_layer.py +32 -24
  250. chia/data_layer/data_layer_errors.py +5 -0
  251. chia/data_layer/data_layer_rpc_api.py +1 -1
  252. chia/data_layer/data_layer_service.py +8 -0
  253. chia/data_layer/data_layer_util.py +49 -89
  254. chia/data_layer/data_layer_wallet.py +20 -17
  255. chia/data_layer/data_store.py +1051 -1462
  256. chia/data_layer/download_data.py +44 -115
  257. chia/{server → data_layer}/start_data_layer.py +2 -1
  258. chia/data_layer/util/benchmark.py +38 -53
  259. chia/farmer/farmer.py +3 -0
  260. chia/farmer/farmer_api.py +104 -5
  261. chia/farmer/farmer_rpc_api.py +20 -0
  262. chia/farmer/farmer_rpc_client.py +6 -2
  263. chia/farmer/farmer_service.py +8 -0
  264. chia/{server → farmer}/start_farmer.py +9 -3
  265. chia/full_node/block_store.py +20 -10
  266. chia/full_node/coin_store.py +12 -4
  267. chia/full_node/eligible_coin_spends.py +17 -72
  268. chia/full_node/full_node.py +68 -71
  269. chia/full_node/full_node_api.py +26 -32
  270. chia/full_node/full_node_rpc_api.py +44 -33
  271. chia/full_node/full_node_rpc_client.py +67 -79
  272. chia/full_node/full_node_service.py +8 -0
  273. chia/full_node/full_node_store.py +5 -3
  274. chia/full_node/mempool.py +15 -16
  275. chia/full_node/mempool_manager.py +73 -89
  276. chia/{server → full_node}/start_full_node.py +1 -1
  277. chia/full_node/subscriptions.py +2 -2
  278. chia/full_node/weight_proof.py +14 -15
  279. chia/harvester/harvester.py +8 -1
  280. chia/harvester/harvester_api.py +178 -44
  281. chia/harvester/harvester_service.py +8 -0
  282. chia/{server → harvester}/start_harvester.py +1 -1
  283. chia/introducer/introducer_service.py +8 -0
  284. chia/{server → introducer}/start_introducer.py +1 -1
  285. chia/plot_sync/receiver.py +6 -1
  286. chia/plot_sync/sender.py +7 -4
  287. chia/plotting/cache.py +37 -28
  288. chia/plotting/check_plots.py +83 -48
  289. chia/plotting/create_plots.py +3 -4
  290. chia/plotting/manager.py +18 -13
  291. chia/plotting/prover.py +153 -0
  292. chia/plotting/util.py +14 -6
  293. chia/pools/pool_wallet.py +6 -4
  294. chia/protocols/harvester_protocol.py +14 -0
  295. chia/protocols/outbound_message.py +1 -0
  296. chia/protocols/pool_protocol.py +1 -1
  297. chia/protocols/protocol_message_types.py +7 -0
  298. chia/protocols/shared_protocol.py +2 -0
  299. chia/protocols/solver_protocol.py +18 -0
  300. chia/rpc/rpc_server.py +1 -1
  301. chia/seeder/crawl_store.py +4 -8
  302. chia/seeder/crawler.py +2 -2
  303. chia/seeder/crawler_service.py +8 -0
  304. chia/seeder/start_crawler.py +1 -1
  305. chia/server/address_manager.py +12 -15
  306. chia/server/introducer_peers.py +1 -1
  307. chia/server/node_discovery.py +9 -10
  308. chia/server/rate_limit_numbers.py +157 -168
  309. chia/server/rate_limits.py +44 -41
  310. chia/server/resolve_peer_info.py +5 -0
  311. chia/server/server.py +17 -7
  312. chia/server/start_service.py +0 -1
  313. chia/simulator/block_tools.py +92 -58
  314. chia/simulator/full_node_simulator.py +1 -1
  315. chia/simulator/setup_services.py +52 -15
  316. chia/solver/__init__.py +0 -0
  317. chia/solver/solver.py +100 -0
  318. chia/solver/solver_api.py +59 -0
  319. chia/solver/solver_rpc_api.py +31 -0
  320. chia/solver/solver_rpc_client.py +16 -0
  321. chia/solver/solver_service.py +8 -0
  322. chia/solver/start_solver.py +102 -0
  323. {mozilla-ca → chia/ssl}/cacert.pem +0 -27
  324. chia/ssl/create_ssl.py +3 -2
  325. chia/{server → timelord}/start_timelord.py +1 -1
  326. chia/timelord/timelord.py +12 -13
  327. chia/timelord/timelord_service.py +8 -0
  328. chia/types/blockchain_format/proof_of_space.py +61 -17
  329. chia/types/coin_spend.py +0 -8
  330. chia/types/internal_mempool_item.py +3 -3
  331. chia/types/mempool_item.py +15 -8
  332. chia/types/mempool_submission_status.py +1 -1
  333. chia/util/config.py +1 -3
  334. chia/util/db_wrapper.py +7 -8
  335. chia/util/initial-config.yaml +46 -0
  336. chia/util/lru_cache.py +8 -4
  337. chia/util/network.py +9 -0
  338. chia/util/streamable.py +38 -8
  339. chia/util/virtual_project_analysis.py +1 -1
  340. chia/wallet/cat_wallet/cat_outer_puzzle.py +7 -4
  341. chia/wallet/cat_wallet/cat_wallet.py +13 -7
  342. chia/wallet/cat_wallet/r_cat_wallet.py +4 -1
  343. chia/wallet/conditions.py +1 -3
  344. chia/wallet/did_wallet/did_wallet.py +27 -332
  345. chia/wallet/nft_wallet/nft_puzzle_utils.py +1 -1
  346. chia/wallet/nft_wallet/nft_wallet.py +9 -7
  347. chia/wallet/puzzle_drivers.py +7 -8
  348. chia/{server → wallet}/start_wallet.py +1 -1
  349. chia/wallet/trade_manager.py +12 -9
  350. chia/wallet/transaction_record.py +14 -51
  351. chia/wallet/util/clvm_streamable.py +28 -41
  352. chia/wallet/util/merkle_utils.py +2 -2
  353. chia/wallet/util/tx_config.py +3 -6
  354. chia/wallet/vc_wallet/cr_cat_wallet.py +12 -6
  355. chia/wallet/vc_wallet/vc_wallet.py +13 -15
  356. chia/wallet/wallet.py +5 -3
  357. chia/wallet/wallet_node.py +25 -30
  358. chia/wallet/wallet_request_types.py +538 -101
  359. chia/wallet/wallet_rpc_api.py +398 -570
  360. chia/wallet/wallet_rpc_client.py +144 -332
  361. chia/wallet/wallet_service.py +8 -0
  362. chia/wallet/wallet_state_manager.py +53 -42
  363. chia/wallet/wallet_transaction_store.py +13 -5
  364. {chia_blockchain-2.5.6rc2.dist-info → chia_blockchain-2.5.7.dist-info}/METADATA +31 -31
  365. {chia_blockchain-2.5.6rc2.dist-info → chia_blockchain-2.5.7.dist-info}/RECORD +368 -240
  366. {chia_blockchain-2.5.6rc2.dist-info → chia_blockchain-2.5.7.dist-info}/WHEEL +1 -1
  367. {chia_blockchain-2.5.6rc2.dist-info → chia_blockchain-2.5.7.dist-info}/entry_points.txt +8 -7
  368. chia/full_node/mempool_check_conditions.py +0 -102
  369. chia/server/aliases.py +0 -35
  370. {chia_blockchain-2.5.6rc2.dist-info → chia_blockchain-2.5.7.dist-info/licenses}/LICENSE +0 -0
@@ -6,9 +6,10 @@ import io
6
6
  import json
7
7
  import logging
8
8
  import random
9
+ import re
9
10
  from collections.abc import AsyncIterator
10
11
  from operator import attrgetter
11
- from typing import Any, Optional, cast
12
+ from typing import Any, Optional
12
13
  from unittest.mock import patch
13
14
 
14
15
  import aiosqlite
@@ -52,7 +53,6 @@ from chia.cmds.param_types import CliAmount
52
53
  from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
53
54
  from chia.full_node.full_node_rpc_client import FullNodeRpcClient
54
55
  from chia.rpc.rpc_client import ResponseFailureError
55
- from chia.server.aliases import WalletService
56
56
  from chia.server.server import ChiaServer
57
57
  from chia.simulator.full_node_simulator import FullNodeSimulator
58
58
  from chia.simulator.simulator_protocol import FarmNewBlockProtocol
@@ -105,26 +105,42 @@ from chia.wallet.wallet_node import WalletNode
105
105
  from chia.wallet.wallet_protocol import WalletProtocol
106
106
  from chia.wallet.wallet_request_types import (
107
107
  AddKey,
108
+ CATAssetIDToName,
109
+ CATGetAssetID,
110
+ CATGetName,
111
+ CATSetName,
112
+ CATSpend,
108
113
  CheckDeleteKey,
114
+ CheckOfferValidity,
115
+ ClawbackPuzzleDecoratorOverride,
109
116
  CombineCoins,
110
117
  DefaultCAT,
111
118
  DeleteKey,
119
+ DeleteNotifications,
120
+ DeleteUnconfirmedTransactions,
112
121
  DIDCreateBackupFile,
113
122
  DIDGetDID,
114
123
  DIDGetMetadata,
115
124
  DIDGetPubkey,
116
- DIDGetRecoveryList,
117
125
  DIDGetWalletName,
118
126
  DIDMessageSpend,
119
127
  DIDSetWalletName,
120
128
  DIDTransferDID,
121
129
  DIDUpdateMetadata,
122
- DIDUpdateRecoveryIDs,
123
130
  FungibleAsset,
131
+ GetCoinRecordsByNames,
132
+ GetNextAddress,
124
133
  GetNotifications,
125
134
  GetPrivateKey,
135
+ GetSpendableCoins,
126
136
  GetSyncStatusResponse,
127
137
  GetTimestampForHeight,
138
+ GetTransaction,
139
+ GetTransactionCount,
140
+ GetTransactions,
141
+ GetWalletBalance,
142
+ GetWalletBalances,
143
+ GetWallets,
128
144
  LogIn,
129
145
  NFTCalculateRoyalties,
130
146
  NFTGetInfo,
@@ -134,13 +150,18 @@ from chia.wallet.wallet_request_types import (
134
150
  PushTransactions,
135
151
  PushTX,
136
152
  RoyaltyAsset,
153
+ SelectCoins,
154
+ SendNotification,
155
+ SendTransaction,
137
156
  SetWalletResyncOnStartup,
157
+ SpendClawbackCoins,
138
158
  SplitCoins,
139
159
  VerifySignature,
140
160
  VerifySignatureResponse,
141
161
  )
142
162
  from chia.wallet.wallet_rpc_api import WalletRpcApi
143
163
  from chia.wallet.wallet_rpc_client import WalletRpcClient
164
+ from chia.wallet.wallet_service import WalletService
144
165
  from chia.wallet.wallet_spend_bundle import WalletSpendBundle
145
166
 
146
167
  log = logging.getLogger(__name__)
@@ -191,9 +212,11 @@ async def farm_transaction(
191
212
 
192
213
 
193
214
  async def generate_funds(full_node_api: FullNodeSimulator, wallet_bundle: WalletBundle, num_blocks: int = 1) -> int:
194
- wallet_id = 1
195
- initial_balances = await wallet_bundle.rpc_client.get_wallet_balance(wallet_id)
196
- ph: bytes32 = decode_puzzle_hash(await wallet_bundle.rpc_client.get_next_address(wallet_id, True))
215
+ wallet_id = uint32(1)
216
+ initial_balances = (await wallet_bundle.rpc_client.get_wallet_balance(GetWalletBalance(wallet_id))).wallet_balance
217
+ ph: bytes32 = decode_puzzle_hash(
218
+ (await wallet_bundle.rpc_client.get_next_address(GetNextAddress(wallet_id, True))).address
219
+ )
197
220
  generated_funds = 0
198
221
  for _ in range(num_blocks):
199
222
  await full_node_api.farm_new_transaction_block(FarmNewBlockProtocol(ph))
@@ -204,8 +227,8 @@ async def generate_funds(full_node_api: FullNodeSimulator, wallet_bundle: Wallet
204
227
  # Farm a dummy block to confirm the created funds
205
228
  await farm_transaction_block(full_node_api, wallet_bundle.node)
206
229
 
207
- expected_confirmed = initial_balances["confirmed_wallet_balance"] + generated_funds
208
- expected_unconfirmed = initial_balances["unconfirmed_wallet_balance"] + generated_funds
230
+ expected_confirmed = initial_balances.confirmed_wallet_balance + generated_funds
231
+ expected_unconfirmed = initial_balances.unconfirmed_wallet_balance + generated_funds
209
232
  await time_out_assert(20, get_confirmed_balance, expected_confirmed, wallet_bundle.rpc_client, wallet_id)
210
233
  await time_out_assert(20, get_unconfirmed_balance, expected_unconfirmed, wallet_bundle.rpc_client, wallet_id)
211
234
  await time_out_assert(20, check_client_synced, True, wallet_bundle.rpc_client)
@@ -282,12 +305,12 @@ async def create_tx_outputs(wallet: Wallet, output_args: list[tuple[int, Optiona
282
305
 
283
306
  async def assert_wallet_types(client: WalletRpcClient, expected: dict[WalletType, int]) -> None:
284
307
  for wallet_type in WalletType:
285
- wallets = await client.get_wallets(wallet_type)
308
+ wallets = (await client.get_wallets(GetWallets(uint16(wallet_type.value)))).wallets
286
309
  wallet_count = len(wallets)
287
310
  if wallet_type in expected:
288
311
  assert wallet_count == expected.get(wallet_type, 0)
289
312
  for wallet in wallets:
290
- assert wallet["type"] == wallet_type.value
313
+ assert wallet.type == wallet_type.value
291
314
 
292
315
 
293
316
  def assert_tx_amounts(
@@ -327,30 +350,35 @@ async def assert_push_tx_error(node_rpc: FullNodeRpcClient, tx: TransactionRecor
327
350
  async def assert_get_balance(rpc_client: WalletRpcClient, wallet_node: WalletNode, wallet: WalletProtocol[Any]) -> None:
328
351
  expected_balance = await wallet_node.get_balance(wallet.id())
329
352
  expected_balance_dict = expected_balance.to_json_dict()
353
+ expected_balance_dict.setdefault("pending_approval_balance", None)
330
354
  expected_balance_dict["wallet_id"] = wallet.id()
331
355
  expected_balance_dict["wallet_type"] = wallet.type()
332
356
  expected_balance_dict["fingerprint"] = wallet_node.logged_in_fingerprint
333
357
  if wallet.type() in {WalletType.CAT, WalletType.CRCAT}:
334
358
  assert isinstance(wallet, CATWallet)
335
- expected_balance_dict["asset_id"] = wallet.get_asset_id()
336
- assert await rpc_client.get_wallet_balance(wallet.id()) == expected_balance_dict
359
+ expected_balance_dict["asset_id"] = "0x" + wallet.get_asset_id()
360
+ else:
361
+ expected_balance_dict["asset_id"] = None
362
+ assert (
363
+ await rpc_client.get_wallet_balance(GetWalletBalance(wallet.id()))
364
+ ).wallet_balance.to_json_dict() == expected_balance_dict
337
365
 
338
366
 
339
367
  async def tx_in_mempool(client: WalletRpcClient, transaction_id: bytes32) -> bool:
340
- tx = await client.get_transaction(transaction_id)
368
+ tx = (await client.get_transaction(GetTransaction(transaction_id))).transaction
341
369
  return tx.is_in_mempool()
342
370
 
343
371
 
344
372
  async def get_confirmed_balance(client: WalletRpcClient, wallet_id: int) -> uint128:
345
- balance = await client.get_wallet_balance(wallet_id)
346
- # TODO: casting due to lack of type checked deserialization
347
- return cast(uint128, balance["confirmed_wallet_balance"])
373
+ return (
374
+ await client.get_wallet_balance(GetWalletBalance(uint32(wallet_id)))
375
+ ).wallet_balance.confirmed_wallet_balance
348
376
 
349
377
 
350
378
  async def get_unconfirmed_balance(client: WalletRpcClient, wallet_id: int) -> uint128:
351
- balance = await client.get_wallet_balance(wallet_id)
352
- # TODO: casting due to lack of type checked deserialization
353
- return cast(uint128, balance["unconfirmed_wallet_balance"])
379
+ return (
380
+ await client.get_wallet_balance(GetWalletBalance(uint32(wallet_id)))
381
+ ).wallet_balance.unconfirmed_wallet_balance
354
382
 
355
383
 
356
384
  @pytest.mark.anyio
@@ -368,24 +396,25 @@ async def test_send_transaction(wallet_rpc_environment: WalletRpcTestEnvironment
368
396
  addr = encode_puzzle_hash(await action_scope.get_puzzle_hash(wallet_2.wallet_state_manager), "txch")
369
397
  tx_amount = uint64(15600000)
370
398
  with pytest.raises(ValueError):
371
- await client.send_transaction(1, uint64(100000000000000001), addr, DEFAULT_TX_CONFIG)
399
+ await client.send_transaction(
400
+ SendTransaction(wallet_id=uint32(1), amount=uint64(100000000000000001), address=addr, push=True),
401
+ DEFAULT_TX_CONFIG,
402
+ )
372
403
 
373
404
  # Tests sending a basic transaction
374
405
  extra_conditions = (Remark(Program.to(("test", None))),)
375
406
  non_existent_coin = Coin(bytes32.zeros, bytes32.zeros, uint64(0))
376
407
  tx_no_push = (
377
408
  await client.send_transaction(
378
- 1,
379
- tx_amount,
380
- addr,
381
- memos=["this is a basic tx"],
409
+ SendTransaction(
410
+ wallet_id=uint32(1), amount=tx_amount, address=addr, memos=["this is a basic tx"], push=False
411
+ ),
382
412
  tx_config=DEFAULT_TX_CONFIG.override(
383
413
  excluded_coin_amounts=[uint64(250000000000)],
384
414
  excluded_coin_ids=[non_existent_coin.name()],
385
415
  reuse_puzhash=True,
386
416
  ),
387
417
  extra_conditions=extra_conditions,
388
- push=False,
389
418
  )
390
419
  ).transaction
391
420
  response = await client.fetch(
@@ -407,7 +436,7 @@ async def test_send_transaction(wallet_rpc_environment: WalletRpcTestEnvironment
407
436
  },
408
437
  )
409
438
  assert response["success"]
410
- tx = TransactionRecord.from_json_dict_convenience(response["transactions"][0])
439
+ tx = TransactionRecord.from_json_dict(response["transactions"][0])
411
440
  [
412
441
  byte_deserialize_clvm_streamable(
413
442
  bytes.fromhex(utx), UnsignedTransaction, translation_layer=BLIND_SIGNER_TRANSLATION
@@ -425,11 +454,11 @@ async def test_send_transaction(wallet_rpc_environment: WalletRpcTestEnvironment
425
454
  await farm_transaction(full_node_api, wallet_node, spend_bundle)
426
455
 
427
456
  # Checks that the memo can be retrieved
428
- tx_confirmed = await client.get_transaction(transaction_id)
457
+ tx_confirmed = (await client.get_transaction(GetTransaction(transaction_id))).transaction
429
458
  assert tx_confirmed.confirmed
430
- assert len(tx_confirmed.get_memos()) == 1
431
- assert [b"this is a basic tx"] in tx_confirmed.get_memos().values()
432
- assert next(iter(tx_confirmed.get_memos().keys())) in [a.name() for a in spend_bundle.additions()]
459
+ assert len(tx_confirmed.memos) == 1
460
+ assert [b"this is a basic tx"] in tx_confirmed.memos.values()
461
+ assert next(iter(tx_confirmed.memos.keys())) in [a.name() for a in spend_bundle.additions()]
433
462
 
434
463
  await time_out_assert(20, get_confirmed_balance, generated_funds - tx_amount, client, 1)
435
464
 
@@ -459,9 +488,7 @@ async def test_push_transactions(wallet_rpc_environment: WalletRpcTestEnvironmen
459
488
  PushTransactions(transactions=[tx], fee=uint64(10)),
460
489
  DEFAULT_TX_CONFIG,
461
490
  )
462
- resp = await client.fetch(
463
- "push_transactions", {"transactions": [tx.to_json_dict_convenience(wallet_node.config)], "fee": 10}
464
- )
491
+ resp = await client.fetch("push_transactions", {"transactions": [tx.to_json_dict()], "fee": 10})
465
492
  assert resp["success"]
466
493
  resp = await client.fetch("push_transactions", {"transactions": [bytes(tx).hex()], "fee": 10})
467
494
  assert resp["success"]
@@ -473,7 +500,7 @@ async def test_push_transactions(wallet_rpc_environment: WalletRpcTestEnvironmen
473
500
  await farm_transaction(full_node_api, wallet_node, spend_bundle)
474
501
 
475
502
  for tx in resp_client.transactions:
476
- assert (await client.get_transaction(transaction_id=tx.name)).confirmed
503
+ assert (await client.get_transaction(GetTransaction(transaction_id=tx.name))).transaction.confirmed
477
504
 
478
505
  # Just testing NOT failure here really (parsing)
479
506
  await client.push_tx(PushTX(spend_bundle))
@@ -629,25 +656,28 @@ async def test_create_signed_transaction(
629
656
 
630
657
  selected_coin = None
631
658
  if select_coin:
632
- selected_coin = await wallet_1_rpc.select_coins(
633
- amount=amount_total, wallet_id=wallet_id, coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG
659
+ select_coins_response = await wallet_1_rpc.select_coins(
660
+ SelectCoins.from_coin_selection_config(
661
+ amount=amount_total, wallet_id=uint32(wallet_id), coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG
662
+ )
634
663
  )
635
- assert len(selected_coin) == 1
664
+ assert len(select_coins_response.coins) == 1
665
+ selected_coin = select_coins_response.coins[0]
636
666
 
637
667
  txs = (
638
668
  await wallet_1_rpc.create_signed_transactions(
639
669
  outputs,
640
- coins=selected_coin,
670
+ coins=[selected_coin] if selected_coin is not None else [],
641
671
  fee=amount_fee,
642
672
  wallet_id=wallet_id,
643
673
  # shouldn't actually block it
644
674
  tx_config=DEFAULT_TX_CONFIG.override(
645
- excluded_coin_amounts=[uint64(selected_coin[0].amount)] if selected_coin is not None else [],
675
+ excluded_coin_amounts=[uint64(selected_coin.amount)] if selected_coin is not None else [],
646
676
  ),
647
677
  push=True,
648
678
  )
649
679
  ).transactions
650
- change_expected = not selected_coin or selected_coin[0].amount - amount_total > 0
680
+ change_expected = not selected_coin or selected_coin.amount - amount_total > 0
651
681
  assert_tx_amounts(txs[-1], outputs, amount_fee=amount_fee, change_expected=change_expected, is_cat=is_cat)
652
682
 
653
683
  # Farm the transaction and make sure the wallet balance reflects it correct
@@ -768,38 +798,42 @@ async def test_create_signed_transaction_with_excluded_coins(wallet_rpc_environm
768
798
  await generate_funds(full_node_api, env.wallet_1)
769
799
 
770
800
  async def it_does_not_include_the_excluded_coins() -> None:
771
- selected_coins = await wallet_1_rpc.select_coins(
772
- amount=250000000000, wallet_id=1, coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG
801
+ select_coins_response = await wallet_1_rpc.select_coins(
802
+ SelectCoins.from_coin_selection_config(
803
+ amount=uint64(250000000000), wallet_id=uint32(1), coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG
804
+ )
773
805
  )
774
- assert len(selected_coins) == 1
806
+ assert len(select_coins_response.coins) == 1
775
807
  outputs = await create_tx_outputs(wallet_1, [(uint64(250000000000), None)])
776
808
 
777
809
  tx = (
778
810
  await wallet_1_rpc.create_signed_transactions(
779
811
  outputs,
780
812
  DEFAULT_TX_CONFIG.override(
781
- excluded_coin_ids=[c.name() for c in selected_coins],
813
+ excluded_coin_ids=[c.name() for c in select_coins_response.coins],
782
814
  ),
783
815
  )
784
816
  ).signed_tx
785
817
 
786
818
  assert len(tx.removals) == 1
787
- assert tx.removals[0] != selected_coins[0]
819
+ assert tx.removals[0] != select_coins_response.coins[0]
788
820
  assert tx.removals[0].amount == uint64(1750000000000)
789
821
  await assert_push_tx_error(full_node_rpc, tx)
790
822
 
791
823
  async def it_throws_an_error_when_all_spendable_coins_are_excluded() -> None:
792
- selected_coins = await wallet_1_rpc.select_coins(
793
- amount=1750000000000, wallet_id=1, coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG
824
+ select_coins_response = await wallet_1_rpc.select_coins(
825
+ SelectCoins.from_coin_selection_config(
826
+ amount=uint64(1750000000000), wallet_id=uint32(1), coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG
827
+ )
794
828
  )
795
- assert len(selected_coins) == 1
829
+ assert len(select_coins_response.coins) == 1
796
830
  outputs = await create_tx_outputs(wallet_1, [(uint64(1750000000000), None)])
797
831
 
798
832
  with pytest.raises(ValueError):
799
833
  await wallet_1_rpc.create_signed_transactions(
800
834
  outputs,
801
835
  DEFAULT_TX_CONFIG.override(
802
- excluded_coin_ids=[c.name() for c in selected_coins],
836
+ excluded_coin_ids=[c.name() for c in select_coins_response.coins],
803
837
  ),
804
838
  )
805
839
 
@@ -818,7 +852,6 @@ async def test_spend_clawback_coins(wallet_rpc_environment: WalletRpcTestEnviron
818
852
  wallet_1 = wallet_1_node.wallet_state_manager.main_wallet
819
853
  wallet_2 = wallet_2_node.wallet_state_manager.main_wallet
820
854
  full_node_api: FullNodeSimulator = env.full_node.api
821
- wallet_2_api = WalletRpcApi(wallet_2_node)
822
855
 
823
856
  generated_funds = await generate_funds(full_node_api, env.wallet_1, 1)
824
857
  await generate_funds(full_node_api, env.wallet_2, 1)
@@ -829,12 +862,14 @@ async def test_spend_clawback_coins(wallet_rpc_environment: WalletRpcTestEnviron
829
862
  wallet_2_puzhash = await action_scope.get_puzzle_hash(wallet_2.wallet_state_manager)
830
863
  tx = (
831
864
  await wallet_1_rpc.send_transaction(
832
- wallet_id=1,
833
- amount=uint64(500),
834
- address=encode_puzzle_hash(wallet_2_puzhash, "txch"),
865
+ SendTransaction(
866
+ wallet_id=uint32(1),
867
+ amount=uint64(500),
868
+ address=encode_puzzle_hash(wallet_2_puzhash, "txch"),
869
+ puzzle_decorator=[ClawbackPuzzleDecoratorOverride(decorator="CLAWBACK", clawback_timelock=uint64(5))],
870
+ push=True,
871
+ ),
835
872
  tx_config=DEFAULT_TX_CONFIG,
836
- fee=uint64(0),
837
- puzzle_decorator_override=[{"decorator": "CLAWBACK", "clawback_timelock": 5}],
838
873
  )
839
874
  ).transaction
840
875
  clawback_coin_id_1 = tx.additions[0].name()
@@ -843,12 +878,14 @@ async def test_spend_clawback_coins(wallet_rpc_environment: WalletRpcTestEnviron
843
878
  await full_node_api.wait_for_wallet_synced(wallet_node=wallet_2_node, timeout=20)
844
879
  tx = (
845
880
  await wallet_2_rpc.send_transaction(
846
- wallet_id=1,
847
- amount=uint64(500),
848
- address=encode_puzzle_hash(wallet_1_puzhash, "txch"),
881
+ SendTransaction(
882
+ wallet_id=uint32(1),
883
+ amount=uint64(500),
884
+ address=encode_puzzle_hash(wallet_1_puzhash, "txch"),
885
+ puzzle_decorator=[ClawbackPuzzleDecoratorOverride(decorator="CLAWBACK", clawback_timelock=uint64(5))],
886
+ push=True,
887
+ ),
849
888
  tx_config=DEFAULT_TX_CONFIG,
850
- fee=uint64(0),
851
- puzzle_decorator_override=[{"decorator": "CLAWBACK", "clawback_timelock": 5}],
852
889
  )
853
890
  ).transaction
854
891
  assert tx.spend_bundle is not None
@@ -857,32 +894,28 @@ async def test_spend_clawback_coins(wallet_rpc_environment: WalletRpcTestEnviron
857
894
  await time_out_assert(20, get_confirmed_balance, generated_funds - 500, wallet_1_rpc, 1)
858
895
  await time_out_assert(20, get_confirmed_balance, generated_funds - 500, wallet_2_rpc, 1)
859
896
  await asyncio.sleep(10)
860
- # Test missing coin_ids
861
- has_exception = False
862
- try:
863
- await wallet_2_api.spend_clawback_coins({})
864
- except ValueError:
865
- has_exception = True
866
- assert has_exception
867
897
  # Test coin ID is not a Clawback coin
868
898
  invalid_coin_id = tx.removals[0].name()
869
- resp = await wallet_2_rpc.spend_clawback_coins([invalid_coin_id], 500)
870
- assert resp["success"]
871
- assert resp["transaction_ids"] == []
899
+ resp = await wallet_2_rpc.spend_clawback_coins(
900
+ SpendClawbackCoins(coin_ids=[invalid_coin_id], fee=uint64(500), push=True), tx_config=DEFAULT_TX_CONFIG
901
+ )
902
+ assert resp.transaction_ids == []
872
903
  # Test unsupported wallet
873
904
  coin_record = await wallet_1_node.wallet_state_manager.coin_store.get_coin_record(clawback_coin_id_1)
874
905
  assert coin_record is not None
875
906
  await wallet_1_node.wallet_state_manager.coin_store.add_coin_record(
876
907
  dataclasses.replace(coin_record, wallet_type=WalletType.CAT)
877
908
  )
878
- resp = await wallet_1_rpc.spend_clawback_coins([clawback_coin_id_1], 100)
879
- assert resp["success"]
880
- assert len(resp["transaction_ids"]) == 0
909
+ resp = await wallet_1_rpc.spend_clawback_coins(
910
+ SpendClawbackCoins(coin_ids=[clawback_coin_id_1], fee=uint64(100), push=True), tx_config=DEFAULT_TX_CONFIG
911
+ )
912
+ assert len(resp.transaction_ids) == 0
881
913
  # Test missing metadata
882
914
  await wallet_1_node.wallet_state_manager.coin_store.add_coin_record(dataclasses.replace(coin_record, metadata=None))
883
- resp = await wallet_1_rpc.spend_clawback_coins([clawback_coin_id_1], 100)
884
- assert resp["success"]
885
- assert len(resp["transaction_ids"]) == 0
915
+ resp = await wallet_1_rpc.spend_clawback_coins(
916
+ SpendClawbackCoins(coin_ids=[clawback_coin_id_1], fee=uint64(100), push=True), tx_config=DEFAULT_TX_CONFIG
917
+ )
918
+ assert len(resp.transaction_ids) == 0
886
919
  # Test missing incoming tx
887
920
  coin_record = await wallet_1_node.wallet_state_manager.coin_store.get_coin_record(clawback_coin_id_2)
888
921
  assert coin_record is not None
@@ -890,8 +923,10 @@ async def test_spend_clawback_coins(wallet_rpc_environment: WalletRpcTestEnviron
890
923
  await wallet_1_node.wallet_state_manager.coin_store.add_coin_record(
891
924
  dataclasses.replace(coin_record, coin=fake_coin)
892
925
  )
893
- resp = await wallet_1_rpc.spend_clawback_coins([fake_coin.name()], 100)
894
- assert resp["transaction_ids"] == []
926
+ resp = await wallet_1_rpc.spend_clawback_coins(
927
+ SpendClawbackCoins(coin_ids=[fake_coin.name()], fee=uint64(100), push=True), tx_config=DEFAULT_TX_CONFIG
928
+ )
929
+ assert resp.transaction_ids == []
895
930
  # Test coin puzzle hash doesn't match the puzzle
896
931
  farmed_tx = (await wallet_1.wallet_state_manager.tx_store.get_farming_rewards())[0]
897
932
  await wallet_1.wallet_state_manager.tx_store.add_transaction_record(
@@ -900,8 +935,10 @@ async def test_spend_clawback_coins(wallet_rpc_environment: WalletRpcTestEnviron
900
935
  await wallet_1_node.wallet_state_manager.coin_store.add_coin_record(
901
936
  dataclasses.replace(coin_record, coin=fake_coin)
902
937
  )
903
- resp = await wallet_1_rpc.spend_clawback_coins([fake_coin.name()], 100)
904
- assert resp["transaction_ids"] == []
938
+ resp = await wallet_1_rpc.spend_clawback_coins(
939
+ SpendClawbackCoins(coin_ids=[fake_coin.name()], fee=uint64(100), push=True), tx_config=DEFAULT_TX_CONFIG
940
+ )
941
+ assert resp.transaction_ids == []
905
942
  # Test claim spend
906
943
  await wallet_2_rpc.set_auto_claim(
907
944
  AutoClaimSettings(
@@ -911,11 +948,12 @@ async def test_spend_clawback_coins(wallet_rpc_environment: WalletRpcTestEnviron
911
948
  batch_size=uint16(1),
912
949
  )
913
950
  )
914
- resp = await wallet_2_rpc.spend_clawback_coins([clawback_coin_id_1, clawback_coin_id_2], 100)
915
- assert resp["success"]
916
- assert len(resp["transaction_ids"]) == 2
917
- for _tx in resp["transactions"]:
918
- clawback_tx = TransactionRecord.from_json_dict_convenience(_tx)
951
+ resp = await wallet_2_rpc.spend_clawback_coins(
952
+ SpendClawbackCoins(coin_ids=[clawback_coin_id_1, clawback_coin_id_2], fee=uint64(100), push=True),
953
+ tx_config=DEFAULT_TX_CONFIG,
954
+ )
955
+ assert len(resp.transaction_ids) == 2
956
+ for clawback_tx in resp.transactions:
919
957
  if clawback_tx.spend_bundle is not None:
920
958
  await time_out_assert_not_none(
921
959
  10, full_node_api.full_node.mempool_manager.get_spendbundle, clawback_tx.spend_bundle.name()
@@ -923,9 +961,10 @@ async def test_spend_clawback_coins(wallet_rpc_environment: WalletRpcTestEnviron
923
961
  await farm_transaction_block(full_node_api, wallet_2_node)
924
962
  await time_out_assert(20, get_confirmed_balance, generated_funds + 300, wallet_2_rpc, 1)
925
963
  # Test spent coin
926
- resp = await wallet_2_rpc.spend_clawback_coins([clawback_coin_id_1], 500)
927
- assert resp["success"]
928
- assert resp["transaction_ids"] == []
964
+ resp = await wallet_2_rpc.spend_clawback_coins(
965
+ SpendClawbackCoins(coin_ids=[clawback_coin_id_1], fee=uint64(500), push=True), tx_config=DEFAULT_TX_CONFIG
966
+ )
967
+ assert resp.transaction_ids == []
929
968
 
930
969
 
931
970
  @pytest.mark.anyio
@@ -939,8 +978,10 @@ async def test_send_transaction_multi(wallet_rpc_environment: WalletRpcTestEnvir
939
978
 
940
979
  generated_funds = await generate_funds(full_node_api, env.wallet_1)
941
980
 
942
- removals = await client.select_coins(
943
- 1750000000000, wallet_id=1, coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG
981
+ select_coins_response = await client.select_coins(
982
+ SelectCoins.from_coin_selection_config(
983
+ amount=uint64(1750000000000), wallet_id=uint32(1), coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG
984
+ )
944
985
  ) # we want a coin that won't be selected by default
945
986
  outputs = await create_tx_outputs(wallet_2, [(uint64(1), ["memo_1"]), (uint64(2), ["memo_2"])])
946
987
  amount_outputs = sum(output["amount"] for output in outputs)
@@ -951,7 +992,7 @@ async def test_send_transaction_multi(wallet_rpc_environment: WalletRpcTestEnvir
951
992
  1,
952
993
  outputs,
953
994
  DEFAULT_TX_CONFIG,
954
- coins=removals,
995
+ coins=select_coins_response.coins,
955
996
  fee=amount_fee,
956
997
  )
957
998
  ).transaction
@@ -960,16 +1001,16 @@ async def test_send_transaction_multi(wallet_rpc_environment: WalletRpcTestEnvir
960
1001
  assert send_tx_res is not None
961
1002
 
962
1003
  assert_tx_amounts(send_tx_res, outputs, amount_fee=amount_fee, change_expected=True)
963
- assert send_tx_res.removals == removals
1004
+ assert send_tx_res.removals == select_coins_response.coins
964
1005
 
965
1006
  await farm_transaction(full_node_api, wallet_node, spend_bundle)
966
1007
 
967
1008
  await time_out_assert(20, get_confirmed_balance, generated_funds - amount_outputs - amount_fee, client, 1)
968
1009
 
969
1010
  # Checks that the memo can be retrieved
970
- tx_confirmed = await client.get_transaction(send_tx_res.name)
1011
+ tx_confirmed = (await client.get_transaction(GetTransaction(send_tx_res.name))).transaction
971
1012
  assert tx_confirmed.confirmed
972
- memos = tx_confirmed.get_memos()
1013
+ memos = tx_confirmed.memos
973
1014
  assert len(memos) == len(outputs)
974
1015
  for output in outputs:
975
1016
  assert [output["memos"][0].encode()] in memos.values()
@@ -990,18 +1031,20 @@ async def test_get_transactions(wallet_rpc_environment: WalletRpcTestEnvironment
990
1031
 
991
1032
  await generate_funds(full_node_api, env.wallet_1, 5)
992
1033
 
993
- all_transactions = await client.get_transactions(1)
1034
+ all_transactions = (await client.get_transactions(GetTransactions(uint32(1)))).transactions
994
1035
  assert len(all_transactions) >= 10
995
1036
  # Test transaction pagination
996
- some_transactions = await client.get_transactions(1, 0, 5)
997
- some_transactions_2 = await client.get_transactions(1, 5, 10)
1037
+ some_transactions = (await client.get_transactions(GetTransactions(uint32(1), uint16(0), uint16(5)))).transactions
1038
+ some_transactions_2 = (
1039
+ await client.get_transactions(GetTransactions(uint32(1), uint16(5), uint16(10)))
1040
+ ).transactions
998
1041
  assert some_transactions == all_transactions[0:5]
999
1042
  assert some_transactions_2 == all_transactions[5:10]
1000
1043
 
1001
1044
  # Testing sorts
1002
1045
  # Test the default sort (CONFIRMED_AT_HEIGHT)
1003
1046
  assert all_transactions == sorted(all_transactions, key=attrgetter("confirmed_at_height"))
1004
- all_transactions = await client.get_transactions(1, reverse=True)
1047
+ all_transactions = (await client.get_transactions(GetTransactions(uint32(1), reverse=True))).transactions
1005
1048
  assert all_transactions == sorted(all_transactions, key=attrgetter("confirmed_at_height"), reverse=True)
1006
1049
 
1007
1050
  # Test RELEVANCE
@@ -1009,16 +1052,24 @@ async def test_get_transactions(wallet_rpc_environment: WalletRpcTestEnvironment
1009
1052
  puzhash = await action_scope.get_puzzle_hash(wallet.wallet_state_manager)
1010
1053
  await full_node_api.wait_for_wallet_synced(wallet_node=wallet_node, timeout=20)
1011
1054
  await client.send_transaction(
1012
- 1, uint64(1), encode_puzzle_hash(puzhash, "txch"), DEFAULT_TX_CONFIG
1055
+ SendTransaction(wallet_id=uint32(1), amount=uint64(1), address=encode_puzzle_hash(puzhash, "txch"), push=True),
1056
+ DEFAULT_TX_CONFIG,
1013
1057
  ) # Create a pending tx
1014
1058
 
1015
- all_transactions = await client.get_transactions(1, sort_key=SortKey.RELEVANCE)
1059
+ with pytest.raises(ValueError, match="There is no known sort foo"):
1060
+ await client.get_transactions(GetTransactions(uint32(1), sort_key="foo"))
1061
+
1062
+ all_transactions = (
1063
+ await client.get_transactions(GetTransactions(uint32(1), sort_key=SortKey.RELEVANCE.name))
1064
+ ).transactions
1016
1065
  sorted_transactions = sorted(all_transactions, key=attrgetter("created_at_time"), reverse=True)
1017
1066
  sorted_transactions = sorted(sorted_transactions, key=attrgetter("confirmed_at_height"), reverse=True)
1018
1067
  sorted_transactions = sorted(sorted_transactions, key=attrgetter("confirmed"))
1019
1068
  assert all_transactions == sorted_transactions
1020
1069
 
1021
- all_transactions = await client.get_transactions(1, sort_key=SortKey.RELEVANCE, reverse=True)
1070
+ all_transactions = (
1071
+ await client.get_transactions(GetTransactions(uint32(1), sort_key=SortKey.RELEVANCE.name, reverse=True))
1072
+ ).transactions
1022
1073
  sorted_transactions = sorted(all_transactions, key=attrgetter("created_at_time"))
1023
1074
  sorted_transactions = sorted(sorted_transactions, key=attrgetter("confirmed_at_height"))
1024
1075
  sorted_transactions = sorted(sorted_transactions, key=attrgetter("confirmed"), reverse=True)
@@ -1028,23 +1079,32 @@ async def test_get_transactions(wallet_rpc_environment: WalletRpcTestEnvironment
1028
1079
  async with wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
1029
1080
  ph_by_addr = await action_scope.get_puzzle_hash(wallet.wallet_state_manager)
1030
1081
  await full_node_api.wait_for_wallet_synced(wallet_node=wallet_node, timeout=20)
1031
- await client.send_transaction(1, uint64(1), encode_puzzle_hash(ph_by_addr, "txch"), DEFAULT_TX_CONFIG)
1082
+ await client.send_transaction(
1083
+ SendTransaction(
1084
+ wallet_id=uint32(1), amount=uint64(1), address=encode_puzzle_hash(ph_by_addr, "txch"), push=True
1085
+ ),
1086
+ DEFAULT_TX_CONFIG,
1087
+ )
1032
1088
  await full_node_api.wait_for_wallet_synced(wallet_node=wallet_node, timeout=20)
1033
- tx_for_address = await client.get_transactions(1, to_address=encode_puzzle_hash(ph_by_addr, "txch"))
1089
+ tx_for_address = (
1090
+ await client.get_transactions(GetTransactions(uint32(1), to_address=encode_puzzle_hash(ph_by_addr, "txch")))
1091
+ ).transactions
1034
1092
  assert len(tx_for_address) == 1
1035
1093
  assert tx_for_address[0].to_puzzle_hash == ph_by_addr
1036
1094
 
1037
1095
  # Test type filter
1038
- all_transactions = await client.get_transactions(
1039
- 1, type_filter=TransactionTypeFilter.include([TransactionType.COINBASE_REWARD])
1040
- )
1096
+ all_transactions = (
1097
+ await client.get_transactions(
1098
+ GetTransactions(uint32(1), type_filter=TransactionTypeFilter.include([TransactionType.COINBASE_REWARD]))
1099
+ )
1100
+ ).transactions
1041
1101
  assert len(all_transactions) == 5
1042
1102
  assert all(transaction.type == TransactionType.COINBASE_REWARD.value for transaction in all_transactions)
1043
1103
  # Test confirmed filter
1044
- all_transactions = await client.get_transactions(1, confirmed=True)
1104
+ all_transactions = (await client.get_transactions(GetTransactions(uint32(1), confirmed=True))).transactions
1045
1105
  assert len(all_transactions) == 10
1046
1106
  assert all(transaction.confirmed for transaction in all_transactions)
1047
- all_transactions = await client.get_transactions(1, confirmed=False)
1107
+ all_transactions = (await client.get_transactions(GetTransactions(uint32(1), confirmed=False))).transactions
1048
1108
  assert len(all_transactions) == 2
1049
1109
  assert all(not transaction.confirmed for transaction in all_transactions)
1050
1110
 
@@ -1052,9 +1112,15 @@ async def test_get_transactions(wallet_rpc_environment: WalletRpcTestEnvironment
1052
1112
  await wallet.wallet_state_manager.tx_store.add_transaction_record(
1053
1113
  dataclasses.replace(all_transactions[0], type=uint32(TransactionType.INCOMING_CLAWBACK_SEND))
1054
1114
  )
1055
- all_transactions = await client.get_transactions(
1056
- 1, type_filter=TransactionTypeFilter.include([TransactionType.INCOMING_CLAWBACK_SEND]), confirmed=False
1057
- )
1115
+ all_transactions = (
1116
+ await client.get_transactions(
1117
+ GetTransactions(
1118
+ uint32(1),
1119
+ type_filter=TransactionTypeFilter.include([TransactionType.INCOMING_CLAWBACK_SEND]),
1120
+ confirmed=False,
1121
+ )
1122
+ )
1123
+ ).transactions
1058
1124
  assert len(all_transactions) == 1
1059
1125
 
1060
1126
 
@@ -1067,16 +1133,18 @@ async def test_get_transaction_count(wallet_rpc_environment: WalletRpcTestEnviro
1067
1133
 
1068
1134
  await generate_funds(full_node_api, env.wallet_1)
1069
1135
 
1070
- all_transactions = await client.get_transactions(1)
1136
+ all_transactions = (await client.get_transactions(GetTransactions(uint32(1)))).transactions
1071
1137
  assert len(all_transactions) > 0
1072
- transaction_count = await client.get_transaction_count(1)
1073
- assert transaction_count == len(all_transactions)
1074
- transaction_count = await client.get_transaction_count(1, confirmed=False)
1075
- assert transaction_count == 0
1076
- transaction_count = await client.get_transaction_count(
1077
- 1, type_filter=TransactionTypeFilter.include([TransactionType.INCOMING_CLAWBACK_SEND])
1138
+ transaction_count_response = await client.get_transaction_count(GetTransactionCount(uint32(1)))
1139
+ assert transaction_count_response.count == len(all_transactions)
1140
+ transaction_count_response = await client.get_transaction_count(GetTransactionCount(uint32(1), confirmed=False))
1141
+ assert transaction_count_response.count == 0
1142
+ transaction_count_response = await client.get_transaction_count(
1143
+ GetTransactionCount(
1144
+ uint32(1), type_filter=TransactionTypeFilter.include([TransactionType.INCOMING_CLAWBACK_SEND])
1145
+ )
1078
1146
  )
1079
- assert transaction_count == 0
1147
+ assert transaction_count_response.count == 0
1080
1148
 
1081
1149
 
1082
1150
  @pytest.mark.parametrize(
@@ -1134,33 +1202,31 @@ async def test_cat_endpoints(wallet_environments: WalletTestFramework, wallet_ty
1134
1202
  "cat1",
1135
1203
  )
1136
1204
 
1137
- cat_0_id = env_0.wallet_aliases["cat0"]
1205
+ cat_0_id = uint32(env_0.wallet_aliases["cat0"])
1138
1206
  # The RPC response contains more than just the balance info but all the
1139
1207
  # balance info should match. We're leveraging the `<=` operator to check
1140
1208
  # for subset on `dict` `.items()`.
1141
1209
  assert (
1142
1210
  env_0.wallet_states[uint32(env_0.wallet_aliases["cat0"])].balance.to_json_dict().items()
1143
- <= (await env_0.rpc_client.get_wallet_balance(cat_0_id)).items()
1144
- )
1145
- asset_id = await env_0.rpc_client.get_cat_asset_id(cat_0_id)
1146
- assert (await env_0.rpc_client.get_cat_name(cat_0_id)) == wallet_type.default_wallet_name_for_unknown_cat(
1147
- asset_id.hex()
1148
- )
1149
- await env_0.rpc_client.set_cat_name(cat_0_id, "My cat")
1150
- assert (await env_0.rpc_client.get_cat_name(cat_0_id)) == "My cat"
1151
- result = await env_0.rpc_client.cat_asset_id_to_name(asset_id)
1152
- assert result is not None
1153
- wid, name = result
1154
- assert wid == cat_0_id
1155
- assert name == "My cat"
1156
- result = await env_0.rpc_client.cat_asset_id_to_name(bytes32.zeros)
1157
- assert result is None
1211
+ <= (await env_0.rpc_client.get_wallet_balance(GetWalletBalance(cat_0_id))).wallet_balance.to_json_dict().items()
1212
+ )
1213
+ asset_id = (await env_0.rpc_client.get_cat_asset_id(CATGetAssetID(cat_0_id))).asset_id
1214
+ assert (
1215
+ await env_0.rpc_client.get_cat_name(CATGetName(cat_0_id))
1216
+ ).name == wallet_type.default_wallet_name_for_unknown_cat(asset_id.hex())
1217
+ await env_0.rpc_client.set_cat_name(CATSetName(cat_0_id, "My cat"))
1218
+ assert (await env_0.rpc_client.get_cat_name(CATGetName(cat_0_id))).name == "My cat"
1219
+ asset_to_name_response = await env_0.rpc_client.cat_asset_id_to_name(CATAssetIDToName(asset_id))
1220
+ assert asset_to_name_response.wallet_id == cat_0_id
1221
+ assert asset_to_name_response.name == "My cat"
1222
+ asset_to_name_response = await env_0.rpc_client.cat_asset_id_to_name(CATAssetIDToName(bytes32.zeros))
1223
+ assert asset_to_name_response.name is None
1158
1224
  verified_asset_id = next(iter(DEFAULT_CATS.items()))[1]["asset_id"]
1159
- result = await env_0.rpc_client.cat_asset_id_to_name(bytes32.from_hexstr(verified_asset_id))
1160
- assert result is not None
1161
- should_be_none, name = result
1162
- assert should_be_none is None
1163
- assert name == next(iter(DEFAULT_CATS.items()))[1]["name"]
1225
+ asset_to_name_response = await env_0.rpc_client.cat_asset_id_to_name(
1226
+ CATAssetIDToName(bytes32.from_hexstr(verified_asset_id))
1227
+ )
1228
+ assert asset_to_name_response.wallet_id is None
1229
+ assert asset_to_name_response.name == next(iter(DEFAULT_CATS.items()))[1]["name"]
1164
1230
 
1165
1231
  # Creates a second wallet with the same CAT
1166
1232
  res = await env_1.rpc_client.create_wallet_for_existing_cat(asset_id)
@@ -1183,26 +1249,77 @@ async def test_cat_endpoints(wallet_environments: WalletTestFramework, wallet_ty
1183
1249
  ]
1184
1250
  )
1185
1251
 
1186
- addr_0 = await env_0.rpc_client.get_next_address(cat_0_id, False)
1187
- addr_1 = await env_1.rpc_client.get_next_address(cat_1_id, False)
1252
+ addr_0 = (await env_0.rpc_client.get_next_address(GetNextAddress(cat_0_id, False))).address
1253
+ addr_1 = (await env_1.rpc_client.get_next_address(GetNextAddress(cat_1_id, False))).address
1188
1254
 
1189
1255
  assert addr_0 != addr_1
1190
1256
 
1191
1257
  # Test CAT spend without a fee
1192
1258
  with pytest.raises(ValueError):
1193
1259
  await env_0.rpc_client.cat_spend(
1194
- cat_0_id,
1195
- DEFAULT_TX_CONFIG.override(
1260
+ CATSpend(
1261
+ wallet_id=cat_0_id,
1262
+ amount=uint64(4),
1263
+ inner_address=addr_1,
1264
+ fee=uint64(0),
1265
+ memos=["the cat memo"],
1266
+ push=False,
1267
+ ),
1268
+ tx_config=wallet_environments.tx_config.override(
1196
1269
  excluded_coin_amounts=[uint64(100)],
1197
1270
  excluded_coin_ids=[bytes32.zeros],
1198
1271
  ),
1199
- uint64(4),
1200
- addr_1,
1201
- uint64(0),
1202
- ["the cat memo"],
1203
1272
  )
1273
+
1274
+ # Test some validation errors
1275
+ with pytest.raises(
1276
+ ValueError,
1277
+ match=re.escape('Must specify "additions" or "amount"+"inner_address"+"memos", but not both.'),
1278
+ ):
1279
+ await env_0.rpc_client.cat_spend(
1280
+ CATSpend(
1281
+ wallet_id=cat_0_id,
1282
+ amount=uint64(4),
1283
+ inner_address=addr_1,
1284
+ memos=["the cat memo"],
1285
+ additions=[],
1286
+ ),
1287
+ tx_config=wallet_environments.tx_config,
1288
+ )
1289
+
1290
+ with pytest.raises(ValueError, match=re.escape('Must specify "amount" and "inner_address" together.')):
1291
+ await env_0.rpc_client.cat_spend(
1292
+ CATSpend(
1293
+ wallet_id=cat_0_id,
1294
+ amount=uint64(4),
1295
+ inner_address=None,
1296
+ ),
1297
+ tx_config=wallet_environments.tx_config,
1298
+ )
1299
+
1300
+ with pytest.raises(
1301
+ ValueError,
1302
+ match=re.escape('Must specify \\"extra_delta\\", \\"tail_reveal\\" and \\"tail_solution\\" together.'),
1303
+ ):
1304
+ await env_0.rpc_client.cat_spend(
1305
+ CATSpend(
1306
+ wallet_id=cat_0_id,
1307
+ additions=[],
1308
+ extra_delta="1",
1309
+ ),
1310
+ tx_config=wallet_environments.tx_config,
1311
+ )
1312
+
1204
1313
  tx_res = await env_0.rpc_client.cat_spend(
1205
- cat_0_id, wallet_environments.tx_config, uint64(4), addr_1, uint64(0), ["the cat memo"]
1314
+ CATSpend(
1315
+ wallet_id=cat_0_id,
1316
+ amount=uint64(4),
1317
+ inner_address=addr_1,
1318
+ fee=uint64(0),
1319
+ memos=["the cat memo"],
1320
+ push=True,
1321
+ ),
1322
+ tx_config=wallet_environments.tx_config,
1206
1323
  )
1207
1324
 
1208
1325
  spend_bundle = tx_res.transaction.spend_bundle
@@ -1248,7 +1365,15 @@ async def test_cat_endpoints(wallet_environments: WalletTestFramework, wallet_ty
1248
1365
 
1249
1366
  # Test CAT spend with a fee
1250
1367
  tx_res = await env_0.rpc_client.cat_spend(
1251
- cat_0_id, wallet_environments.tx_config, uint64(1), addr_1, uint64(5_000_000), ["the cat memo"]
1368
+ CATSpend(
1369
+ wallet_id=cat_0_id,
1370
+ amount=uint64(1),
1371
+ inner_address=addr_1,
1372
+ fee=uint64(5_000_000),
1373
+ memos=["the cat memo"],
1374
+ push=True,
1375
+ ),
1376
+ wallet_environments.tx_config,
1252
1377
  )
1253
1378
 
1254
1379
  spend_bundle = tx_res.transaction.spend_bundle
@@ -1307,22 +1432,29 @@ async def test_cat_endpoints(wallet_environments: WalletTestFramework, wallet_ty
1307
1432
  await wallet_environments.process_pending_states(cat_spend_changes)
1308
1433
 
1309
1434
  # Test CAT spend with a fee and pre-specified removals / coins
1310
- removals = await env_0.rpc_client.select_coins(
1311
- amount=uint64(2), wallet_id=cat_0_id, coin_selection_config=wallet_environments.tx_config.coin_selection_config
1435
+ select_coins_response = await env_0.rpc_client.select_coins(
1436
+ SelectCoins.from_coin_selection_config(
1437
+ amount=uint64(2),
1438
+ wallet_id=cat_0_id,
1439
+ coin_selection_config=wallet_environments.tx_config.coin_selection_config,
1440
+ )
1312
1441
  )
1313
1442
  tx_res = await env_0.rpc_client.cat_spend(
1314
- cat_0_id,
1443
+ CATSpend(
1444
+ wallet_id=cat_0_id,
1445
+ amount=uint64(1),
1446
+ inner_address=addr_1,
1447
+ fee=uint64(5_000_000),
1448
+ memos=["the cat memo"],
1449
+ coins=select_coins_response.coins,
1450
+ push=True,
1451
+ ),
1315
1452
  wallet_environments.tx_config,
1316
- uint64(1),
1317
- addr_1,
1318
- uint64(5_000_000),
1319
- ["the cat memo"],
1320
- removals=removals,
1321
1453
  )
1322
1454
 
1323
1455
  spend_bundle = tx_res.transaction.spend_bundle
1324
1456
  assert spend_bundle is not None
1325
- assert removals[0] in {removal for tx in tx_res.transactions for removal in tx.removals}
1457
+ assert select_coins_response.coins[0] in {removal for tx in tx_res.transactions for removal in tx.removals}
1326
1458
 
1327
1459
  await wallet_environments.process_pending_states(cat_spend_changes)
1328
1460
 
@@ -1330,14 +1462,18 @@ async def test_cat_endpoints(wallet_environments: WalletTestFramework, wallet_ty
1330
1462
  await env_0.wallet_state_manager.interested_store.add_unacknowledged_token(
1331
1463
  asset_id, "Unknown", uint32(10000), bytes32(b"\00" * 32)
1332
1464
  )
1333
- cats = await env_0.rpc_client.get_stray_cats()
1334
- assert len(cats) == 1
1465
+ stray_cats_response = await env_0.rpc_client.get_stray_cats()
1466
+ assert len(stray_cats_response.stray_cats) == 1
1335
1467
 
1336
1468
  # Test CAT coin selection
1337
- selected_coins = await env_0.rpc_client.select_coins(
1338
- amount=1, wallet_id=cat_0_id, coin_selection_config=wallet_environments.tx_config.coin_selection_config
1469
+ select_coins_response = await env_0.rpc_client.select_coins(
1470
+ SelectCoins.from_coin_selection_config(
1471
+ amount=uint64(1),
1472
+ wallet_id=cat_0_id,
1473
+ coin_selection_config=wallet_environments.tx_config.coin_selection_config,
1474
+ )
1339
1475
  )
1340
- assert len(selected_coins) > 0
1476
+ assert len(select_coins_response.coins) > 0
1341
1477
 
1342
1478
  # Test get_cat_list
1343
1479
  cat_list = (await env_0.rpc_client.get_cat_list()).cat_list
@@ -1349,69 +1485,135 @@ async def test_cat_endpoints(wallet_environments: WalletTestFramework, wallet_ty
1349
1485
  assert default_cats_set == set(cat_list)
1350
1486
 
1351
1487
 
1488
+ @pytest.mark.parametrize(
1489
+ "wallet_environments",
1490
+ [
1491
+ {
1492
+ "num_environments": 2,
1493
+ "blocks_needed": [1, 1],
1494
+ }
1495
+ ],
1496
+ indirect=True,
1497
+ )
1498
+ @pytest.mark.limit_consensus_modes(reason="irrelevant")
1499
+ @pytest.mark.parametrize("wallet_type", [CATWallet, RCATWallet])
1352
1500
  @pytest.mark.anyio
1353
- async def test_offer_endpoints(wallet_rpc_environment: WalletRpcTestEnvironment) -> None:
1354
- env: WalletRpcTestEnvironment = wallet_rpc_environment
1355
-
1356
- wallet_node: WalletNode = env.wallet_1.node
1357
- wallet_1_rpc: WalletRpcClient = env.wallet_1.rpc_client
1358
- wallet_2_rpc: WalletRpcClient = env.wallet_2.rpc_client
1359
- full_node_api: FullNodeSimulator = env.full_node.api
1501
+ async def test_offer_endpoints(wallet_environments: WalletTestFramework, wallet_type: type[CATWallet]) -> None:
1502
+ env_1 = wallet_environments.environments[0]
1503
+ env_2 = wallet_environments.environments[1]
1360
1504
 
1361
- await generate_funds(full_node_api, env.wallet_1, 1)
1362
- await generate_funds(full_node_api, env.wallet_2, 1)
1505
+ env_1.wallet_aliases = {
1506
+ "xch": 1,
1507
+ "cat": 2,
1508
+ }
1509
+ env_2.wallet_aliases = {
1510
+ "xch": 1,
1511
+ "cat": 2,
1512
+ }
1363
1513
 
1364
1514
  # Creates a CAT wallet with 20 mojos
1365
- res = await wallet_1_rpc.create_new_cat_and_wallet(uint64(20), test=True)
1366
- assert res["success"]
1367
- cat_wallet_id = res["wallet_id"]
1368
- cat_asset_id = bytes32.fromhex(res["asset_id"])
1369
- await time_out_assert(5, check_mempool_spend_count, True, full_node_api, 1)
1370
- await farm_transaction_block(full_node_api, wallet_node)
1371
- await full_node_api.wait_for_wallet_synced(wallet_node=wallet_node, timeout=5)
1372
-
1373
- await time_out_assert(5, get_confirmed_balance, 20, wallet_1_rpc, cat_wallet_id)
1515
+ cat_wallet = await mint_cat(
1516
+ wallet_environments,
1517
+ env_1,
1518
+ "xch",
1519
+ "cat",
1520
+ uint64(20),
1521
+ wallet_type,
1522
+ "cat",
1523
+ )
1524
+ cat_wallet_id = cat_wallet.id()
1525
+ cat_asset_id = cat_wallet.cat_info.limitations_program_hash
1374
1526
 
1375
1527
  # Creates a wallet for the same CAT on wallet_2 and send 4 CAT from wallet_1 to it
1376
- await wallet_2_rpc.create_wallet_for_existing_cat(cat_asset_id)
1377
- wallet_2_address = await wallet_2_rpc.get_next_address(cat_wallet_id, False)
1528
+ await env_2.rpc_client.create_wallet_for_existing_cat(cat_asset_id)
1529
+ wallet_2_address = (await env_2.rpc_client.get_next_address(GetNextAddress(cat_wallet_id, False))).address
1378
1530
  adds = [{"puzzle_hash": decode_puzzle_hash(wallet_2_address), "amount": uint64(4), "memos": ["the cat memo"]}]
1379
1531
  tx_res = (
1380
- await wallet_1_rpc.send_transaction_multi(
1381
- cat_wallet_id, additions=adds, tx_config=DEFAULT_TX_CONFIG, fee=uint64(0)
1532
+ await env_1.rpc_client.send_transaction_multi(
1533
+ cat_wallet_id, additions=adds, tx_config=wallet_environments.tx_config, fee=uint64(0)
1382
1534
  )
1383
1535
  ).transaction
1384
1536
  spend_bundle = tx_res.spend_bundle
1385
1537
  assert spend_bundle is not None
1386
- await farm_transaction(full_node_api, wallet_node, spend_bundle)
1387
- await time_out_assert(5, get_confirmed_balance, 4, wallet_2_rpc, cat_wallet_id)
1388
- test_crs: list[CoinRecord] = await wallet_1_rpc.get_coin_records_by_names(
1389
- [a.name() for a in spend_bundle.additions() if a.amount != 4]
1538
+
1539
+ await wallet_environments.process_pending_states(
1540
+ [
1541
+ WalletStateTransition(
1542
+ pre_block_balance_updates={
1543
+ "cat": {
1544
+ "unconfirmed_wallet_balance": -4,
1545
+ "spendable_balance": -20,
1546
+ "max_send_amount": -20,
1547
+ "pending_change": 16,
1548
+ "pending_coin_removal_count": 1,
1549
+ }
1550
+ },
1551
+ post_block_balance_updates={
1552
+ "cat": {
1553
+ "confirmed_wallet_balance": -4,
1554
+ "spendable_balance": 16,
1555
+ "max_send_amount": 16,
1556
+ "pending_change": -16,
1557
+ "pending_coin_removal_count": -1,
1558
+ }
1559
+ },
1560
+ ),
1561
+ WalletStateTransition(
1562
+ pre_block_balance_updates={"cat": {"init": True}},
1563
+ post_block_balance_updates={
1564
+ "cat": {
1565
+ "confirmed_wallet_balance": 4,
1566
+ "unconfirmed_wallet_balance": 4,
1567
+ "spendable_balance": 4,
1568
+ "max_send_amount": 4,
1569
+ "unspent_coin_count": 1,
1570
+ }
1571
+ },
1572
+ ),
1573
+ ]
1390
1574
  )
1575
+
1576
+ test_crs: list[CoinRecord] = (
1577
+ await env_1.rpc_client.get_coin_records_by_names(
1578
+ GetCoinRecordsByNames([a.name() for a in spend_bundle.additions() if a.amount != 4])
1579
+ )
1580
+ ).coin_records
1391
1581
  for cr in test_crs:
1392
1582
  assert cr.coin in spend_bundle.additions()
1393
1583
  with pytest.raises(ValueError):
1394
- await wallet_1_rpc.get_coin_records_by_names([a.name() for a in spend_bundle.additions() if a.amount == 4])
1584
+ await env_1.rpc_client.get_coin_records_by_names(
1585
+ GetCoinRecordsByNames([a.name() for a in spend_bundle.additions() if a.amount == 4])
1586
+ )
1395
1587
  # Create an offer of 5 chia for one CAT
1396
- await wallet_1_rpc.create_offer_for_ids(
1397
- {uint32(1): -5, cat_asset_id.hex(): 1}, DEFAULT_TX_CONFIG, validate_only=True
1588
+ await env_1.rpc_client.create_offer_for_ids(
1589
+ {uint32(1): -5, cat_asset_id.hex(): 1}, wallet_environments.tx_config, validate_only=True
1398
1590
  )
1399
- all_offers = await wallet_1_rpc.get_all_offers()
1591
+ all_offers = await env_1.rpc_client.get_all_offers()
1400
1592
  assert len(all_offers) == 0
1401
1593
 
1402
- driver_dict: dict[str, Any] = {cat_asset_id.hex(): {"type": "CAT", "tail": "0x" + cat_asset_id.hex()}}
1594
+ driver_dict: dict[str, Any] = {
1595
+ cat_asset_id.hex(): {
1596
+ "type": "CAT",
1597
+ "tail": "0x" + cat_asset_id.hex(),
1598
+ **(
1599
+ {}
1600
+ if wallet_type is CATWallet
1601
+ else {"also": {"type": "revocation layer", "hidden_puzzle_hash": "0x" + bytes32.zeros.hex()}}
1602
+ ),
1603
+ }
1604
+ }
1403
1605
 
1404
- create_res = await wallet_1_rpc.create_offer_for_ids(
1606
+ create_res = await env_1.rpc_client.create_offer_for_ids(
1405
1607
  {uint32(1): -5, cat_asset_id.hex(): 1},
1406
- DEFAULT_TX_CONFIG,
1608
+ wallet_environments.tx_config,
1407
1609
  driver_dict=driver_dict,
1408
1610
  fee=uint64(1),
1409
1611
  )
1410
1612
  offer = create_res.offer
1411
1613
 
1412
- id, summary = await wallet_1_rpc.get_offer_summary(offer)
1614
+ id, summary = await env_1.rpc_client.get_offer_summary(offer)
1413
1615
  assert id == offer.name()
1414
- id, advanced_summary = await wallet_1_rpc.get_offer_summary(offer, advanced=True)
1616
+ id, advanced_summary = await env_1.rpc_client.get_offer_summary(offer, advanced=True)
1415
1617
  assert id == offer.name()
1416
1618
  assert summary == {
1417
1619
  "offered": {"xch": 5},
@@ -1429,120 +1631,263 @@ async def test_offer_endpoints(wallet_rpc_environment: WalletRpcTestEnvironment)
1429
1631
  }
1430
1632
  assert advanced_summary == summary
1431
1633
 
1432
- id, _valid = await wallet_1_rpc.check_offer_validity(offer)
1433
- assert id == offer.name()
1634
+ offer_validity_response = await env_1.rpc_client.check_offer_validity(CheckOfferValidity(offer.to_bech32()))
1635
+ assert offer_validity_response.id == offer.name()
1636
+ assert offer_validity_response.valid
1434
1637
 
1435
- all_offers = await wallet_1_rpc.get_all_offers(file_contents=True)
1638
+ all_offers = await env_1.rpc_client.get_all_offers(file_contents=True)
1436
1639
  assert len(all_offers) == 1
1437
1640
  assert TradeStatus(all_offers[0].status) == TradeStatus.PENDING_ACCEPT
1438
1641
  assert all_offers[0].offer == bytes(offer)
1439
1642
 
1440
- offer_count = await wallet_1_rpc.get_offers_count()
1643
+ offer_count = await env_1.rpc_client.get_offers_count()
1441
1644
  assert offer_count.total == 1
1442
1645
  assert offer_count.my_offers_count == 1
1443
1646
  assert offer_count.taken_offers_count == 0
1444
1647
 
1445
- trade_record = (await wallet_2_rpc.take_offer(offer, DEFAULT_TX_CONFIG, fee=uint64(1))).trade_record
1648
+ trade_record = (await env_2.rpc_client.take_offer(offer, wallet_environments.tx_config, fee=uint64(1))).trade_record
1446
1649
  assert TradeStatus(trade_record.status) == TradeStatus.PENDING_CONFIRM
1447
1650
 
1448
- await wallet_1_rpc.cancel_offer(offer.name(), DEFAULT_TX_CONFIG, secure=False)
1651
+ await env_1.rpc_client.cancel_offer(offer.name(), wallet_environments.tx_config, secure=False)
1449
1652
 
1450
- trade_record = await wallet_1_rpc.get_offer(offer.name(), file_contents=True)
1653
+ trade_record = await env_1.rpc_client.get_offer(offer.name(), file_contents=True)
1451
1654
  assert trade_record.offer == bytes(offer)
1452
1655
  assert TradeStatus(trade_record.status) == TradeStatus.CANCELLED
1453
1656
 
1454
- await wallet_1_rpc.cancel_offer(offer.name(), DEFAULT_TX_CONFIG, fee=uint64(1), secure=True)
1657
+ failed_cancel_res = await env_1.rpc_client.cancel_offer(
1658
+ offer.name(), wallet_environments.tx_config, fee=uint64(1), secure=True
1659
+ )
1455
1660
 
1456
- trade_record = await wallet_1_rpc.get_offer(offer.name())
1661
+ trade_record = await env_1.rpc_client.get_offer(offer.name())
1457
1662
  assert TradeStatus(trade_record.status) == TradeStatus.PENDING_CANCEL
1458
1663
 
1459
- create_res = await wallet_1_rpc.create_offer_for_ids(
1460
- {uint32(1): -5, cat_wallet_id: 1}, DEFAULT_TX_CONFIG, fee=uint64(1)
1664
+ create_res = await env_1.rpc_client.create_offer_for_ids(
1665
+ {uint32(1): -5, cat_wallet_id: 1}, wallet_environments.tx_config, fee=uint64(1)
1461
1666
  )
1462
- all_offers = await wallet_1_rpc.get_all_offers()
1667
+ all_offers = await env_1.rpc_client.get_all_offers()
1463
1668
  assert len(all_offers) == 2
1464
- offer_count = await wallet_1_rpc.get_offers_count()
1669
+ offer_count = await env_1.rpc_client.get_offers_count()
1465
1670
  assert offer_count.total == 2
1466
1671
  assert offer_count.my_offers_count == 2
1467
1672
  assert offer_count.taken_offers_count == 0
1468
1673
  new_trade_record = create_res.trade_record
1469
1674
 
1470
- await farm_transaction_block(full_node_api, wallet_node)
1675
+ await wallet_environments.process_pending_states(
1676
+ [
1677
+ WalletStateTransition(
1678
+ pre_block_balance_updates={
1679
+ "xch": {
1680
+ "unconfirmed_wallet_balance": -1, # The cancellation that won't complete
1681
+ "<=#spendable_balance": -5,
1682
+ "<=#max_send_amount": -5,
1683
+ "unspent_coin_count": 0,
1684
+ ">=#pending_change": 1, # any amount increase (again, cancellation)
1685
+ "pending_coin_removal_count": 2, # one for each open offer
1686
+ },
1687
+ "cat": {},
1688
+ },
1689
+ post_block_balance_updates={
1690
+ "xch": {
1691
+ "confirmed_wallet_balance": -5 - 1,
1692
+ "unconfirmed_wallet_balance": -5 - 1 + 1, # cancellation TX now failed
1693
+ ">=#spendable_balance": 1, # any amount increase
1694
+ ">=#max_send_amount": 1, # any amount increase
1695
+ "<=#pending_change": -1, # any amount decrease (cancellation TX now failed)
1696
+ "pending_coin_removal_count": -1,
1697
+ },
1698
+ "cat": {
1699
+ "confirmed_wallet_balance": 1,
1700
+ "unconfirmed_wallet_balance": 1,
1701
+ "spendable_balance": 1,
1702
+ "max_send_amount": 1,
1703
+ "unspent_coin_count": 1,
1704
+ },
1705
+ },
1706
+ ),
1707
+ WalletStateTransition(
1708
+ pre_block_balance_updates={
1709
+ "xch": {
1710
+ "unconfirmed_wallet_balance": 5 - 1,
1711
+ "<=#spendable_balance": -1, # any amount decrease
1712
+ "<=#max_send_amount": -1, # any amount decrease
1713
+ ">=#pending_change": 1, # any amount increase
1714
+ "pending_coin_removal_count": 1,
1715
+ },
1716
+ "cat": {
1717
+ "unconfirmed_wallet_balance": -1,
1718
+ "<=#spendable_balance": -1, # any amount decrease
1719
+ "<=#max_send_amount": -1, # any amount decrease
1720
+ ">=#pending_change": 1, # any amount increase
1721
+ "pending_coin_removal_count": 1,
1722
+ },
1723
+ },
1724
+ post_block_balance_updates={
1725
+ "xch": {
1726
+ "confirmed_wallet_balance": 5 - 1,
1727
+ ">=#spendable_balance": 1, # any amount increase
1728
+ ">=#max_send_amount": 1, # any amount increase
1729
+ "<=#pending_change": -1, # any amount decrease
1730
+ "pending_coin_removal_count": -1,
1731
+ "unspent_coin_count": 1,
1732
+ },
1733
+ "cat": {
1734
+ "confirmed_wallet_balance": -1,
1735
+ ">=#spendable_balance": 1, # any amount increase
1736
+ ">=#max_send_amount": 1, # any amount increase
1737
+ "<=#pending_change": -1, # any amount decrease
1738
+ "pending_coin_removal_count": -1,
1739
+ },
1740
+ },
1741
+ ),
1742
+ ],
1743
+ invalid_transactions=[tx.name for tx in failed_cancel_res.transactions],
1744
+ )
1471
1745
 
1472
1746
  async def is_trade_confirmed(client: WalletRpcClient, offer: Offer) -> bool:
1473
1747
  trade_record = await client.get_offer(offer.name())
1474
1748
  return TradeStatus(trade_record.status) == TradeStatus.CONFIRMED
1475
1749
 
1476
- await time_out_assert(15, is_trade_confirmed, True, wallet_1_rpc, offer)
1750
+ await time_out_assert(15, is_trade_confirmed, True, env_1.rpc_client, offer)
1477
1751
 
1478
1752
  # Test trade sorting
1479
1753
  def only_ids(trades: list[TradeRecord]) -> list[bytes32]:
1480
1754
  return [t.trade_id for t in trades]
1481
1755
 
1482
- trade_record = await wallet_1_rpc.get_offer(offer.name())
1483
- all_offers = await wallet_1_rpc.get_all_offers(include_completed=True) # confirmed at index descending
1756
+ trade_record = await env_1.rpc_client.get_offer(offer.name())
1757
+ all_offers = await env_1.rpc_client.get_all_offers(include_completed=True) # confirmed at index descending
1484
1758
  assert len(all_offers) == 2
1485
1759
  assert only_ids(all_offers) == only_ids([trade_record, new_trade_record])
1486
- all_offers = await wallet_1_rpc.get_all_offers(include_completed=True, reverse=True) # confirmed at index ascending
1760
+ all_offers = await env_1.rpc_client.get_all_offers(
1761
+ include_completed=True, reverse=True
1762
+ ) # confirmed at index ascending
1487
1763
  assert only_ids(all_offers) == only_ids([new_trade_record, trade_record])
1488
- all_offers = await wallet_1_rpc.get_all_offers(include_completed=True, sort_key="RELEVANCE") # most relevant
1764
+ all_offers = await env_1.rpc_client.get_all_offers(include_completed=True, sort_key="RELEVANCE") # most relevant
1489
1765
  assert only_ids(all_offers) == only_ids([new_trade_record, trade_record])
1490
- all_offers = await wallet_1_rpc.get_all_offers(
1766
+ all_offers = await env_1.rpc_client.get_all_offers(
1491
1767
  include_completed=True, sort_key="RELEVANCE", reverse=True
1492
1768
  ) # least relevant
1493
1769
  assert only_ids(all_offers) == only_ids([trade_record, new_trade_record])
1494
1770
  # Test pagination
1495
- all_offers = await wallet_1_rpc.get_all_offers(include_completed=True, start=0, end=1)
1771
+ all_offers = await env_1.rpc_client.get_all_offers(include_completed=True, start=0, end=1)
1496
1772
  assert len(all_offers) == 1
1497
- all_offers = await wallet_1_rpc.get_all_offers(include_completed=True, start=50)
1773
+ all_offers = await env_1.rpc_client.get_all_offers(include_completed=True, start=50)
1498
1774
  assert len(all_offers) == 0
1499
- all_offers = await wallet_1_rpc.get_all_offers(include_completed=True, start=0, end=50)
1775
+ all_offers = await env_1.rpc_client.get_all_offers(include_completed=True, start=0, end=50)
1500
1776
  assert len(all_offers) == 2
1501
1777
 
1502
- await wallet_1_rpc.create_offer_for_ids(
1778
+ await env_1.rpc_client.create_offer_for_ids(
1503
1779
  {uint32(1): -5, cat_asset_id.hex(): 1},
1504
- DEFAULT_TX_CONFIG,
1780
+ wallet_environments.tx_config,
1505
1781
  driver_dict=driver_dict,
1506
1782
  )
1507
- assert len([o for o in await wallet_1_rpc.get_all_offers() if o.status == TradeStatus.PENDING_ACCEPT.value]) == 2
1508
- await wallet_1_rpc.cancel_offers(DEFAULT_TX_CONFIG, batch_size=1)
1509
- assert len([o for o in await wallet_1_rpc.get_all_offers() if o.status == TradeStatus.PENDING_ACCEPT.value]) == 0
1510
- await time_out_assert(5, check_mempool_spend_count, True, full_node_api, 2)
1511
-
1512
- await farm_transaction_block(full_node_api, wallet_node)
1783
+ assert (
1784
+ len([o for o in await env_1.rpc_client.get_all_offers() if o.status == TradeStatus.PENDING_ACCEPT.value]) == 2
1785
+ )
1786
+ await env_1.rpc_client.cancel_offers(wallet_environments.tx_config, batch_size=1)
1787
+ assert (
1788
+ len([o for o in await env_1.rpc_client.get_all_offers() if o.status == TradeStatus.PENDING_ACCEPT.value]) == 0
1789
+ )
1790
+ await wallet_environments.process_pending_states(
1791
+ [
1792
+ WalletStateTransition(
1793
+ pre_block_balance_updates={
1794
+ "xch": {
1795
+ "<=#spendable_balance": -5,
1796
+ "<=#max_send_amount": -5,
1797
+ ">=#pending_change": 1, # any amount increase
1798
+ "pending_coin_removal_count": 1,
1799
+ },
1800
+ "cat": {},
1801
+ },
1802
+ post_block_balance_updates={
1803
+ "xch": {
1804
+ ">=#spendable_balance": 1, # any amount increase
1805
+ ">=#max_send_amount": 1, # any amount increase
1806
+ "<=#pending_change": -1, # any amount decrease
1807
+ "pending_coin_removal_count": -2,
1808
+ },
1809
+ "cat": {},
1810
+ },
1811
+ ),
1812
+ WalletStateTransition(),
1813
+ ]
1814
+ )
1513
1815
 
1514
- await wallet_1_rpc.create_offer_for_ids(
1816
+ await env_1.rpc_client.create_offer_for_ids(
1515
1817
  {uint32(1): -5, cat_asset_id.hex(): 1},
1516
- DEFAULT_TX_CONFIG,
1818
+ wallet_environments.tx_config,
1517
1819
  driver_dict=driver_dict,
1518
1820
  )
1519
- await wallet_1_rpc.create_offer_for_ids(
1821
+ await env_1.rpc_client.create_offer_for_ids(
1520
1822
  {uint32(1): 5, cat_asset_id.hex(): -1},
1521
- DEFAULT_TX_CONFIG,
1823
+ wallet_environments.tx_config,
1522
1824
  driver_dict=driver_dict,
1523
1825
  )
1524
- assert len([o for o in await wallet_1_rpc.get_all_offers() if o.status == TradeStatus.PENDING_ACCEPT.value]) == 2
1525
- await wallet_1_rpc.cancel_offers(DEFAULT_TX_CONFIG, cancel_all=True)
1526
- assert len([o for o in await wallet_1_rpc.get_all_offers() if o.status == TradeStatus.PENDING_ACCEPT.value]) == 0
1527
- await time_out_assert(5, check_mempool_spend_count, True, full_node_api, 1)
1528
- await farm_transaction_block(full_node_api, wallet_node)
1826
+ assert (
1827
+ len([o for o in await env_1.rpc_client.get_all_offers() if o.status == TradeStatus.PENDING_ACCEPT.value]) == 2
1828
+ )
1829
+ await env_1.rpc_client.cancel_offers(wallet_environments.tx_config, cancel_all=True)
1830
+ assert (
1831
+ len([o for o in await env_1.rpc_client.get_all_offers() if o.status == TradeStatus.PENDING_ACCEPT.value]) == 0
1832
+ )
1529
1833
 
1530
- await wallet_1_rpc.create_offer_for_ids(
1834
+ await wallet_environments.process_pending_states(
1835
+ [
1836
+ WalletStateTransition(
1837
+ pre_block_balance_updates={
1838
+ "xch": {
1839
+ "<=#spendable_balance": -5,
1840
+ "<=#max_send_amount": -5,
1841
+ ">=#pending_change": 1, # any amount increase
1842
+ "pending_coin_removal_count": 1,
1843
+ },
1844
+ "cat": {
1845
+ "<=#spendable_balance": -1,
1846
+ "<=#max_send_amount": -1,
1847
+ ">=#pending_change": 1, # any amount increase
1848
+ "pending_coin_removal_count": 1,
1849
+ },
1850
+ },
1851
+ post_block_balance_updates={
1852
+ "xch": {
1853
+ ">=#spendable_balance": 5,
1854
+ ">=#max_send_amount": 5,
1855
+ "<=#pending_change": -1, # any amount decrease
1856
+ "pending_coin_removal_count": -1,
1857
+ },
1858
+ "cat": {
1859
+ ">=#spendable_balance": 1,
1860
+ ">=#max_send_amount": 1,
1861
+ "<=#pending_change": -1, # any amount decrease
1862
+ "pending_coin_removal_count": -1,
1863
+ },
1864
+ },
1865
+ ),
1866
+ WalletStateTransition(),
1867
+ ]
1868
+ )
1869
+
1870
+ await env_1.rpc_client.create_offer_for_ids(
1531
1871
  {uint32(1): 5, cat_asset_id.hex(): -1},
1532
- DEFAULT_TX_CONFIG,
1872
+ wallet_environments.tx_config,
1533
1873
  driver_dict=driver_dict,
1534
1874
  )
1535
- assert len([o for o in await wallet_1_rpc.get_all_offers() if o.status == TradeStatus.PENDING_ACCEPT.value]) == 1
1536
- await wallet_1_rpc.cancel_offers(DEFAULT_TX_CONFIG, asset_id=bytes32.zeros)
1537
- assert len([o for o in await wallet_1_rpc.get_all_offers() if o.status == TradeStatus.PENDING_ACCEPT.value]) == 1
1538
- await wallet_1_rpc.cancel_offers(DEFAULT_TX_CONFIG, asset_id=cat_asset_id)
1539
- assert len([o for o in await wallet_1_rpc.get_all_offers() if o.status == TradeStatus.PENDING_ACCEPT.value]) == 0
1540
- await time_out_assert(5, check_mempool_spend_count, True, full_node_api, 1)
1875
+ assert (
1876
+ len([o for o in await env_1.rpc_client.get_all_offers() if o.status == TradeStatus.PENDING_ACCEPT.value]) == 1
1877
+ )
1878
+ await env_1.rpc_client.cancel_offers(wallet_environments.tx_config, asset_id=bytes32.zeros)
1879
+ assert (
1880
+ len([o for o in await env_1.rpc_client.get_all_offers() if o.status == TradeStatus.PENDING_ACCEPT.value]) == 1
1881
+ )
1882
+ await env_1.rpc_client.cancel_offers(wallet_environments.tx_config, asset_id=cat_asset_id)
1883
+ assert (
1884
+ len([o for o in await env_1.rpc_client.get_all_offers() if o.status == TradeStatus.PENDING_ACCEPT.value]) == 0
1885
+ )
1541
1886
 
1542
1887
  with pytest.raises(ValueError, match="not currently supported"):
1543
- await wallet_1_rpc.create_offer_for_ids(
1888
+ await env_1.rpc_client.create_offer_for_ids(
1544
1889
  {uint32(1): -5, cat_asset_id.hex(): 1},
1545
- DEFAULT_TX_CONFIG,
1890
+ wallet_environments.tx_config,
1546
1891
  driver_dict=driver_dict,
1547
1892
  timelock_info=ConditionValidTimes(min_secs_since_created=uint64(1)),
1548
1893
  )
@@ -1564,7 +1909,12 @@ async def test_get_coin_records_by_names(wallet_rpc_environment: WalletRpcTestEn
1564
1909
  await full_node_api.wait_for_wallet_synced(wallet_node=wallet_node, timeout=20)
1565
1910
 
1566
1911
  # Spend half of it back to the same wallet get some spent coins in the wallet
1567
- tx = (await client.send_transaction(1, uint64(generated_funds / 2), address, DEFAULT_TX_CONFIG)).transaction
1912
+ tx = (
1913
+ await client.send_transaction(
1914
+ SendTransaction(wallet_id=uint32(1), amount=uint64(generated_funds / 2), address=address, push=True),
1915
+ DEFAULT_TX_CONFIG,
1916
+ )
1917
+ ).transaction
1568
1918
  assert tx.spend_bundle is not None
1569
1919
  await time_out_assert(20, tx_in_mempool, True, client, tx.name)
1570
1920
  await farm_transaction(full_node_api, wallet_node, tx.spend_bundle)
@@ -1579,16 +1929,18 @@ async def test_get_coin_records_by_names(wallet_rpc_environment: WalletRpcTestEn
1579
1929
  assert len(coin_ids_unspent) > 0
1580
1930
  # Do some queries to trigger all parameters
1581
1931
  # 1. Empty coin_ids
1582
- assert await client.get_coin_records_by_names([]) == []
1932
+ assert (await client.get_coin_records_by_names(GetCoinRecordsByNames([]))).coin_records == []
1583
1933
  # 2. All coins
1584
- rpc_result = await client.get_coin_records_by_names(coin_ids + coin_ids_unspent)
1585
- assert {record.coin for record in rpc_result} == {*coins, *coins_unspent}
1934
+ rpc_result = await client.get_coin_records_by_names(GetCoinRecordsByNames(coin_ids + coin_ids_unspent))
1935
+ assert {record.coin for record in rpc_result.coin_records} == {*coins, *coins_unspent}
1586
1936
  # 3. All spent coins
1587
- rpc_result = await client.get_coin_records_by_names(coin_ids, include_spent_coins=True)
1588
- assert {record.coin for record in rpc_result} == coins
1937
+ rpc_result = await client.get_coin_records_by_names(GetCoinRecordsByNames(coin_ids, include_spent_coins=True))
1938
+ assert {record.coin for record in rpc_result.coin_records} == coins
1589
1939
  # 4. All unspent coins
1590
- rpc_result = await client.get_coin_records_by_names(coin_ids_unspent, include_spent_coins=False)
1591
- assert {record.coin for record in rpc_result} == coins_unspent
1940
+ rpc_result = await client.get_coin_records_by_names(
1941
+ GetCoinRecordsByNames(coin_ids_unspent, include_spent_coins=False)
1942
+ )
1943
+ assert {record.coin for record in rpc_result.coin_records} == coins_unspent
1592
1944
  # 5. Filter start/end height
1593
1945
  filter_records = result.records[:10]
1594
1946
  assert len(filter_records) == 10
@@ -1597,11 +1949,13 @@ async def test_get_coin_records_by_names(wallet_rpc_environment: WalletRpcTestEn
1597
1949
  min_height = min(record.confirmed_block_height for record in filter_records)
1598
1950
  max_height = max(record.confirmed_block_height for record in filter_records)
1599
1951
  assert min_height != max_height
1600
- rpc_result = await client.get_coin_records_by_names(filter_coin_ids, start_height=min_height, end_height=max_height)
1601
- assert {record.coin for record in rpc_result} == filter_coins
1952
+ rpc_result = await client.get_coin_records_by_names(
1953
+ GetCoinRecordsByNames(filter_coin_ids, start_height=min_height, end_height=max_height)
1954
+ )
1955
+ assert {record.coin for record in rpc_result.coin_records} == filter_coins
1602
1956
  # 8. Test the failure case
1603
1957
  with pytest.raises(ValueError, match="not found"):
1604
- await client.get_coin_records_by_names(coin_ids, include_spent_coins=False)
1958
+ await client.get_coin_records_by_names(GetCoinRecordsByNames(coin_ids, include_spent_coins=False))
1605
1959
 
1606
1960
 
1607
1961
  @pytest.mark.anyio
@@ -1646,20 +2000,6 @@ async def test_did_endpoints(wallet_rpc_environment: WalletRpcTestEnvironment) -
1646
2000
  # Create backup file
1647
2001
  await wallet_1_rpc.create_did_backup_file(DIDCreateBackupFile(did_wallet_id_0))
1648
2002
 
1649
- await time_out_assert(5, check_mempool_spend_count, True, full_node_api, 1)
1650
- await farm_transaction_block(full_node_api, wallet_1_node)
1651
- # Update recovery list
1652
- update_res = await wallet_1_rpc.update_did_recovery_list(
1653
- DIDUpdateRecoveryIDs(
1654
- wallet_id=uint32(did_wallet_id_0), new_list=[did_id_0], num_verifications_required=uint64(1), push=True
1655
- ),
1656
- DEFAULT_TX_CONFIG,
1657
- )
1658
- assert len(update_res.transactions) > 0
1659
- recovery_list_res = await wallet_1_rpc.get_did_recovery_list(DIDGetRecoveryList(did_wallet_id_0))
1660
- assert recovery_list_res.num_required == 1
1661
- assert recovery_list_res.recovery_list[0] == did_id_0
1662
-
1663
2003
  await time_out_assert(5, check_mempool_spend_count, True, full_node_api, 1)
1664
2004
  await farm_transaction_block(full_node_api, wallet_1_node)
1665
2005
 
@@ -1929,7 +2269,7 @@ async def test_key_and_address_endpoints(wallet_rpc_environment: WalletRpcTestEn
1929
2269
  wallet_node: WalletNode = env.wallet_1.node
1930
2270
  client: WalletRpcClient = env.wallet_1.rpc_client
1931
2271
 
1932
- address = await client.get_next_address(1, True)
2272
+ address = (await client.get_next_address(GetNextAddress(uint32(1), True))).address
1933
2273
  assert len(address) > 10
1934
2274
 
1935
2275
  pks = (await client.get_public_keys()).pk_fingerprints
@@ -1944,11 +2284,15 @@ async def test_key_and_address_endpoints(wallet_rpc_environment: WalletRpcTestEn
1944
2284
  addr = encode_puzzle_hash(ph, "txch")
1945
2285
  tx_amount = uint64(15600000)
1946
2286
  await env.full_node.api.wait_for_wallet_synced(wallet_node=wallet_node, timeout=20)
1947
- created_tx = (await client.send_transaction(1, tx_amount, addr, DEFAULT_TX_CONFIG)).transaction
2287
+ created_tx = (
2288
+ await client.send_transaction(
2289
+ SendTransaction(wallet_id=uint32(1), amount=tx_amount, address=addr, push=True), DEFAULT_TX_CONFIG
2290
+ )
2291
+ ).transaction
1948
2292
 
1949
2293
  await time_out_assert(20, tx_in_mempool, True, client, created_tx.name)
1950
2294
  assert len(await wallet.wallet_state_manager.tx_store.get_unconfirmed_for_wallet(1)) == 1
1951
- await client.delete_unconfirmed_transactions(1)
2295
+ await client.delete_unconfirmed_transactions(DeleteUnconfirmedTransactions(uint32(1)))
1952
2296
  assert len(await wallet.wallet_state_manager.tx_store.get_unconfirmed_for_wallet(1)) == 0
1953
2297
 
1954
2298
  sk_resp = await client.get_private_key(GetPrivateKey(pks[0]))
@@ -2002,12 +2346,15 @@ async def test_key_and_address_endpoints(wallet_rpc_environment: WalletRpcTestEn
2002
2346
 
2003
2347
  assert not (await client.get_sync_status()).synced
2004
2348
 
2005
- wallets = await client.get_wallets()
2349
+ wallets = (await client.get_wallets(GetWallets())).wallets
2006
2350
  assert len(wallets) == 1
2007
- assert await get_unconfirmed_balance(client, int(wallets[0]["id"])) == 0
2351
+ assert await get_unconfirmed_balance(client, int(wallets[0].id)) == 0
2008
2352
 
2009
2353
  with pytest.raises(ValueError):
2010
- await client.send_transaction(wallets[0]["id"], uint64(100), addr, DEFAULT_TX_CONFIG)
2354
+ await client.send_transaction(
2355
+ SendTransaction(wallet_id=uint32(wallets[0].id), amount=uint64(100), address=addr, push=True),
2356
+ DEFAULT_TX_CONFIG,
2357
+ )
2011
2358
 
2012
2359
  # Delete all keys
2013
2360
  await client.delete_all_keys()
@@ -2033,7 +2380,11 @@ async def test_select_coins_rpc(wallet_rpc_environment: WalletRpcTestEnvironment
2033
2380
  for tx_amount in tx_amounts:
2034
2381
  funds -= tx_amount
2035
2382
  # create coins for tests
2036
- tx = (await client.send_transaction(1, tx_amount, addr, DEFAULT_TX_CONFIG)).transaction
2383
+ tx = (
2384
+ await client.send_transaction(
2385
+ SendTransaction(wallet_id=uint32(1), amount=tx_amount, address=addr, push=True), DEFAULT_TX_CONFIG
2386
+ )
2387
+ ).transaction
2037
2388
  spend_bundle = tx.spend_bundle
2038
2389
  assert spend_bundle is not None
2039
2390
  for coin in spend_bundle.additions():
@@ -2045,51 +2396,63 @@ async def test_select_coins_rpc(wallet_rpc_environment: WalletRpcTestEnvironment
2045
2396
  await time_out_assert(20, get_confirmed_balance, funds, client, 1)
2046
2397
 
2047
2398
  # test min coin amount
2048
- min_coins: list[Coin] = await client_2.select_coins(
2049
- amount=1000,
2050
- wallet_id=1,
2051
- coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(min_coin_amount=uint64(1001)),
2399
+ min_coins_response = await client_2.select_coins(
2400
+ SelectCoins.from_coin_selection_config(
2401
+ amount=uint64(1000),
2402
+ wallet_id=uint32(1),
2403
+ coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(min_coin_amount=uint64(1001)),
2404
+ )
2052
2405
  )
2053
- assert len(min_coins) == 1
2054
- assert min_coins[0].amount == uint64(10_000)
2406
+ assert len(min_coins_response.coins) == 1
2407
+ assert min_coins_response.coins[0].amount == uint64(10_000)
2055
2408
 
2056
2409
  # test max coin amount
2057
- max_coins: list[Coin] = await client_2.select_coins(
2058
- amount=2000,
2059
- wallet_id=1,
2060
- coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(
2061
- min_coin_amount=uint64(999), max_coin_amount=uint64(9999)
2062
- ),
2410
+ max_coins_reponse = await client_2.select_coins(
2411
+ SelectCoins.from_coin_selection_config(
2412
+ amount=uint64(2000),
2413
+ wallet_id=uint32(1),
2414
+ coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(
2415
+ min_coin_amount=uint64(999), max_coin_amount=uint64(9999)
2416
+ ),
2417
+ )
2063
2418
  )
2064
- assert len(max_coins) == 2
2065
- assert max_coins[0].amount == uint64(1000)
2419
+ assert len(max_coins_reponse.coins) == 2
2420
+ assert max_coins_reponse.coins[0].amount == uint64(1000)
2066
2421
 
2067
2422
  # test excluded coin amounts
2068
2423
  non_1000_amt: int = sum(a for a in tx_amounts if a != 1000)
2069
- excluded_amt_coins: list[Coin] = await client_2.select_coins(
2070
- amount=non_1000_amt,
2071
- wallet_id=1,
2072
- coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(excluded_coin_amounts=[uint64(1000)]),
2424
+ excluded_amt_coins_response = await client_2.select_coins(
2425
+ SelectCoins.from_coin_selection_config(
2426
+ amount=uint64(non_1000_amt),
2427
+ wallet_id=uint32(1),
2428
+ coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(excluded_coin_amounts=[uint64(1000)]),
2429
+ )
2073
2430
  )
2074
- assert len(excluded_amt_coins) == len([a for a in tx_amounts if a != 1000])
2075
- assert sum(c.amount for c in excluded_amt_coins) == non_1000_amt
2431
+ assert len(excluded_amt_coins_response.coins) == len([a for a in tx_amounts if a != 1000])
2432
+ assert sum(c.amount for c in excluded_amt_coins_response.coins) == non_1000_amt
2076
2433
 
2077
2434
  # test excluded coins
2078
2435
  with pytest.raises(ValueError):
2079
2436
  await client_2.select_coins(
2080
- amount=5000,
2081
- wallet_id=1,
2437
+ SelectCoins.from_coin_selection_config(
2438
+ amount=uint64(5000),
2439
+ wallet_id=uint32(1),
2440
+ coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(
2441
+ excluded_coin_ids=[c.name() for c in min_coins_response.coins]
2442
+ ),
2443
+ )
2444
+ )
2445
+ excluded_test_response = await client_2.select_coins(
2446
+ SelectCoins.from_coin_selection_config(
2447
+ amount=uint64(1300),
2448
+ wallet_id=uint32(1),
2082
2449
  coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(
2083
- excluded_coin_ids=[c.name() for c in min_coins]
2450
+ excluded_coin_ids=[c.name() for c in coin_300]
2084
2451
  ),
2085
2452
  )
2086
- excluded_test = await client_2.select_coins(
2087
- amount=1300,
2088
- wallet_id=1,
2089
- coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(excluded_coin_ids=[c.name() for c in coin_300]),
2090
2453
  )
2091
- assert len(excluded_test) == 2
2092
- for coin in excluded_test:
2454
+ assert len(excluded_test_response.coins) == 2
2455
+ for coin in excluded_test_response.coins:
2093
2456
  assert coin != coin_300[0]
2094
2457
 
2095
2458
  # test backwards compatibility in the RPC
@@ -2108,27 +2471,40 @@ async def test_select_coins_rpc(wallet_rpc_environment: WalletRpcTestEnvironment
2108
2471
  assert coin != coin_300[0]
2109
2472
 
2110
2473
  # test get coins
2111
- all_coins, _, _ = await client_2.get_spendable_coins(
2112
- wallet_id=1,
2113
- coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(
2114
- excluded_coin_ids=[c.name() for c in excluded_amt_coins]
2474
+ spendable_coins_response = await client_2.get_spendable_coins(
2475
+ GetSpendableCoins.from_coin_selection_config(
2476
+ wallet_id=uint32(1),
2477
+ coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(
2478
+ excluded_coin_ids=[c.name() for c in excluded_amt_coins_response.coins]
2479
+ ),
2115
2480
  ),
2116
2481
  )
2117
- assert set(excluded_amt_coins).intersection({rec.coin for rec in all_coins}) == set()
2118
- all_coins, _, _ = await client_2.get_spendable_coins(
2119
- wallet_id=1,
2120
- coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(excluded_coin_amounts=[uint64(1000)]),
2482
+ assert (
2483
+ set(excluded_amt_coins_response.coins).intersection(
2484
+ {rec.coin for rec in spendable_coins_response.confirmed_records}
2485
+ )
2486
+ == set()
2487
+ )
2488
+ spendable_coins_response = await client_2.get_spendable_coins(
2489
+ GetSpendableCoins.from_coin_selection_config(
2490
+ wallet_id=uint32(1),
2491
+ coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(excluded_coin_amounts=[uint64(1000)]),
2492
+ )
2121
2493
  )
2122
- assert len([rec for rec in all_coins if rec.coin.amount == 1000]) == 0
2123
- all_coins_2, _, _ = await client_2.get_spendable_coins(
2124
- wallet_id=1,
2125
- coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(max_coin_amount=uint64(999)),
2494
+ assert len([rec for rec in spendable_coins_response.confirmed_records if rec.coin.amount == 1000]) == 0
2495
+ spendable_coins_response = await client_2.get_spendable_coins(
2496
+ GetSpendableCoins.from_coin_selection_config(
2497
+ wallet_id=uint32(1),
2498
+ coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(max_coin_amount=uint64(999)),
2499
+ )
2126
2500
  )
2127
- assert all_coins_2[0].coin == coin_300[0]
2501
+ assert spendable_coins_response.confirmed_records[0].coin == coin_300[0]
2128
2502
  with pytest.raises(ValueError): # validate fail on invalid coin id.
2129
2503
  await client_2.get_spendable_coins(
2130
- wallet_id=1,
2131
- coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(excluded_coin_ids=[b"a"]),
2504
+ GetSpendableCoins.from_coin_selection_config(
2505
+ wallet_id=uint32(1),
2506
+ coin_selection_config=DEFAULT_COIN_SELECTION_CONFIG.override(excluded_coin_ids=[b"a"]),
2507
+ )
2132
2508
  )
2133
2509
 
2134
2510
 
@@ -2314,21 +2690,25 @@ async def test_notification_rpcs(wallet_rpc_environment: WalletRpcTestEnvironmen
2314
2690
  env.wallet_2.node.config["enable_notifications"] = True
2315
2691
  env.wallet_2.node.config["required_notification_amount"] = 100000000000
2316
2692
  async with wallet_2.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
2317
- tx = await client.send_notification(
2318
- await action_scope.get_puzzle_hash(wallet_2.wallet_state_manager),
2319
- b"hello",
2320
- uint64(100000000000),
2321
- fee=uint64(100000000000),
2693
+ response = await client.send_notification(
2694
+ SendNotification(
2695
+ target=(await action_scope.get_puzzle_hash(wallet_2.wallet_state_manager)),
2696
+ message=b"hello",
2697
+ amount=uint64(100000000000),
2698
+ fee=uint64(100000000000),
2699
+ push=True,
2700
+ ),
2701
+ tx_config=DEFAULT_TX_CONFIG,
2322
2702
  )
2323
2703
 
2324
- assert tx.spend_bundle is not None
2704
+ assert response.tx.spend_bundle is not None
2325
2705
  await time_out_assert(
2326
2706
  5,
2327
2707
  full_node_api.full_node.mempool_manager.get_spendbundle,
2328
- tx.spend_bundle,
2329
- tx.spend_bundle.name(),
2708
+ response.tx.spend_bundle,
2709
+ response.tx.spend_bundle.name(),
2330
2710
  )
2331
- await farm_transaction(full_node_api, wallet_node, tx.spend_bundle)
2711
+ await farm_transaction(full_node_api, wallet_node, response.tx.spend_bundle)
2332
2712
  await time_out_assert(20, env.wallet_2.wallet.get_confirmed_balance, uint64(100000000000))
2333
2713
 
2334
2714
  notification = (await client_2.get_notifications(GetNotifications())).notifications[0]
@@ -2337,29 +2717,33 @@ async def test_notification_rpcs(wallet_rpc_environment: WalletRpcTestEnvironmen
2337
2717
  assert [notification] == (await client_2.get_notifications(GetNotifications(None, None, uint32(1)))).notifications
2338
2718
  assert [] == (await client_2.get_notifications(GetNotifications(None, uint32(1), None))).notifications
2339
2719
  assert [notification] == (await client_2.get_notifications(GetNotifications(None, None, None))).notifications
2340
- assert await client_2.delete_notifications()
2720
+ await client_2.delete_notifications(DeleteNotifications())
2341
2721
  assert [] == (await client_2.get_notifications(GetNotifications([notification.id]))).notifications
2342
2722
 
2343
2723
  async with wallet_2.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
2344
- tx = await client.send_notification(
2345
- await action_scope.get_puzzle_hash(wallet_2.wallet_state_manager),
2346
- b"hello",
2347
- uint64(100000000000),
2348
- fee=uint64(100000000000),
2724
+ response = await client.send_notification(
2725
+ SendNotification(
2726
+ target=(await action_scope.get_puzzle_hash(wallet_2.wallet_state_manager)),
2727
+ message=b"hello",
2728
+ amount=uint64(100000000000),
2729
+ fee=uint64(100000000000),
2730
+ push=True,
2731
+ ),
2732
+ tx_config=DEFAULT_TX_CONFIG,
2349
2733
  )
2350
2734
 
2351
- assert tx.spend_bundle is not None
2735
+ assert response.tx.spend_bundle is not None
2352
2736
  await time_out_assert(
2353
2737
  5,
2354
2738
  full_node_api.full_node.mempool_manager.get_spendbundle,
2355
- tx.spend_bundle,
2356
- tx.spend_bundle.name(),
2739
+ response.tx.spend_bundle,
2740
+ response.tx.spend_bundle.name(),
2357
2741
  )
2358
- await farm_transaction(full_node_api, wallet_node, tx.spend_bundle)
2742
+ await farm_transaction(full_node_api, wallet_node, response.tx.spend_bundle)
2359
2743
  await time_out_assert(20, env.wallet_2.wallet.get_confirmed_balance, uint64(200000000000))
2360
2744
 
2361
2745
  notification = (await client_2.get_notifications(GetNotifications())).notifications[0]
2362
- assert await client_2.delete_notifications([notification.id])
2746
+ await client_2.delete_notifications(DeleteNotifications([notification.id]))
2363
2747
  assert [] == (await client_2.get_notifications(GetNotifications([notification.id]))).notifications
2364
2748
 
2365
2749
 
@@ -2573,7 +2957,7 @@ async def test_set_wallet_resync_on_startup(wallet_rpc_environment: WalletRpcTes
2573
2957
 
2574
2958
  nft_wallet = await wc.create_new_nft_wallet(None)
2575
2959
  nft_wallet_id = nft_wallet["wallet_id"]
2576
- address = await wc.get_next_address(env.wallet_1.wallet.id(), True)
2960
+ address = (await wc.get_next_address(GetNextAddress(env.wallet_1.wallet.id(), True))).address
2577
2961
  await wc.mint_nft(
2578
2962
  request=NFTMintNFTRequest(
2579
2963
  wallet_id=nft_wallet_id,
@@ -2594,12 +2978,14 @@ async def test_set_wallet_resync_on_startup(wallet_rpc_environment: WalletRpcTes
2594
2978
  # Test Clawback resync
2595
2979
  tx = (
2596
2980
  await wc.send_transaction(
2597
- wallet_id=1,
2598
- amount=uint64(500),
2599
- address=address,
2981
+ SendTransaction(
2982
+ wallet_id=uint32(1),
2983
+ amount=uint64(500),
2984
+ address=address,
2985
+ puzzle_decorator=[ClawbackPuzzleDecoratorOverride(decorator="CLAWBACK", clawback_timelock=uint64(5))],
2986
+ push=True,
2987
+ ),
2600
2988
  tx_config=DEFAULT_TX_CONFIG,
2601
- fee=uint64(0),
2602
- puzzle_decorator_override=[{"decorator": "CLAWBACK", "clawback_timelock": 5}],
2603
2989
  )
2604
2990
  ).transaction
2605
2991
  clawback_coin_id = tx.additions[0].name()
@@ -2607,12 +2993,11 @@ async def test_set_wallet_resync_on_startup(wallet_rpc_environment: WalletRpcTes
2607
2993
  await farm_transaction(full_node_api, wallet_node, tx.spend_bundle)
2608
2994
  await time_out_assert(20, check_client_synced, True, wc)
2609
2995
  await asyncio.sleep(10)
2610
- resp = await wc.spend_clawback_coins([clawback_coin_id], 0)
2611
- assert resp["success"]
2612
- assert len(resp["transaction_ids"]) == 1
2613
- await time_out_assert_not_none(
2614
- 10, full_node_api.full_node.mempool_manager.get_spendbundle, bytes32.from_hexstr(resp["transaction_ids"][0])
2996
+ resp = await wc.spend_clawback_coins(
2997
+ SpendClawbackCoins(coin_ids=[clawback_coin_id], fee=uint64(0), push=True), tx_config=DEFAULT_TX_CONFIG
2615
2998
  )
2999
+ assert len(resp.transaction_ids) == 1
3000
+ await time_out_assert_not_none(10, full_node_api.full_node.mempool_manager.get_spendbundle, resp.transaction_ids[0])
2616
3001
  await farm_transaction_block(full_node_api, wallet_node)
2617
3002
  await time_out_assert(20, check_client_synced, True, wc)
2618
3003
  wallet_node_2._close()
@@ -2742,7 +3127,11 @@ async def test_cat_spend_run_tail(wallet_rpc_environment: WalletRpcTestEnvironme
2742
3127
  )
2743
3128
  tx_amount = uint64(100)
2744
3129
 
2745
- tx = (await client.send_transaction(1, tx_amount, addr, DEFAULT_TX_CONFIG)).transaction
3130
+ tx = (
3131
+ await client.send_transaction(
3132
+ SendTransaction(wallet_id=uint32(1), amount=tx_amount, address=addr, push=True), DEFAULT_TX_CONFIG
3133
+ )
3134
+ ).transaction
2746
3135
  transaction_id = tx.name
2747
3136
  spend_bundle = tx.spend_bundle
2748
3137
  assert spend_bundle is not None
@@ -2784,11 +3173,16 @@ async def test_cat_spend_run_tail(wallet_rpc_environment: WalletRpcTestEnvironme
2784
3173
  # Attempt to melt it fully
2785
3174
  tx = (
2786
3175
  await client.cat_spend(
2787
- cat_wallet_id,
2788
- amount=uint64(0),
3176
+ CATSpend(
3177
+ wallet_id=cat_wallet_id,
3178
+ amount=uint64(0),
3179
+ inner_address=encode_puzzle_hash(our_ph, "txch"),
3180
+ extra_delta=str(tx_amount * -1),
3181
+ tail_reveal=b"\x80",
3182
+ tail_solution=b"\x80",
3183
+ push=True,
3184
+ ),
2789
3185
  tx_config=DEFAULT_TX_CONFIG,
2790
- inner_address=encode_puzzle_hash(our_ph, "txch"),
2791
- cat_discrepancy=(tx_amount * -1, Program.to(None), Program.to(None)),
2792
3186
  )
2793
3187
  ).transaction
2794
3188
  transaction_id = tx.name
@@ -2822,15 +3216,15 @@ async def test_get_balances(wallet_rpc_environment: WalletRpcTestEnvironment) ->
2822
3216
  await time_out_assert(5, check_mempool_spend_count, True, full_node_api, 2)
2823
3217
  await farm_transaction_block(full_node_api, wallet_node)
2824
3218
  await time_out_assert(20, check_client_synced, True, client)
2825
- bal = await client.get_wallet_balances()
2826
- assert len(bal) == 3
2827
- assert bal["1"]["confirmed_wallet_balance"] == 1999999999880
2828
- assert bal["2"]["confirmed_wallet_balance"] == 100
2829
- assert bal["3"]["confirmed_wallet_balance"] == 20
2830
- bal_ids = await client.get_wallet_balances([3, 2])
2831
- assert len(bal_ids) == 2
2832
- assert bal["2"]["confirmed_wallet_balance"] == 100
2833
- assert bal["3"]["confirmed_wallet_balance"] == 20
3219
+ bals_response = await client.get_wallet_balances(GetWalletBalances())
3220
+ assert len(bals_response.wallet_balances) == 3
3221
+ assert bals_response.wallet_balances[uint32(1)].confirmed_wallet_balance == 1999999999880
3222
+ assert bals_response.wallet_balances[uint32(2)].confirmed_wallet_balance == 100
3223
+ assert bals_response.wallet_balances[uint32(3)].confirmed_wallet_balance == 20
3224
+ bals_response = await client.get_wallet_balances(GetWalletBalances([uint32(3), uint32(2)]))
3225
+ assert len(bals_response.wallet_balances) == 2
3226
+ assert bals_response.wallet_balances[uint32(2)].confirmed_wallet_balance == 100
3227
+ assert bals_response.wallet_balances[uint32(3)].confirmed_wallet_balance == 20
2834
3228
 
2835
3229
 
2836
3230
  @pytest.mark.parametrize(