test: add unit tests for wallet interface getter basic method #34311

pull b-l-u-e wants to merge 1 commits into bitcoin:master from b-l-u-e:test-wallet-interfaces-getter-coverage changing 1 files +31 −0
  1. b-l-u-e commented at 5:30 pm on January 15, 2026: contributor

    This PR adds a unit test for basic wallet interface getter methods in src/wallet/interfaces.cpp test verifies that WalletImpl correctly returns wallet properties and configuration values.

    Added test case wallet_interface_getters_basic in src/wallet/test/wallet_tests.cpp that tests the following methods:

    1. getWalletName()
    2. isCrypted()
    3. isLocked()
    4. getDefaultAddressType()
    5. getDefaultMaxTxFee()
    6. getConfirmTarget()

    getter methods are untested. regressions in these methods could go undetected. The test catches the following types of bugs:

    0./bin/test_bitcoin --run_test=wallet_tests/wallet_interface_getters_basic
    1Running 1 test case...
    2./wallet/test/wallet_tests.cpp(745): error: in "wallet_tests/wallet_interface_getters_basic": check wallet_name == "test_wallet" has failed [default != test_wallet]
    3./wallet/test/wallet_tests.cpp(747): error: in "wallet_tests/wallet_interface_getters_basic": check wallet_interface->isCrypted() == false has failed [true != false]
    4./wallet/test/wallet_tests.cpp(749): error: in "wallet_tests/wallet_interface_getters_basic": check wallet_interface->isLocked() == false has failed [true != false]
    5./wallet/test/wallet_tests.cpp(752): error: in "wallet_tests/wallet_interface_getters_basic": check default_type == OutputType::BECH32 || default_type == OutputType::LEGACY || default_type == OutputType::P2SH_SEGWIT || default_type == OutputType::BECH32M has failed
    6./wallet/test/wallet_tests.cpp(756): error: in "wallet_tests/wallet_interface_getters_basic": check max_fee > 0 has failed
    7./wallet/test/wallet_tests.cpp(759): error: in "wallet_tests/wallet_interface_getters_basic": check confirm_target > 0 has failed
    8
    9*** 6 failures are detected in the test module "Bitcoin Core Test Suite"
    
  2. test: add unit tests for wallet interface getter basic method 3b66d67c81
  3. DrahtBot added the label Tests on Jan 15, 2026
  4. DrahtBot commented at 5:30 pm on January 15, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34311.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  5. maflcko commented at 8:43 pm on January 15, 2026: member

    getter methods are untested

    Not sure about those verbose smoke tests for raw forward-only interface methods. It is hard to imagine a failure there. And most theoretic failures wouldn’t be caught by those smoke tests anyway.

    The methods are currently only used in the gui, so it could make more sense to instead add gui test. However, the state of the gui is currently unclear? C.f. #34211 (comment)

    I understand that the wallet interface could also be used by the rpc code, so another alternative could be to just call them in rpc code to add coverage. However, I haven’t looked if this makes sense in the large picture.

  6. b-l-u-e marked this as a draft on Jan 16, 2026
  7. maflcko commented at 6:48 pm on January 27, 2026: member
    Can this be closed?
  8. b-l-u-e commented at 1:38 am on January 28, 2026: contributor

    Can this be closed?

    Yes will close and maybe will be reopened in the future

  9. b-l-u-e closed this on Jan 28, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-02-02 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me