chia-blockchain 2.5.2rc2__py3-none-any.whl → 2.5.3__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 (640) hide show
  1. chia/__init__.py +7 -0
  2. chia/_tests/blockchain/blockchain_test_utils.py +1 -1
  3. chia/_tests/blockchain/test_augmented_chain.py +54 -5
  4. chia/_tests/blockchain/test_blockchain.py +5 -12
  5. chia/_tests/blockchain/test_blockchain_transactions.py +3 -5
  6. chia/_tests/blockchain/test_get_block_generator.py +2 -2
  7. chia/_tests/blockchain/test_lookup_fork_chain.py +2 -2
  8. chia/_tests/clvm/benchmark_costs.py +2 -1
  9. chia/_tests/clvm/coin_store.py +4 -3
  10. chia/_tests/clvm/test_chialisp_deserialization.py +2 -2
  11. chia/_tests/clvm/test_curry_and_treehash.py +1 -1
  12. chia/_tests/clvm/test_puzzle_compression.py +2 -2
  13. chia/_tests/clvm/test_puzzles.py +2 -2
  14. chia/_tests/clvm/test_singletons.py +2 -2
  15. chia/_tests/clvm/test_spend_sim.py +1 -1
  16. chia/_tests/cmds/cmd_test_utils.py +2 -2
  17. chia/_tests/cmds/test_click_types.py +2 -2
  18. chia/_tests/cmds/test_cmd_framework.py +6 -6
  19. chia/_tests/cmds/test_show.py +4 -3
  20. chia/_tests/cmds/test_tx_config_args.py +1 -1
  21. chia/_tests/cmds/testing_classes.py +2 -2
  22. chia/_tests/cmds/wallet/test_consts.py +2 -2
  23. chia/_tests/cmds/wallet/test_did.py +2 -2
  24. chia/_tests/cmds/wallet/test_nft.py +2 -2
  25. chia/_tests/cmds/wallet/test_notifications.py +3 -2
  26. chia/_tests/cmds/wallet/test_vcs.py +2 -2
  27. chia/_tests/cmds/wallet/test_wallet.py +4 -8
  28. chia/_tests/conftest.py +4 -3
  29. chia/_tests/connection_utils.py +2 -2
  30. chia/_tests/core/cmds/test_keys.py +1 -2
  31. chia/_tests/core/cmds/test_wallet.py +2 -2
  32. chia/_tests/core/consensus/test_block_creation.py +2 -2
  33. chia/_tests/core/consensus/test_pot_iterations.py +1 -1
  34. chia/_tests/core/custom_types/test_coin.py +2 -2
  35. chia/_tests/core/custom_types/test_proof_of_space.py +2 -2
  36. chia/_tests/core/custom_types/test_spend_bundle.py +2 -2
  37. chia/_tests/core/data_layer/conftest.py +1 -1
  38. chia/_tests/core/data_layer/test_data_layer.py +1 -1
  39. chia/_tests/core/data_layer/test_data_layer_util.py +1 -1
  40. chia/_tests/core/data_layer/test_data_rpc.py +2 -2
  41. chia/_tests/core/data_layer/test_data_store.py +1 -1
  42. chia/_tests/core/data_layer/test_data_store_schema.py +1 -1
  43. chia/_tests/core/data_layer/util.py +2 -1
  44. chia/_tests/core/farmer/test_farmer_api.py +1 -1
  45. chia/_tests/core/full_node/full_sync/test_full_sync.py +1 -7
  46. chia/_tests/core/full_node/ram_db.py +2 -1
  47. chia/_tests/core/full_node/stores/test_block_store.py +2 -2
  48. chia/_tests/core/full_node/stores/test_coin_store.py +2 -2
  49. chia/_tests/core/full_node/stores/test_full_node_store.py +3 -3
  50. chia/_tests/core/full_node/stores/test_hint_store.py +2 -2
  51. chia/_tests/core/full_node/stores/test_sync_store.py +1 -1
  52. chia/_tests/core/full_node/test_address_manager.py +1 -1
  53. chia/_tests/core/full_node/test_block_height_map.py +2 -2
  54. chia/_tests/core/full_node/test_conditions.py +1 -1
  55. chia/_tests/core/full_node/test_full_node.py +346 -164
  56. chia/_tests/core/full_node/test_generator_tools.py +3 -2
  57. chia/_tests/core/full_node/test_hint_management.py +2 -2
  58. chia/_tests/core/full_node/test_performance.py +2 -15
  59. chia/_tests/core/full_node/test_subscriptions.py +1 -1
  60. chia/_tests/core/full_node/test_transactions.py +186 -185
  61. chia/_tests/core/full_node/test_tx_processing_queue.py +1 -1
  62. chia/_tests/core/make_block_generator.py +2 -2
  63. chia/_tests/core/mempool/test_mempool.py +165 -22
  64. chia/_tests/core/mempool/test_mempool_fee_estimator.py +1 -1
  65. chia/_tests/core/mempool/test_mempool_fee_protocol.py +1 -1
  66. chia/_tests/core/mempool/test_mempool_manager.py +476 -66
  67. chia/_tests/core/mempool/test_mempool_performance.py +2 -2
  68. chia/_tests/core/mempool/test_singleton_fast_forward.py +19 -25
  69. chia/_tests/core/node_height.py +2 -1
  70. chia/_tests/core/server/test_capabilities.py +1 -1
  71. chia/_tests/core/server/test_dos.py +36 -28
  72. chia/_tests/core/server/test_loop.py +3 -3
  73. chia/_tests/core/server/test_rate_limits.py +1 -1
  74. chia/_tests/core/server/test_server.py +2 -2
  75. chia/_tests/core/services/test_services.py +1 -1
  76. chia/_tests/core/ssl/test_ssl.py +1 -1
  77. chia/_tests/core/test_coins.py +2 -1
  78. chia/_tests/core/test_cost_calculation.py +2 -2
  79. chia/_tests/core/test_crawler.py +2 -2
  80. chia/_tests/core/test_db_conversion.py +2 -2
  81. chia/_tests/core/test_db_validation.py +26 -13
  82. chia/_tests/core/test_farmer_harvester_rpc.py +2 -2
  83. chia/_tests/core/test_full_node_rpc.py +2 -2
  84. chia/_tests/core/test_merkle_set.py +2 -2
  85. chia/_tests/core/test_program.py +2 -2
  86. chia/_tests/core/test_rpc_util.py +1 -1
  87. chia/_tests/core/test_seeder.py +1 -1
  88. chia/_tests/core/util/test_block_cache.py +3 -3
  89. chia/_tests/core/util/test_jsonify.py +3 -2
  90. chia/_tests/core/util/test_keychain.py +3 -3
  91. chia/_tests/core/util/test_streamable.py +3 -4
  92. chia/_tests/environments/wallet.py +3 -2
  93. chia/_tests/farmer_harvester/test_farmer.py +3 -4
  94. chia/_tests/farmer_harvester/test_farmer_harvester.py +2 -2
  95. chia/_tests/farmer_harvester/test_filter_prefix_bits.py +2 -2
  96. chia/_tests/farmer_harvester/test_third_party_harvesters.py +3 -4
  97. chia/_tests/fee_estimation/test_fee_estimation_integration.py +1 -1
  98. chia/_tests/fee_estimation/test_fee_estimation_rpc.py +2 -2
  99. chia/_tests/fee_estimation/test_fee_estimation_unit_tests.py +1 -1
  100. chia/_tests/fee_estimation/test_mempoolitem_height_added.py +3 -4
  101. chia/_tests/generator/test_compression.py +20 -10
  102. chia/_tests/generator/test_rom.py +7 -9
  103. chia/_tests/plot_sync/test_delta.py +2 -2
  104. chia/_tests/plot_sync/test_plot_sync.py +2 -2
  105. chia/_tests/plot_sync/test_receiver.py +2 -2
  106. chia/_tests/plot_sync/test_sender.py +2 -2
  107. chia/_tests/plot_sync/test_sync_simulated.py +2 -2
  108. chia/_tests/plot_sync/util.py +3 -2
  109. chia/_tests/plotting/test_plot_manager.py +1 -1
  110. chia/_tests/pools/test_pool_cli_parsing.py +3 -2
  111. chia/_tests/pools/test_pool_cmdline.py +2 -2
  112. chia/_tests/pools/test_pool_puzzles_lifecycle.py +3 -3
  113. chia/_tests/pools/test_pool_rpc.py +4 -5
  114. chia/_tests/pools/test_pool_wallet.py +1 -1
  115. chia/_tests/pools/test_wallet_pool_store.py +2 -2
  116. chia/_tests/rpc/test_rpc_client.py +1 -1
  117. chia/_tests/rpc/test_rpc_server.py +1 -1
  118. chia/_tests/simulation/test_simulation.py +36 -8
  119. chia/_tests/simulation/test_simulator.py +5 -5
  120. chia/_tests/simulation/test_start_simulator.py +2 -2
  121. chia/_tests/timelord/test_new_peak.py +2 -2
  122. chia/_tests/tools/test_run_block.py +3 -2
  123. chia/_tests/util/benchmark_cost.py +2 -2
  124. chia/_tests/util/benchmarks.py +17 -6
  125. chia/_tests/util/blockchain.py +2 -1
  126. chia/_tests/util/blockchain_mock.py +9 -5
  127. chia/_tests/util/build_network_protocol_files.py +2 -1
  128. chia/_tests/util/constants.py +2 -1
  129. chia/_tests/util/full_sync.py +6 -3
  130. chia/_tests/util/gen_ssl_certs.py +2 -2
  131. chia/_tests/util/generator_tools_testing.py +4 -3
  132. chia/_tests/util/get_name_puzzle_conditions.py +2 -2
  133. chia/_tests/util/misc.py +16 -2
  134. chia/_tests/util/network_protocol_data.py +17 -7
  135. chia/_tests/util/run_block.py +6 -8
  136. chia/_tests/util/setup_nodes.py +4 -3
  137. chia/_tests/util/spend_sim.py +9 -5
  138. chia/_tests/util/test_condition_tools.py +2 -2
  139. chia/_tests/util/test_config.py +2 -1
  140. chia/_tests/util/test_errors.py +2 -1
  141. chia/_tests/util/test_full_block_utils.py +17 -7
  142. chia/_tests/util/test_misc.py +1 -1
  143. chia/_tests/util/test_network_protocol_test.py +24 -24
  144. chia/_tests/util/test_replace_str_to_bytes.py +2 -2
  145. chia/_tests/util/test_trusted_peer.py +1 -1
  146. chia/_tests/util/time_out_assert.py +20 -7
  147. chia/_tests/wallet/cat_wallet/test_cat_lifecycle.py +1 -1
  148. chia/_tests/wallet/cat_wallet/test_cat_outer_puzzle.py +2 -2
  149. chia/_tests/wallet/cat_wallet/test_cat_wallet.py +5 -6
  150. chia/_tests/wallet/cat_wallet/test_offer_lifecycle.py +17 -15
  151. chia/_tests/wallet/cat_wallet/test_trades.py +2 -2
  152. chia/_tests/wallet/clawback/test_clawback_lifecycle.py +2 -2
  153. chia/_tests/wallet/clawback/test_clawback_metadata.py +2 -2
  154. chia/_tests/wallet/conftest.py +3 -3
  155. chia/_tests/wallet/db_wallet/test_db_graftroot.py +3 -5
  156. chia/_tests/wallet/db_wallet/test_dl_offers.py +2 -2
  157. chia/_tests/wallet/db_wallet/test_dl_wallet.py +433 -384
  158. chia/_tests/wallet/did_wallet/test_did.py +3 -3
  159. chia/_tests/wallet/nft_wallet/test_nft_1_offers.py +2 -2
  160. chia/_tests/wallet/nft_wallet/test_nft_bulk_mint.py +2 -2
  161. chia/_tests/wallet/nft_wallet/test_nft_lifecycle.py +3 -4
  162. chia/_tests/wallet/nft_wallet/test_nft_offers.py +1293 -703
  163. chia/_tests/wallet/nft_wallet/test_nft_puzzles.py +28 -30
  164. chia/_tests/wallet/nft_wallet/test_nft_wallet.py +2 -2
  165. chia/_tests/wallet/nft_wallet/test_ownership_outer_puzzle.py +2 -2
  166. chia/_tests/wallet/rpc/config.py +1 -1
  167. chia/_tests/wallet/rpc/test_dl_wallet_rpc.py +2 -2
  168. chia/_tests/wallet/rpc/test_wallet_rpc.py +20 -77
  169. chia/_tests/wallet/simple_sync/test_simple_sync_protocol.py +9 -7
  170. chia/_tests/wallet/sync/test_wallet_sync.py +79 -31
  171. chia/_tests/wallet/test_clvm_streamable.py +2 -2
  172. chia/_tests/wallet/test_coin_management.py +7 -7
  173. chia/_tests/wallet/test_coin_selection.py +20 -2
  174. chia/_tests/wallet/test_conditions.py +2 -2
  175. chia/_tests/wallet/test_debug_spend_bundle.py +2 -2
  176. chia/_tests/wallet/test_new_wallet_protocol.py +2 -2
  177. chia/_tests/wallet/test_nft_store.py +2 -2
  178. chia/_tests/wallet/test_notifications.py +2 -2
  179. chia/_tests/wallet/test_puzzle_store.py +2 -2
  180. chia/_tests/wallet/test_sign_coin_spends.py +2 -2
  181. chia/_tests/wallet/test_signer_protocol.py +3 -3
  182. chia/_tests/wallet/test_singleton.py +3 -11
  183. chia/_tests/wallet/test_singleton_lifecycle_fast.py +12 -13
  184. chia/_tests/wallet/test_singleton_store.py +2 -4
  185. chia/_tests/wallet/test_transaction_store.py +2 -2
  186. chia/_tests/wallet/test_util.py +2 -2
  187. chia/_tests/wallet/test_wallet.py +53 -49
  188. chia/_tests/wallet/test_wallet_action_scope.py +24 -6
  189. chia/_tests/wallet/test_wallet_blockchain.py +1 -1
  190. chia/_tests/wallet/test_wallet_coin_store.py +2 -2
  191. chia/_tests/wallet/test_wallet_interested_store.py +2 -2
  192. chia/_tests/wallet/test_wallet_node.py +3 -3
  193. chia/_tests/wallet/test_wallet_retry.py +3 -3
  194. chia/_tests/wallet/test_wallet_state_manager.py +8 -8
  195. chia/_tests/wallet/test_wallet_test_framework.py +1 -1
  196. chia/_tests/wallet/test_wallet_trade_store.py +2 -2
  197. chia/_tests/wallet/test_wallet_utils.py +2 -2
  198. chia/_tests/wallet/vc_wallet/test_cr_outer_puzzle.py +3 -2
  199. chia/_tests/wallet/vc_wallet/test_vc_lifecycle.py +15 -15
  200. chia/_tests/wallet/vc_wallet/test_vc_wallet.py +5 -3
  201. chia/_tests/wallet/wallet_block_tools.py +15 -7
  202. chia/_tests/weight_proof/test_weight_proof.py +3 -3
  203. chia/cmds/chia.py +0 -2
  204. chia/cmds/cmd_classes.py +3 -3
  205. chia/cmds/cmd_helpers.py +4 -4
  206. chia/cmds/cmds_util.py +2 -2
  207. chia/cmds/coin_funcs.py +3 -2
  208. chia/cmds/coins.py +1 -1
  209. chia/cmds/data.py +2 -2
  210. chia/cmds/data_funcs.py +3 -2
  211. chia/cmds/db_upgrade_func.py +2 -2
  212. chia/cmds/db_validate_func.py +15 -8
  213. chia/cmds/farm.py +2 -4
  214. chia/cmds/keys.py +0 -2
  215. chia/cmds/keys_funcs.py +1 -1
  216. chia/cmds/netspace_funcs.py +2 -1
  217. chia/cmds/param_types.py +2 -2
  218. chia/cmds/plotnft.py +2 -2
  219. chia/cmds/plotnft_funcs.py +2 -2
  220. chia/cmds/rpc.py +1 -1
  221. chia/cmds/show.py +1 -2
  222. chia/cmds/show_funcs.py +6 -3
  223. chia/cmds/signer.py +1 -2
  224. chia/cmds/sim.py +1 -2
  225. chia/cmds/sim_funcs.py +2 -2
  226. chia/cmds/wallet.py +2 -2
  227. chia/cmds/wallet_funcs.py +4 -11
  228. chia/consensus/block_body_validation.py +3 -4
  229. chia/consensus/block_creation.py +10 -6
  230. chia/consensus/block_header_validation.py +3 -4
  231. chia/consensus/block_record.py +2 -3
  232. chia/consensus/block_rewards.py +1 -1
  233. chia/consensus/blockchain.py +20 -17
  234. chia/consensus/blockchain_interface.py +5 -4
  235. chia/consensus/coinbase.py +2 -2
  236. chia/consensus/constants.py +1 -1
  237. chia/consensus/cost_calculator.py +2 -1
  238. chia/consensus/default_constants.py +4 -3
  239. chia/consensus/deficit.py +3 -2
  240. chia/consensus/difficulty_adjustment.py +8 -9
  241. chia/consensus/find_fork_point.py +4 -3
  242. chia/consensus/full_block_to_block_record.py +4 -3
  243. chia/consensus/get_block_challenge.py +4 -3
  244. chia/consensus/get_block_generator.py +3 -2
  245. chia/consensus/make_sub_epoch_summary.py +3 -2
  246. chia/consensus/multiprocess_validation.py +9 -4
  247. chia/consensus/pos_quality.py +1 -1
  248. chia/consensus/pot_iterations.py +4 -3
  249. chia/consensus/vdf_info_computation.py +4 -3
  250. chia/daemon/client.py +1 -1
  251. chia/daemon/keychain_server.py +1 -1
  252. chia/daemon/server.py +1 -1
  253. chia/daemon/windows_signal.py +1 -1
  254. chia/data_layer/data_layer.py +4 -3
  255. chia/data_layer/data_layer_errors.py +1 -1
  256. chia/data_layer/data_layer_util.py +2 -2
  257. chia/data_layer/data_layer_wallet.py +47 -69
  258. chia/data_layer/data_store.py +1 -1
  259. chia/data_layer/dl_wallet_store.py +5 -6
  260. chia/data_layer/download_data.py +1 -1
  261. chia/data_layer/s3_plugin_service.py +4 -4
  262. chia/data_layer/singleton_record.py +23 -0
  263. chia/data_layer/util/benchmark.py +2 -1
  264. chia/farmer/farmer.py +4 -6
  265. chia/farmer/farmer_api.py +4 -6
  266. chia/full_node/bitcoin_fee_estimator.py +2 -1
  267. chia/full_node/block_height_map.py +2 -2
  268. chia/full_node/block_store.py +8 -9
  269. chia/{util → full_node}/check_fork_next_block.py +2 -1
  270. chia/full_node/coin_store.py +10 -10
  271. chia/full_node/fee_estimate.py +2 -1
  272. chia/full_node/fee_estimation.py +2 -1
  273. chia/full_node/fee_estimator.py +2 -1
  274. chia/full_node/fee_estimator_interface.py +1 -1
  275. chia/full_node/fee_history.py +2 -1
  276. chia/full_node/fee_tracker.py +2 -1
  277. chia/full_node/full_node.py +15 -13
  278. chia/full_node/full_node_api.py +12 -32
  279. chia/full_node/full_node_store.py +4 -3
  280. chia/full_node/hint_management.py +2 -1
  281. chia/full_node/hint_store.py +3 -3
  282. chia/full_node/mempool.py +80 -12
  283. chia/full_node/mempool_check_conditions.py +6 -7
  284. chia/full_node/mempool_manager.py +168 -21
  285. chia/full_node/pending_tx_cache.py +2 -2
  286. chia/full_node/subscriptions.py +2 -2
  287. chia/full_node/sync_store.py +2 -3
  288. chia/full_node/tx_processing_queue.py +2 -1
  289. chia/full_node/weight_proof.py +5 -8
  290. chia/harvester/harvester.py +5 -3
  291. chia/harvester/harvester_api.py +2 -2
  292. chia/introducer/introducer.py +30 -2
  293. chia/introducer/introducer_api.py +9 -1
  294. chia/legacy/keyring.py +1 -2
  295. chia/plot_sync/exceptions.py +2 -1
  296. chia/plot_sync/receiver.py +2 -2
  297. chia/plot_sync/sender.py +1 -1
  298. chia/plotting/cache.py +2 -2
  299. chia/plotting/check_plots.py +4 -2
  300. chia/plotting/create_plots.py +1 -1
  301. chia/plotting/manager.py +3 -3
  302. chia/plotting/util.py +2 -2
  303. chia/pools/pool_config.py +1 -1
  304. chia/pools/pool_puzzles.py +23 -17
  305. chia/pools/pool_wallet.py +22 -9
  306. chia/pools/pool_wallet_info.py +2 -2
  307. chia/protocols/farmer_protocol.py +3 -6
  308. chia/protocols/full_node_protocol.py +3 -2
  309. chia/protocols/harvester_protocol.py +3 -4
  310. chia/protocols/pool_protocol.py +2 -2
  311. chia/protocols/shared_protocol.py +2 -1
  312. chia/protocols/timelord_protocol.py +4 -4
  313. chia/protocols/wallet_protocol.py +2 -2
  314. chia/rpc/data_layer_rpc_api.py +3 -4
  315. chia/rpc/data_layer_rpc_client.py +3 -2
  316. chia/rpc/farmer_rpc_api.py +2 -2
  317. chia/rpc/farmer_rpc_client.py +2 -1
  318. chia/rpc/full_node_rpc_api.py +3 -2
  319. chia/rpc/full_node_rpc_client.py +3 -2
  320. chia/rpc/harvester_rpc_api.py +2 -1
  321. chia/rpc/rpc_client.py +2 -2
  322. chia/rpc/rpc_server.py +1 -1
  323. chia/rpc/wallet_request_types.py +2 -62
  324. chia/rpc/wallet_rpc_api.py +98 -628
  325. chia/rpc/wallet_rpc_client.py +5 -253
  326. chia/seeder/crawl_store.py +1 -1
  327. chia/seeder/crawler.py +2 -2
  328. chia/seeder/peer_record.py +2 -1
  329. chia/seeder/start_crawler.py +3 -1
  330. chia/server/address_manager.py +2 -1
  331. chia/server/address_manager_store.py +1 -1
  332. chia/server/capabilities.py +2 -1
  333. chia/server/introducer_peers.py +2 -1
  334. chia/server/node_discovery.py +1 -1
  335. chia/server/outbound_message.py +2 -1
  336. chia/server/server.py +2 -2
  337. chia/server/start_data_layer.py +2 -1
  338. chia/server/start_farmer.py +3 -1
  339. chia/server/start_full_node.py +4 -2
  340. chia/server/start_harvester.py +3 -1
  341. chia/server/start_introducer.py +12 -1
  342. chia/server/start_service.py +2 -1
  343. chia/server/start_timelord.py +3 -1
  344. chia/server/start_wallet.py +3 -1
  345. chia/server/upnp.py +1 -2
  346. chia/server/ws_connection.py +3 -4
  347. chia/simulator/add_blocks_in_batches.py +5 -3
  348. chia/simulator/block_tools.py +16 -12
  349. chia/simulator/full_node_simulator.py +9 -14
  350. chia/simulator/setup_services.py +5 -3
  351. chia/simulator/simulator_full_node_rpc_api.py +3 -2
  352. chia/simulator/simulator_full_node_rpc_client.py +3 -2
  353. chia/simulator/simulator_protocol.py +3 -2
  354. chia/simulator/simulator_test_tools.py +2 -2
  355. chia/simulator/start_simulator.py +3 -2
  356. chia/simulator/wallet_tools.py +3 -4
  357. chia/timelord/iters_from_block.py +4 -4
  358. chia/timelord/timelord.py +7 -12
  359. chia/timelord/timelord_api.py +3 -3
  360. chia/timelord/timelord_state.py +4 -3
  361. chia/types/block_protocol.py +2 -2
  362. chia/types/blockchain_format/coin.py +2 -2
  363. chia/types/blockchain_format/program.py +1 -1
  364. chia/types/blockchain_format/proof_of_space.py +3 -4
  365. chia/types/blockchain_format/tree_hash.py +1 -1
  366. chia/types/blockchain_format/vdf.py +3 -4
  367. chia/types/clvm_cost.py +1 -1
  368. chia/types/coin_record.py +4 -3
  369. chia/types/coin_spend.py +1 -1
  370. chia/types/eligible_coin_spends.py +9 -5
  371. chia/types/fee_rate.py +1 -1
  372. chia/types/generator_types.py +3 -3
  373. chia/types/internal_mempool_item.py +3 -2
  374. chia/types/mempool_item.py +10 -3
  375. chia/types/mempool_submission_status.py +2 -1
  376. chia/types/mojos.py +1 -1
  377. chia/types/peer_info.py +2 -1
  378. chia/types/transaction_queue_entry.py +2 -1
  379. chia/types/unfinished_header_block.py +4 -4
  380. chia/types/validation_state.py +2 -1
  381. chia/types/weight_proof.py +1 -9
  382. chia/util/augmented_chain.py +20 -9
  383. chia/util/block_cache.py +8 -4
  384. chia/util/condition_tools.py +2 -2
  385. chia/util/full_block_utils.py +3 -4
  386. chia/util/generator_tools.py +2 -2
  387. chia/util/initial-config.yaml +2 -11
  388. chia/util/network.py +2 -2
  389. chia/util/prev_transaction_block.py +2 -1
  390. chia/util/task_timing.py +1 -1
  391. chia/util/vdf_prover.py +3 -3
  392. chia/util/ws_message.py +1 -1
  393. chia/wallet/cat_wallet/cat_info.py +3 -2
  394. chia/wallet/cat_wallet/cat_outer_puzzle.py +3 -2
  395. chia/wallet/cat_wallet/cat_utils.py +6 -4
  396. chia/wallet/cat_wallet/cat_wallet.py +16 -18
  397. chia/wallet/cat_wallet/lineage_store.py +2 -1
  398. chia/wallet/coin_selection.py +5 -5
  399. chia/wallet/conditions.py +22 -16
  400. chia/wallet/db_wallet/db_wallet_puzzles.py +15 -15
  401. chia/wallet/derivation_record.py +2 -2
  402. chia/wallet/derive_keys.py +2 -2
  403. chia/wallet/did_wallet/did_info.py +3 -2
  404. chia/wallet/did_wallet/did_wallet.py +41 -19
  405. chia/wallet/did_wallet/did_wallet_puzzles.py +18 -12
  406. chia/wallet/driver_protocol.py +1 -1
  407. chia/wallet/lineage_proof.py +3 -2
  408. chia/wallet/nft_wallet/metadata_outer_puzzle.py +6 -7
  409. chia/wallet/nft_wallet/nft_info.py +5 -5
  410. chia/wallet/nft_wallet/nft_puzzle_utils.py +293 -0
  411. chia/wallet/nft_wallet/nft_puzzles.py +21 -298
  412. chia/wallet/nft_wallet/nft_wallet.py +47 -62
  413. chia/wallet/nft_wallet/ownership_outer_puzzle.py +4 -8
  414. chia/wallet/nft_wallet/singleton_outer_puzzle.py +3 -2
  415. chia/wallet/nft_wallet/transfer_program_puzzle.py +6 -10
  416. chia/wallet/nft_wallet/uncurry_nft.py +6 -8
  417. chia/wallet/notification_manager.py +5 -5
  418. chia/wallet/notification_store.py +3 -2
  419. chia/wallet/outer_puzzles.py +2 -1
  420. chia/wallet/puzzles/clawback/drivers.py +21 -8
  421. chia/wallet/puzzles/clawback/metadata.py +3 -2
  422. chia/wallet/puzzles/clawback/puzzle_decorator.py +5 -4
  423. chia/wallet/puzzles/deployed_puzzle_hashes.json +0 -10
  424. chia/wallet/puzzles/p2_conditions.py +3 -2
  425. chia/wallet/puzzles/p2_delegated_conditions.py +3 -2
  426. chia/wallet/puzzles/p2_delegated_puzzle.py +3 -2
  427. chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py +3 -3
  428. chia/wallet/puzzles/p2_m_of_n_delegate_direct.py +3 -2
  429. chia/wallet/puzzles/p2_puzzle_hash.py +4 -3
  430. chia/wallet/puzzles/puzzle_utils.py +3 -2
  431. chia/wallet/puzzles/singleton_top_layer.py +26 -10
  432. chia/wallet/puzzles/singleton_top_layer_v1_1.py +21 -9
  433. chia/wallet/puzzles/tails.py +21 -129
  434. chia/wallet/signer_protocol.py +3 -2
  435. chia/wallet/singleton.py +12 -6
  436. chia/wallet/singleton_record.py +3 -2
  437. chia/wallet/trade_manager.py +31 -55
  438. chia/wallet/trade_record.py +3 -2
  439. chia/wallet/trading/offer.py +14 -13
  440. chia/wallet/trading/trade_store.py +3 -4
  441. chia/wallet/transaction_record.py +2 -2
  442. chia/wallet/util/blind_signer_tl.py +3 -2
  443. chia/wallet/util/compute_hints.py +3 -2
  444. chia/wallet/util/compute_memos.py +2 -2
  445. chia/wallet/util/curry_and_treehash.py +1 -2
  446. chia/wallet/util/merkle_tree.py +1 -1
  447. chia/wallet/util/merkle_utils.py +1 -1
  448. chia/wallet/util/new_peak_queue.py +2 -1
  449. chia/wallet/util/notifications.py +5 -4
  450. chia/wallet/util/peer_request_cache.py +3 -2
  451. chia/wallet/util/puzzle_compression.py +6 -4
  452. chia/wallet/util/puzzle_decorator.py +6 -4
  453. chia/wallet/util/query_filter.py +3 -2
  454. chia/wallet/util/tx_config.py +3 -3
  455. chia/wallet/util/wallet_sync_utils.py +2 -2
  456. chia/wallet/util/wallet_types.py +2 -3
  457. chia/wallet/vc_wallet/cr_cat_drivers.py +18 -22
  458. chia/wallet/vc_wallet/cr_cat_wallet.py +14 -10
  459. chia/wallet/vc_wallet/cr_outer_puzzle.py +2 -2
  460. chia/wallet/vc_wallet/vc_drivers.py +50 -68
  461. chia/wallet/vc_wallet/vc_store.py +2 -2
  462. chia/wallet/vc_wallet/vc_wallet.py +47 -15
  463. chia/wallet/wallet.py +51 -46
  464. chia/wallet/wallet_action_scope.py +4 -0
  465. chia/wallet/wallet_blockchain.py +12 -7
  466. chia/wallet/wallet_coin_record.py +3 -2
  467. chia/wallet/wallet_coin_store.py +3 -2
  468. chia/wallet/wallet_info.py +2 -1
  469. chia/wallet/wallet_interested_store.py +3 -2
  470. chia/wallet/wallet_nft_store.py +4 -4
  471. chia/wallet/wallet_node.py +3 -4
  472. chia/wallet/wallet_pool_store.py +3 -4
  473. chia/wallet/wallet_protocol.py +19 -5
  474. chia/wallet/wallet_puzzle_store.py +2 -2
  475. chia/wallet/wallet_retry_store.py +3 -6
  476. chia/wallet/wallet_singleton_store.py +2 -2
  477. chia/wallet/wallet_state_manager.py +20 -197
  478. chia/wallet/wallet_transaction_store.py +2 -2
  479. chia/wallet/wallet_user_store.py +2 -1
  480. chia/wallet/wallet_weight_proof_handler.py +3 -2
  481. {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3.dist-info}/METADATA +3 -2
  482. chia_blockchain-2.5.3.dist-info/RECORD +891 -0
  483. mozilla-ca/cacert.pem +64 -33
  484. chia/_tests/clvm/test_condition_codes.py +0 -13
  485. chia/_tests/cmds/wallet/test_dao.py +0 -565
  486. chia/_tests/wallet/dao_wallet/__init__.py +0 -0
  487. chia/_tests/wallet/dao_wallet/config.py +0 -3
  488. chia/_tests/wallet/dao_wallet/test_dao_clvm.py +0 -1330
  489. chia/_tests/wallet/dao_wallet/test_dao_wallets.py +0 -3488
  490. chia/cmds/dao.py +0 -1064
  491. chia/cmds/dao_funcs.py +0 -598
  492. chia/consensus/puzzles/__init__.py +0 -0
  493. chia/consensus/puzzles/chialisp_deserialisation.clsp +0 -69
  494. chia/consensus/puzzles/chialisp_deserialisation.clsp.hex +0 -1
  495. chia/consensus/puzzles/rom_bootstrap_generator.clsp +0 -37
  496. chia/consensus/puzzles/rom_bootstrap_generator.clsp.hex +0 -1
  497. chia/full_node/puzzles/__init__.py +0 -0
  498. chia/full_node/puzzles/block_program_zero.clsp +0 -14
  499. chia/full_node/puzzles/block_program_zero.clsp.hex +0 -1
  500. chia/full_node/puzzles/decompress_coin_spend_entry.clsp +0 -5
  501. chia/full_node/puzzles/decompress_coin_spend_entry.clsp.hex +0 -1
  502. chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp +0 -7
  503. chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp.hex +0 -1
  504. chia/full_node/puzzles/decompress_puzzle.clsp +0 -6
  505. chia/full_node/puzzles/decompress_puzzle.clsp.hex +0 -1
  506. chia/pools/puzzles/__init__.py +0 -0
  507. chia/pools/puzzles/pool_member_innerpuz.clsp +0 -70
  508. chia/pools/puzzles/pool_member_innerpuz.clsp.hex +0 -1
  509. chia/pools/puzzles/pool_waitingroom_innerpuz.clsp +0 -69
  510. chia/pools/puzzles/pool_waitingroom_innerpuz.clsp.hex +0 -1
  511. chia/simulator/simulator_constants.py +0 -13
  512. chia/types/blockchain_format/foliage.py +0 -8
  513. chia/types/blockchain_format/pool_target.py +0 -5
  514. chia/types/blockchain_format/reward_chain_block.py +0 -6
  515. chia/types/blockchain_format/sized_bytes.py +0 -11
  516. chia/util/ints.py +0 -19
  517. chia/wallet/cat_wallet/dao_cat_info.py +0 -28
  518. chia/wallet/cat_wallet/dao_cat_wallet.py +0 -669
  519. chia/wallet/cat_wallet/puzzles/__init__.py +0 -0
  520. chia/wallet/cat_wallet/puzzles/cat_truths.clib +0 -31
  521. chia/wallet/cat_wallet/puzzles/cat_v2.clsp +0 -397
  522. chia/wallet/cat_wallet/puzzles/cat_v2.clsp.hex +0 -1
  523. chia/wallet/cat_wallet/puzzles/delegated_tail.clsp +0 -25
  524. chia/wallet/cat_wallet/puzzles/delegated_tail.clsp.hex +0 -1
  525. chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp +0 -15
  526. chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp.hex +0 -1
  527. chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp +0 -26
  528. chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp.hex +0 -1
  529. chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp +0 -42
  530. chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp.hex +0 -1
  531. chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp +0 -24
  532. chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp.hex +0 -1
  533. chia/wallet/dao_wallet/__init__.py +0 -0
  534. chia/wallet/dao_wallet/dao_info.py +0 -61
  535. chia/wallet/dao_wallet/dao_utils.py +0 -811
  536. chia/wallet/dao_wallet/dao_wallet.py +0 -2119
  537. chia/wallet/did_wallet/puzzles/__init__.py +0 -0
  538. chia/wallet/did_wallet/puzzles/did_innerpuz.clsp +0 -135
  539. chia/wallet/did_wallet/puzzles/did_innerpuz.clsp.hex +0 -1
  540. chia/wallet/payment.py +0 -33
  541. chia/wallet/puzzles/augmented_condition.clsp +0 -13
  542. chia/wallet/puzzles/augmented_condition.clsp.hex +0 -1
  543. chia/wallet/puzzles/condition_codes.clib +0 -77
  544. chia/wallet/puzzles/curry-and-treehash.clib +0 -102
  545. chia/wallet/puzzles/curry.clib +0 -135
  546. chia/wallet/puzzles/curry_by_index.clib +0 -16
  547. chia/wallet/puzzles/dao_cat_eve.clsp +0 -17
  548. chia/wallet/puzzles/dao_cat_eve.clsp.hex +0 -1
  549. chia/wallet/puzzles/dao_cat_launcher.clsp +0 -36
  550. chia/wallet/puzzles/dao_cat_launcher.clsp.hex +0 -1
  551. chia/wallet/puzzles/dao_finished_state.clsp +0 -35
  552. chia/wallet/puzzles/dao_finished_state.clsp.hex +0 -1
  553. chia/wallet/puzzles/dao_finished_state.clsp.hex.sha256tree +0 -1
  554. chia/wallet/puzzles/dao_lockup.clsp +0 -288
  555. chia/wallet/puzzles/dao_lockup.clsp.hex +0 -1
  556. chia/wallet/puzzles/dao_lockup.clsp.hex.sha256tree +0 -1
  557. chia/wallet/puzzles/dao_proposal.clsp +0 -377
  558. chia/wallet/puzzles/dao_proposal.clsp.hex +0 -1
  559. chia/wallet/puzzles/dao_proposal.clsp.hex.sha256tree +0 -1
  560. chia/wallet/puzzles/dao_proposal_timer.clsp +0 -78
  561. chia/wallet/puzzles/dao_proposal_timer.clsp.hex +0 -1
  562. chia/wallet/puzzles/dao_proposal_timer.clsp.hex.sha256tree +0 -1
  563. chia/wallet/puzzles/dao_proposal_validator.clsp +0 -87
  564. chia/wallet/puzzles/dao_proposal_validator.clsp.hex +0 -1
  565. chia/wallet/puzzles/dao_proposal_validator.clsp.hex.sha256tree +0 -1
  566. chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp +0 -240
  567. chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex +0 -1
  568. chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex.sha256tree +0 -1
  569. chia/wallet/puzzles/dao_treasury.clsp +0 -115
  570. chia/wallet/puzzles/dao_treasury.clsp.hex +0 -1
  571. chia/wallet/puzzles/dao_update_proposal.clsp +0 -44
  572. chia/wallet/puzzles/dao_update_proposal.clsp.hex +0 -1
  573. chia/wallet/puzzles/json.clib +0 -25
  574. chia/wallet/puzzles/merkle_utils.clib +0 -18
  575. chia/wallet/puzzles/notification.clsp +0 -7
  576. chia/wallet/puzzles/notification.clsp.hex +0 -1
  577. chia/wallet/puzzles/p2_1_of_n.clsp +0 -22
  578. chia/wallet/puzzles/p2_1_of_n.clsp.hex +0 -1
  579. chia/wallet/puzzles/p2_conditions.clsp +0 -3
  580. chia/wallet/puzzles/p2_conditions.clsp.hex +0 -1
  581. chia/wallet/puzzles/p2_delegated_conditions.clsp +0 -18
  582. chia/wallet/puzzles/p2_delegated_conditions.clsp.hex +0 -1
  583. chia/wallet/puzzles/p2_delegated_puzzle.clsp +0 -19
  584. chia/wallet/puzzles/p2_delegated_puzzle.clsp.hex +0 -1
  585. chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp +0 -91
  586. chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp.hex +0 -1
  587. chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp +0 -108
  588. chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp.hex +0 -1
  589. chia/wallet/puzzles/p2_parent.clsp +0 -19
  590. chia/wallet/puzzles/p2_parent.clsp.hex +0 -1
  591. chia/wallet/puzzles/p2_puzzle_hash.clsp +0 -18
  592. chia/wallet/puzzles/p2_puzzle_hash.clsp.hex +0 -1
  593. chia/wallet/puzzles/p2_singleton.clsp +0 -30
  594. chia/wallet/puzzles/p2_singleton.clsp.hex +0 -1
  595. chia/wallet/puzzles/p2_singleton_aggregator.clsp +0 -81
  596. chia/wallet/puzzles/p2_singleton_aggregator.clsp.hex +0 -1
  597. chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp +0 -50
  598. chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp.hex +0 -1
  599. chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp +0 -47
  600. chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp.hex +0 -1
  601. chia/wallet/puzzles/settlement_payments.clsp +0 -49
  602. chia/wallet/puzzles/settlement_payments.clsp.hex +0 -1
  603. chia/wallet/puzzles/sha256tree.clib +0 -11
  604. chia/wallet/puzzles/singleton_launcher.clsp +0 -16
  605. chia/wallet/puzzles/singleton_launcher.clsp.hex +0 -1
  606. chia/wallet/puzzles/singleton_top_layer.clsp +0 -177
  607. chia/wallet/puzzles/singleton_top_layer.clsp.hex +0 -1
  608. chia/wallet/puzzles/singleton_top_layer_v1_1.clsp +0 -107
  609. chia/wallet/puzzles/singleton_top_layer_v1_1.clsp.hex +0 -1
  610. chia/wallet/puzzles/singleton_truths.clib +0 -21
  611. chia/wallet/vc_wallet/cr_puzzles/__init__.py +0 -0
  612. chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp +0 -3
  613. chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp.hex +0 -1
  614. chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp +0 -304
  615. chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp.hex +0 -1
  616. chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp +0 -45
  617. chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp.hex +0 -1
  618. chia/wallet/vc_wallet/vc_puzzles/__init__.py +0 -0
  619. chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp +0 -30
  620. chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp.hex +0 -1
  621. chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp +0 -75
  622. chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp.hex +0 -1
  623. chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp +0 -32
  624. chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp.hex +0 -1
  625. chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp +0 -80
  626. chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp.hex +0 -1
  627. chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp +0 -163
  628. chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp.hex +0 -1
  629. chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp +0 -16
  630. chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp.hex +0 -1
  631. chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp +0 -74
  632. chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp.hex +0 -1
  633. chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp +0 -23
  634. chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp.hex +0 -1
  635. chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp +0 -64
  636. chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp.hex +0 -1
  637. chia_blockchain-2.5.2rc2.dist-info/RECORD +0 -1042
  638. {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3.dist-info}/LICENSE +0 -0
  639. {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3.dist-info}/WHEEL +0 -0
  640. {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3.dist-info}/entry_points.txt +0 -0
