Extract RPC push logic into `@tx_endpoint` wrapper
Recreation of #16859 @ main (includes also #16865 which has already been cherry-picked to main)
This change takes the responsibility for pushing transactions off of the individual RPC implementations and extracts it to the @tx_endpoint wrapper which reads from the "transactions" key of the response to push the transactions to the wallet automatically if requested by the RPC caller.
Repeating what the initial PR said, the main part of this change is easier to review if you hide whitespace.
Pull Request Test Coverage Report for Build 7991697913
Warning: This coverage report may be inaccurate.
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
- For more information on this, see Tracking coverage changes with pull request builds.
- To avoid this issue with future PRs, see these Recommended CI Configurations.
- For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
Details
- -5 of 76 (93.42%) changed or added relevant lines in 2 files are covered.
- 100 unchanged lines in 31 files lost coverage.
- Overall coverage increased (+1.9%) to 90.947%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| chia/rpc/util.py | 56 | 57 | 98.25% |
| chia/rpc/wallet_rpc_api.py | 15 | 19 | 78.95% |
| <!-- | Total: | 71 | 76 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| chia/daemon/client.py | 1 | 84.38% |
| chia/daemon/keychain_proxy.py | 1 | 64.98% |
| chia/data_layer/download_data.py | 1 | 71.04% |
| chia/farmer/farmer.py | 1 | 72.67% |
| chia/full_node/mempool_manager.py | 1 | 95.0% |
| chia/util/json_util.py | 1 | 88.46% |
| chia/wallet/util/wallet_sync_utils.py | 1 | 86.6% |
| tests/core/util/test_file_keyring_synchronization.py | 1 | 97.1% |
| tests/fee_estimation/test_fee_estimation_unit_tests.py | 1 | 99.06% |
| tests/simulation/test_simulation.py | 1 | 96.52% |
| <!-- | Total: | 100 |
| Totals | |
|---|---|
| Change from base Build 7989510719: | 1.9% |
| Covered Lines: | 96963 |
| Relevant Lines: | 106583 |
💛 - Coveralls
This PR is awaiting someone to review the coverage diff, and if we approve of the diff, remove the coverage diff label to note that.
| File | Coverage | Missing Lines |
|---|---|---|
chia/rpc/util.py |
98.2% | lines 94 |
| Total | Missing | Coverage |
|---|---|---|
| 98 lines | Unknown | 98% |
coverage diff was due to an indentation change of an already uncovered line, aok