extract/rename helper functions from rpc_packages.py
Summary:
MOVEONLY; no change in behavior. Rename because there is another helper
function in chain_transaction in test_framework.util.py
This is a backport of core#21800 [6/9]
https://github.com/bitcoin/bitcoin/pull/21800/commits/f8253d69d6f02850995a11eeb71fedc22e6f6575
Notes:
- Commit backported out of order (refactorings first)
- due to missing backports, we don't have the tx_from_hex helper function
Test Plan: ninja check-functional
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D12155