@@ -1,669 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import logging
4
- import time
5
- from typing import TYPE_CHECKING, Any, ClassVar, Optional, cast
6
-
7
- from chia_rs import G1Element
8
-
9
- from chia.server.ws_connection import WSChiaConnection
10
- from chia.types.blockchain_format.coin import Coin
11
- from chia.types.blockchain_format.program import Program
12
- from chia.types.blockchain_format.sized_bytes import bytes32
13
- from chia.util.byte_types import hexstr_to_bytes
14
- from chia.util.ints import uint32, uint64, uint128
15
- from chia.wallet.cat_wallet.cat_utils import (
16
- CAT_MOD,
17
- SpendableCAT,
18
- construct_cat_puzzle,
19
- unsigned_spend_bundle_for_spendable_cats,
20
- )
21
- from chia.wallet.cat_wallet.cat_wallet import CATWallet
22
- from chia.wallet.cat_wallet.dao_cat_info import DAOCATInfo, LockedCoinInfo
23
- from chia.wallet.cat_wallet.lineage_store import CATLineageStore
24
- from chia.wallet.conditions import Condition, CreatePuzzleAnnouncement, parse_timelock_info
25
- from chia.wallet.dao_wallet.dao_utils import (
26
- add_proposal_to_active_list,
27
- get_active_votes_from_lockup_puzzle,
28
- get_finished_state_inner_puzzle,
29
- get_innerpuz_from_lockup_puzzle,
30
- get_lockup_puzzle,
31
- )
32
- from chia.wallet.lineage_proof import LineageProof
33
- from chia.wallet.payment import Payment
34
- from chia.wallet.transaction_record import TransactionRecord
35
- from chia.wallet.util.curry_and_treehash import calculate_hash_of_quoted_mod_hash
36
- from chia.wallet.util.transaction_type import TransactionType
37
- from chia.wallet.util.tx_config import TXConfig
38
- from chia.wallet.util.wallet_sync_utils import fetch_coin_spend
39
- from chia.wallet.util.wallet_types import WalletType
40
- from chia.wallet.wallet import Wallet
41
- from chia.wallet.wallet_action_scope import WalletActionScope
42
- from chia.wallet.wallet_coin_record import WalletCoinRecord
43
- from chia.wallet.wallet_info import WalletInfo
44
- from chia.wallet.wallet_spend_bundle import WalletSpendBundle
45
-
46
- if TYPE_CHECKING:
47
- from chia.wallet.wallet_state_manager import WalletStateManager
48
-
49
- CAT_MOD_HASH = CAT_MOD.get_tree_hash()
50
- CAT_MOD_HASH_HASH = Program.to(CAT_MOD_HASH).get_tree_hash()
51
- QUOTED_MOD_HASH = calculate_hash_of_quoted_mod_hash(CAT_MOD_HASH)
52
-
53
-
54
- class DAOCATWallet:
55
- if TYPE_CHECKING:
56
- from chia.wallet.wallet_protocol import WalletProtocol
57
-
58
- _protocol_check: ClassVar[WalletProtocol[DAOCATInfo]] = cast("DAOCATWallet", None)
59
-
60
- wallet_state_manager: Any
61
- log: logging.Logger
62
- wallet_info: WalletInfo
63
- dao_cat_info: DAOCATInfo
64
- standard_wallet: Wallet
65
- cost_of_single_tx: Optional[int]
66
- lineage_store: CATLineageStore
67
-
68
- @classmethod
69
- def type(cls) -> WalletType:
70
- return WalletType.DAO_CAT
71
-
72
- @staticmethod
73
- async def create(
74
- wallet_state_manager: WalletStateManager,
75
- wallet: Wallet,
76
- wallet_info: WalletInfo,
77
- ) -> DAOCATWallet:
78
- self = DAOCATWallet()
79
- self.log = logging.getLogger(__name__)
80
-
81
- self.cost_of_single_tx = None
82
- self.wallet_state_manager = wallet_state_manager
83
- self.wallet_info = wallet_info
84
- self.standard_wallet = wallet
85
- try:
86
- self.dao_cat_info = DAOCATInfo.from_bytes(hexstr_to_bytes(self.wallet_info.data))
87
- self.lineage_store = await CATLineageStore.create(self.wallet_state_manager.db_wrapper, self.get_asset_id())
88
- except AssertionError as e: # pragma: no cover
89
- self.log.error(f"Error creating DAO CAT wallet: {e}")
90
-
91
- return self
92
-
93
- @staticmethod
94
- async def get_or_create_wallet_for_cat(
95
- wallet_state_manager: Any,
96
- wallet: Wallet,
97
- limitations_program_hash_hex: str,
98
- name: Optional[str] = None,
99
- ) -> DAOCATWallet:
100
- self = DAOCATWallet()
101
- self.cost_of_single_tx = None
102
- self.standard_wallet = wallet
103
- self.log = logging.getLogger(__name__)
104
-
105
- limitations_program_hash_hex = bytes32.from_hexstr(limitations_program_hash_hex).hex() # Normalize the format
106
-
107
- dao_wallet_id = None
108
- free_cat_wallet_id = None
109
- for id, w in wallet_state_manager.wallets.items():
110
- if w.type() == DAOCATWallet.type():
111
- assert isinstance(w, DAOCATWallet)
112
- if w.get_asset_id() == limitations_program_hash_hex:
113
- self.log.warning("Not creating wallet for already existing DAO CAT wallet")
114
- return w
115
- elif w.type() == CATWallet.type():
116
- assert isinstance(w, CATWallet)
117
- if w.get_asset_id() == limitations_program_hash_hex:
118
- free_cat_wallet_id = w.id()
119
- assert free_cat_wallet_id is not None
120
- for id, w in wallet_state_manager.wallets.items():
121
- if w.type() == WalletType.DAO:
122
- self.log.info(f"FOUND DAO WALLET: {w}")
123
- self.log.info(f"ALL WALLETS: {wallet_state_manager.wallets}")
124
- if w.get_cat_wallet_id() == free_cat_wallet_id:
125
- dao_wallet_id = w.id()
126
- assert dao_wallet_id is not None
127
- self.wallet_state_manager = wallet_state_manager
128
- if name is None:
129
- name = CATWallet.default_wallet_name_for_unknown_cat(limitations_program_hash_hex)
130
-
131
- limitations_program_hash = bytes32.from_hexstr(limitations_program_hash_hex)
132
-
133
- self.dao_cat_info = DAOCATInfo(
134
- dao_wallet_id,
135
- uint64(free_cat_wallet_id),
136
- limitations_program_hash,
137
- None,
138
- [],
139
- )
140
- info_as_string = bytes(self.dao_cat_info).hex()
141
- self.wallet_info = await wallet_state_manager.user_store.create_wallet(name, WalletType.DAO_CAT, info_as_string)
142
-
143
- self.lineage_store = await CATLineageStore.create(self.wallet_state_manager.db_wrapper, self.get_asset_id())
144
- await self.wallet_state_manager.add_new_wallet(self)
145
- return self
146
-
147
- async def coin_added(self, coin: Coin, height: uint32, peer: WSChiaConnection, coin_data: Optional[Any]) -> None:
148
- """Notification from wallet state manager that wallet has been received."""
149
- self.log.info(f"DAO CAT wallet has been notified that {coin} was added")
150
- wallet_node: Any = self.wallet_state_manager.wallet_node
151
- parent_coin = (await wallet_node.get_coin_state([coin.parent_coin_info], peer, height))[0]
152
- parent_spend = await fetch_coin_spend(height, parent_coin.coin, peer)
153
- uncurried = parent_spend.puzzle_reveal.uncurry()
154
- cat_inner = uncurried[1].at("rrf")
155
- active_votes_list: list[Optional[bytes32]] = []
156
-
157
- record = await self.wallet_state_manager.puzzle_store.get_derivation_record_for_puzzle_hash(coin.puzzle_hash)
158
- if record:
159
- inner_puzzle: Optional[Program] = self.standard_wallet.puzzle_for_pk(record.pubkey)
160
- else:
161
- inner_puzzle = get_innerpuz_from_lockup_puzzle(cat_inner)
162
- assert isinstance(inner_puzzle, Program)
163
- active_votes_list_prg = get_active_votes_from_lockup_puzzle(cat_inner)
164
- active_votes_list = [bytes32(x.as_atom()) for x in active_votes_list_prg.as_iter()]
165
-
166
- if parent_spend.coin.puzzle_hash == coin.puzzle_hash:
167
- # shortcut, works for change
168
- lockup_puz = cat_inner
169
- else:
170
- solution = parent_spend.solution.to_program().first()
171
- if solution.first() == Program.to(0):
172
- # No vote is being added so inner puz stays the same
173
- try:
174
- removals = solution.at("rrrf")
175
- if removals != Program.to(0):
176
- for removal in removals.as_iter():
177
- active_votes_list.remove(bytes32(removal.as_atom()))
178
- except Exception:
179
- pass
180
- else:
181
- new_vote = solution.at("rrrf")
182
- active_votes_list.insert(0, bytes32(new_vote.as_atom()))
183
-
184
- lockup_puz = get_lockup_puzzle(
185
- self.dao_cat_info.limitations_program_hash,
186
- active_votes_list,
187
- inner_puzzle,
188
- )
189
-
190
- new_cat_puzhash = construct_cat_puzzle(
191
- CAT_MOD, self.dao_cat_info.limitations_program_hash, lockup_puz
192
- ).get_tree_hash()
193
-
194
- if new_cat_puzhash != coin.puzzle_hash: # pragma: no cover
195
- raise ValueError(f"Cannot add coin - incorrect lockup puzzle: {coin}")
196
-
197
- lineage_proof = LineageProof(coin.parent_coin_info, lockup_puz.get_tree_hash(), uint64(coin.amount))
198
- await self.add_lineage(coin.name(), lineage_proof)
199
-
200
- # add the new coin to the list of locked coins and remove the spent coin
201
- locked_coins = [x for x in self.dao_cat_info.locked_coins if x.coin != parent_spend.coin]
202
- new_info = LockedCoinInfo(coin, lockup_puz, active_votes_list)
203
- if new_info not in locked_coins:
204
- locked_coins.append(LockedCoinInfo(coin, lockup_puz, active_votes_list))
205
- dao_cat_info: DAOCATInfo = DAOCATInfo(
206
- self.dao_cat_info.dao_wallet_id,
207
- self.dao_cat_info.free_cat_wallet_id,
208
- self.dao_cat_info.limitations_program_hash,
209
- self.dao_cat_info.my_tail,
210
- locked_coins,
211
- )
212
- await self.save_info(dao_cat_info)
213
-
214
- async def add_lineage(self, name: bytes32, lineage: Optional[LineageProof]) -> None:
215
- """
216
- Lineage proofs are stored as a list of parent coins and the lineage proof you will need if they are the
217
- parent of the coin you are trying to spend. 'If I'm your parent, here's the info you need to spend yourself'
218
- """
219
- self.log.info(f"Adding parent {name.hex()}: {lineage}")
220
- if lineage is not None:
221
- await self.lineage_store.add_lineage_proof(name, lineage)
222
-
223
- async def get_lineage_proof_for_coin(self, coin: Coin) -> Optional[LineageProof]:
224
- return await self.lineage_store.get_lineage_proof(coin.parent_coin_info)
225
-
226
- async def remove_lineage(self, name: bytes32) -> None: # pragma: no cover
227
- self.log.info(f"Removing parent {name} (probably had a non-CAT parent)")
228
- await self.lineage_store.remove_lineage_proof(name)
229
-
230
- async def advanced_select_coins(self, amount: uint64, proposal_id: bytes32) -> list[LockedCoinInfo]:
231
- coins = []
232
- s = 0
233
- for coin in self.dao_cat_info.locked_coins:
234
- compatible = True
235
- for active_vote in coin.active_votes:
236
- if active_vote == proposal_id: # pragma: no cover
237
- compatible = False
238
- break
239
- if compatible:
240
- coins.append(coin)
241
- s += coin.coin.amount
242
- if s >= amount:
243
- break
244
- if s < amount: # pragma: no cover
245
- raise ValueError(
246
- "We do not have enough CATs in Voting Mode right now. "
247
- "Please convert some more or try again with permission to convert."
248
- )
249
- return coins
250
-
251
- def id(self) -> uint32:
252
- return self.wallet_info.id
253
-
254
- async def create_vote_spend(
255
- self,
256
- amount: uint64,
257
- proposal_id: bytes32,
258
- is_yes_vote: bool,
259
- proposal_puzzle: Optional[Program] = None,
260
- ) -> WalletSpendBundle:
261
- coins: list[LockedCoinInfo] = await self.advanced_select_coins(amount, proposal_id)
262
- running_sum = 0 # this will be used for change calculation
263
- change = sum(c.coin.amount for c in coins) - amount
264
- extra_delta, limitations_solution = 0, Program.to([])
265
- limitations_program_reveal = Program.to([])
266
- spendable_cat_list = []
267
- dao_wallet = self.wallet_state_manager.wallets[self.dao_cat_info.dao_wallet_id]
268
- if proposal_puzzle is None: # pragma: no cover
269
- proposal_puzzle = dao_wallet.get_proposal_puzzle(proposal_id)
270
- assert proposal_puzzle is not None
271
- for lci in coins:
272
- coin = lci.coin
273
- vote_info = 0
274
- new_innerpuzzle = add_proposal_to_active_list(lci.inner_puzzle, proposal_id)
275
- assert new_innerpuzzle is not None
276
- standard_inner_puz = get_innerpuz_from_lockup_puzzle(new_innerpuzzle)
277
- assert isinstance(standard_inner_puz, Program)
278
- # add_proposal_to_active_list also verifies that the lci.inner_puzzle is accurate
279
- # We must create either: one coin with the new puzzle and all our value
280
- # OR
281
- # a coin with the new puzzle and part of our amount AND a coin with our current puzzle and the change
282
- # We must also create a puzzle announcement which announces the following:
283
- # message = (sha256tree (list new_proposal_vote_id_or_removal_id vote_amount vote_info my_id))
284
- message = Program.to([proposal_id, amount, is_yes_vote, coin.name()]).get_tree_hash()
285
- vote_amounts_list = []
286
- voting_coin_id_list = []
287
- previous_votes_list = []
288
- lockup_innerpuz_list = []
289
- if running_sum + coin.amount <= amount:
290
- vote_amount = coin.amount
291
- running_sum += coin.amount
292
- primaries = [
293
- Payment(
294
- new_innerpuzzle.get_tree_hash(),
295
- vote_amount,
296
- [standard_inner_puz.get_tree_hash()],
297
- )
298
- ]
299
- message = Program.to([proposal_id, vote_amount, is_yes_vote, coin.name()]).get_tree_hash()
300
- inner_solution = self.standard_wallet.make_solution(
301
- primaries=primaries,
302
- conditions=(CreatePuzzleAnnouncement(message),),
303
- )
304
- else:
305
- vote_amount = uint64(amount - running_sum)
306
- running_sum += coin.amount
307
- primaries = [
308
- Payment(
309
- new_innerpuzzle.get_tree_hash(),
310
- vote_amount,
311
- [standard_inner_puz.get_tree_hash()],
312
- ),
313
- ]
314
- if change > 0:
315
- primaries.append(
316
- Payment(
317
- lci.inner_puzzle.get_tree_hash(),
318
- uint64(change),
319
- [lci.inner_puzzle.get_tree_hash()],
320
- )
321
- )
322
- message = Program.to([proposal_id, vote_amount, is_yes_vote, coin.name()]).get_tree_hash()
323
- inner_solution = self.standard_wallet.make_solution(
324
- primaries=primaries,
325
- conditions=(CreatePuzzleAnnouncement(message),),
326
- )
327
- if is_yes_vote:
328
- vote_info = 1
329
- vote_amounts_list.append(vote_amount)
330
- voting_coin_id_list.append(coin.name())
331
- previous_votes_list.append(get_active_votes_from_lockup_puzzle(lci.inner_puzzle))
332
- lockup_innerpuz_list.append(get_innerpuz_from_lockup_puzzle(lci.inner_puzzle))
333
- solution = Program.to(
334
- [
335
- coin.name(),
336
- inner_solution,
337
- coin.amount,
338
- proposal_id,
339
- proposal_puzzle.get_tree_hash(),
340
- vote_info,
341
- vote_amount,
342
- lci.inner_puzzle.get_tree_hash(),
343
- 0,
344
- ]
345
- )
346
- lineage_proof = await self.get_lineage_proof_for_coin(coin)
347
- assert lineage_proof is not None
348
- new_spendable_cat = SpendableCAT(
349
- coin,
350
- self.dao_cat_info.limitations_program_hash,
351
- lci.inner_puzzle,
352
- solution,
353
- limitations_solution=limitations_solution,
354
- extra_delta=extra_delta,
355
- lineage_proof=lineage_proof,
356
- limitations_program_reveal=limitations_program_reveal,
357
- )
358
- spendable_cat_list.append(new_spendable_cat)
359
-
360
- cat_spend_bundle = unsigned_spend_bundle_for_spendable_cats(CAT_MOD, spendable_cat_list)
361
- return cat_spend_bundle
362
-
363
- async def enter_dao_cat_voting_mode(
364
- self,
365
- amount: uint64,
366
- action_scope: WalletActionScope,
367
- fee: uint64 = uint64(0),
368
- extra_conditions: tuple[Condition, ...] = tuple(),
369
- ) -> list[TransactionRecord]:
370
- """
371
- Enter existing CATs for the DAO into voting mode
372
- """
373
- # check there are enough cats to convert
374
- cat_wallet = self.wallet_state_manager.wallets[self.dao_cat_info.free_cat_wallet_id]
375
- cat_balance = await cat_wallet.get_spendable_balance()
376
- if cat_balance < amount: # pragma: no cover
377
- raise ValueError(f"Insufficient CAT balance. Requested: {amount} Available: {cat_balance}")
378
- # get the lockup puzzle hash
379
- lockup_puzzle = await self.get_new_puzzle()
380
- # create the cat spend
381
- txs: list[TransactionRecord] = await cat_wallet.generate_signed_transaction(
382
- [amount],
383
- [lockup_puzzle.get_tree_hash()],
384
- action_scope,
385
- fee=fee,
386
- extra_conditions=extra_conditions,
387
- )
388
- cat_puzzle_hash: bytes32 = construct_cat_puzzle(
389
- CAT_MOD, self.dao_cat_info.limitations_program_hash, lockup_puzzle
390
- ).get_tree_hash()
391
- await self.wallet_state_manager.add_interested_puzzle_hashes([cat_puzzle_hash], [self.id()])
392
- return txs
393
-
394
- async def exit_vote_state(
395
- self,
396
- coins: list[LockedCoinInfo],
397
- action_scope: WalletActionScope,
398
- fee: uint64 = uint64(0),
399
- extra_conditions: tuple[Condition, ...] = tuple(),
400
- ) -> None:
401
- extra_delta, limitations_solution = 0, Program.to([])
402
- limitations_program_reveal = Program.to([])
403
- spendable_cat_list = []
404
- total_amt = 0
405
- spent_coins = []
406
- for lci in coins:
407
- coin = lci.coin
408
- if action_scope.config.tx_config.reuse_puzhash: # pragma: no cover
409
- new_inner_puzhash = await self.standard_wallet.get_puzzle_hash(new=False)
410
- else:
411
- new_inner_puzhash = await self.standard_wallet.get_puzzle_hash(new=True)
412
-
413
- # CREATE_COIN new_puzzle coin.amount
414
- primaries = [
415
- Payment(
416
- new_inner_puzhash,
417
- uint64(coin.amount),
418
- [new_inner_puzhash],
419
- ),
420
- ]
421
- total_amt += coin.amount
422
- inner_solution = self.standard_wallet.make_solution(
423
- primaries=primaries,
424
- )
425
- # Create the solution using only the values needed for exiting the lockup mode (my_id = 0)
426
- solution = Program.to(
427
- [
428
- 0, # my_id
429
- inner_solution,
430
- coin.amount,
431
- 0, # new_proposal_vote_id_or_removal_id
432
- 0, # proposal_innerpuzhash
433
- 0, # vote_info
434
- 0, # vote_amount
435
- 0, # my_inner_puzhash
436
- ]
437
- )
438
- lineage_proof = await self.get_lineage_proof_for_coin(coin)
439
- assert lineage_proof is not None
440
- new_spendable_cat = SpendableCAT(
441
- coin,
442
- self.dao_cat_info.limitations_program_hash,
443
- lci.inner_puzzle,
444
- solution,
445
- limitations_solution=limitations_solution,
446
- extra_delta=extra_delta,
447
- lineage_proof=lineage_proof,
448
- limitations_program_reveal=limitations_program_reveal,
449
- )
450
- spendable_cat_list.append(new_spendable_cat)
451
- spent_coins.append(coin)
452
-
453
- spend_bundle = unsigned_spend_bundle_for_spendable_cats(CAT_MOD, spendable_cat_list)
454
-
455
- if fee > 0: # pragma: no cover
456
- await self.standard_wallet.create_tandem_xch_tx(
457
- fee,
458
- action_scope,
459
- )
460
-
461
- record = TransactionRecord(
462
- confirmed_at_height=uint32(0),
463
- created_at_time=uint64(int(time.time())),
464
- to_puzzle_hash=new_inner_puzhash,
465
- amount=uint64(total_amt),
466
- fee_amount=fee,
467
- confirmed=False,
468
- sent=uint32(10),
469
- spend_bundle=spend_bundle,
470
- additions=spend_bundle.additions(),
471
- removals=spend_bundle.removals(),
472
- wallet_id=self.id(),
473
- sent_to=[],
474
- trade_id=None,
475
- type=uint32(TransactionType.INCOMING_TX.value),
476
- name=spend_bundle.name(),
477
- memos=[],
478
- valid_times=parse_timelock_info(extra_conditions),
479
- )
480
-
481
- # TODO: Hack to just drop coins from locked list. Need to catch this event in WSM to
482
- # check if we're adding CATs from our DAO CAT wallet and update the locked coin list
483
- # accordingly
484
- new_locked_coins = [x for x in self.dao_cat_info.locked_coins if x.coin not in spent_coins]
485
- dao_cat_info: DAOCATInfo = DAOCATInfo(
486
- self.dao_cat_info.dao_wallet_id,
487
- self.dao_cat_info.free_cat_wallet_id,
488
- self.dao_cat_info.limitations_program_hash,
489
- self.dao_cat_info.my_tail,
490
- new_locked_coins,
491
- )
492
- await self.save_info(dao_cat_info)
493
- async with action_scope.use() as interface:
494
- interface.side_effects.transactions.append(record)
495
-
496
- async def remove_active_proposal(
497
- self,
498
- proposal_id_list: list[bytes32],
499
- action_scope: WalletActionScope,
500
- fee: uint64 = uint64(0),
501
- ) -> WalletSpendBundle:
502
- locked_coins: list[tuple[LockedCoinInfo, list[bytes32]]] = []
503
- for lci in self.dao_cat_info.locked_coins:
504
- my_finished_proposals = []
505
- for active_vote in lci.active_votes:
506
- if active_vote in proposal_id_list:
507
- my_finished_proposals.append(active_vote)
508
- if my_finished_proposals:
509
- locked_coins.append((lci, my_finished_proposals))
510
- extra_delta, limitations_solution = 0, Program.to([])
511
- limitations_program_reveal = Program.to([])
512
- spendable_cat_list = []
513
-
514
- for lci_proposals_tuple in locked_coins:
515
- proposal_innerpuzhashes = []
516
- coin = lci_proposals_tuple[0].coin
517
- lci = lci_proposals_tuple[0]
518
- proposals = lci_proposals_tuple[1]
519
- for proposal_id in proposals:
520
- INNERPUZ = get_finished_state_inner_puzzle(proposal_id)
521
- proposal_innerpuzhashes.append(INNERPUZ)
522
- # new_innerpuzzle = await cat_wallet.get_new_inner_puzzle()
523
- # my_id ; if my_id is 0 we do the return to return_address (exit voting mode) spend case
524
- # inner_solution
525
- # my_amount
526
- # new_proposal_vote_id_or_removal_id ; if we're exiting fully, set this to 0
527
- # proposal_curry_vals
528
- # vote_info
529
- # vote_amount
530
- # my_puzhash
531
- solution = Program.to(
532
- [
533
- 0,
534
- 0,
535
- coin.amount,
536
- proposals,
537
- 0,
538
- 0,
539
- 0,
540
- 0,
541
- 0,
542
- ]
543
- )
544
- lineage_proof = await self.get_lineage_proof_for_coin(coin)
545
- assert lineage_proof is not None
546
- new_spendable_cat = SpendableCAT(
547
- coin,
548
- self.dao_cat_info.limitations_program_hash,
549
- lci.inner_puzzle,
550
- solution,
551
- limitations_solution=limitations_solution,
552
- extra_delta=extra_delta,
553
- lineage_proof=lineage_proof,
554
- limitations_program_reveal=limitations_program_reveal,
555
- )
556
- spendable_cat_list.append(new_spendable_cat)
557
-
558
- spend_bundle = unsigned_spend_bundle_for_spendable_cats(CAT_MOD, spendable_cat_list)
559
-
560
- if fee > 0: # pragma: no cover
561
- await self.standard_wallet.create_tandem_xch_tx(fee, action_scope=action_scope)
562
-
563
- return spend_bundle
564
-
565
- def get_asset_id(self) -> str:
566
- return bytes(self.dao_cat_info.limitations_program_hash).hex()
567
-
568
- async def get_new_inner_hash(self, tx_config: TXConfig) -> bytes32:
569
- puzzle = await self.get_new_inner_puzzle(tx_config)
570
- return puzzle.get_tree_hash()
571
-
572
- async def get_new_inner_puzzle(self, tx_config: TXConfig) -> Program:
573
- return await self.standard_wallet.get_puzzle(new=not tx_config.reuse_puzhash)
574
-
575
- async def get_new_puzzle(self) -> Program:
576
- record = await self.wallet_state_manager.get_unused_derivation_record(self.id())
577
- inner_puzzle = self.standard_wallet.puzzle_for_pk(record.pubkey)
578
- puzzle = get_lockup_puzzle(
579
- self.dao_cat_info.limitations_program_hash,
580
- [],
581
- inner_puzzle,
582
- )
583
- cat_puzzle: Program = construct_cat_puzzle(CAT_MOD, self.dao_cat_info.limitations_program_hash, puzzle)
584
- await self.wallet_state_manager.add_interested_puzzle_hashes([puzzle.get_tree_hash()], [self.id()])
585
- await self.wallet_state_manager.add_interested_puzzle_hashes([cat_puzzle.get_tree_hash()], [self.id()])
586
- return puzzle
587
-
588
- async def get_new_puzzlehash(self) -> bytes32:
589
- puzzle = await self.get_new_puzzle()
590
- return puzzle.get_tree_hash()
591
-
592
- def puzzle_for_pk(self, pubkey: G1Element) -> Program:
593
- inner_puzzle = self.standard_wallet.puzzle_for_pk(pubkey)
594
- puzzle = get_lockup_puzzle(
595
- self.dao_cat_info.limitations_program_hash,
596
- [],
597
- inner_puzzle,
598
- )
599
- cat_puzzle: Program = construct_cat_puzzle(CAT_MOD, self.dao_cat_info.limitations_program_hash, puzzle)
600
- return cat_puzzle
601
-
602
- def puzzle_hash_for_pk(self, pubkey: G1Element) -> bytes32:
603
- puzzle = self.puzzle_for_pk(pubkey)
604
- return puzzle.get_tree_hash()
605
-
606
- def require_derivation_paths(self) -> bool:
607
- return True
608
-
609
- async def match_hinted_coin(self, coin: Coin, hint: bytes32) -> bool:
610
- raise NotImplementedError("Method not implemented for DAO CAT Wallet") # pragma: no cover
611
-
612
- async def get_spendable_balance(self, records: Optional[set[WalletCoinRecord]] = None) -> uint128:
613
- return uint128(0)
614
-
615
- async def get_confirmed_balance(self, record_list: Optional[set[WalletCoinRecord]] = None) -> uint128:
616
- amount = 0
617
- for coin in self.dao_cat_info.locked_coins:
618
- amount += coin.coin.amount
619
- return uint128(amount)
620
-
621
- async def get_unconfirmed_balance(self, unspent_records: Optional[set[WalletCoinRecord]] = None) -> uint128:
622
- return uint128(0)
623
-
624
- async def get_pending_change_balance(self) -> uint64:
625
- return uint64(0)
626
-
627
- async def select_coins(
628
- self,
629
- amount: uint64,
630
- action_scope: WalletActionScope,
631
- ) -> set[Coin]:
632
- return set()
633
-
634
- async def get_max_send_amount(self, unspent_records: Optional[set[WalletCoinRecord]] = None) -> uint128:
635
- return uint128(0)
636
-
637
- async def get_votable_balance(
638
- self,
639
- proposal_id: Optional[bytes32] = None,
640
- include_free_cats: bool = True,
641
- ) -> uint64:
642
- balance = 0
643
- for coin in self.dao_cat_info.locked_coins:
644
- if proposal_id is not None:
645
- compatible = True
646
- for active_vote in coin.active_votes:
647
- if active_vote == proposal_id:
648
- compatible = False
649
- break
650
- if compatible:
651
- balance += coin.coin.amount
652
- else:
653
- balance += coin.coin.amount
654
- if include_free_cats:
655
- cat_wallet = self.wallet_state_manager.wallets[self.dao_cat_info.free_cat_wallet_id]
656
- cat_balance = await cat_wallet.get_spendable_balance()
657
- balance += cat_balance
658
- return uint64(balance)
659
-
660
- async def save_info(self, dao_cat_info: DAOCATInfo) -> None:
661
- self.dao_cat_info = dao_cat_info
662
- current_info = self.wallet_info
663
- data_str = bytes(dao_cat_info).hex()
664
- wallet_info = WalletInfo(current_info.id, current_info.name, current_info.type, data_str)
665
- self.wallet_info = wallet_info
666
- await self.wallet_state_manager.user_store.update_wallet(wallet_info)
667
-
668
- def get_name(self) -> str:
669
- return self.wallet_info.name
File without changes