Merge bitcoin/bitcoin#32721: wallet, rpc: Remove deprecated balances from getwalletinfo and getunconfirmedbalance

c3fe85e2d6 wallet, rpc, test: Remove deprecated getunconfirmedbalance (Ava Chow)
0ec255139b wallet, rpc: Remove deprecated balances from getwalletinfo (Ava Chow)

Pull request description:

  `getwalletinfo` result fields `balance`, `immature_balance`, and `unconfirmed_balance`, and the `getunconfirmedbalance` RPC have all been deprecated since 0.19.0. It's been long enough that they should either be removed or undeprecated. The functionality provided by these RPCs is provided by `getbalances`.

ACKs for top commit:
  davidgumberg:
    ACK https://github.com/bitcoin/bitcoin/commit/c3fe85e2d6dd4f251a62a99fd891b0fa370f9712
  rkrux:
    ACK c3fe85e2d6
  BrandonOdiwuor:
    ACK c3fe85e2d6 removing the deprecated `balance, unconfirmed_balance, immature_balance` fields from `getwalletinfo` and `getunconfirmedbalance` RPCs, as this infomation can be found on the `getbalances` RPC
  w0xlt:
    reACK https://github.com/bitcoin/bitcoin/pull/32721/commits/c3fe85e2d6dd4f251a62a99fd891b0fa370f9712

Tree-SHA512: c7c4acfd9cabc7517ba813b95281a6c6a717a417312afd9346298669b4f7bd37724ad977148ce42db7fd47fc3d1f5a8482d8ff2e7b9cb74756b171a5b8b91ef2
This commit is contained in:
merge-script committed 2025-06-25 16:43:09 -04:00
commit f27898c8bf
6 files changed
+10 -50

No files matched your search

+2 -3
View File
@@ -203,8 +203,7 @@ class MultiWalletTest(BitcoinTestFramework):
self.nodes[0].loadwallet("w5")
assert_equal(set(node.listwallets()), {"w4", "w5"})
w5 = wallet("w5")
w5_info = w5.getwalletinfo()
assert_equal(w5_info['immature_balance'], 50)
assert_equal(w5.getbalances()["mine"]["immature"], 50)
competing_wallet_dir = os.path.join(self.options.tmpdir, 'competing_walletdir')
os.mkdir(competing_wallet_dir)
@@ -226,7 +225,7 @@ class MultiWalletTest(BitcoinTestFramework):
self.generatetoaddress(node, nblocks=1, address=wallets[0].getnewaddress(), sync_fun=self.no_op)
for wallet_name, wallet in zip(wallet_names, wallets):
info = wallet.getwalletinfo()
assert_equal(info['immature_balance'], 50 if wallet is wallets[0] else 0)
assert_equal(wallet.getbalances()["mine"]["immature"], 50 if wallet is wallets[0] else 0)
assert_equal(info['walletname'], wallet_name)
# accessing invalid wallet fails