Page MenuHomePhabricator

wallet: Avoid translating RPC errors when loading wallets
ClosedPublic

Authored by deadalnix on Oct 1 2020, 12:26.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCcfbeff3426c9: wallet: Avoid translating RPC errors when loading wallets
Summary

Common errors and warnings should be translated when displayed in the
GUI, but not translated when displayed elsewhere. The wallet method
CreateWalletFromFile does not know its caller, so this commit changes it
to return a bilingual_str to the caller.

This is a partial backport of Core PR18699 : https://github.com/bitcoin/bitcoin/pull/18699/commits/fae51a5c6f4270a1088e6295b10a8cc45988ae46

Depends on D7699

Test Plan
ninja all check-all

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

Snippet of first build failure:

[297/482] Building CXX object src/CMakeFiles/script.dir/script/sigencoding.cpp.o
[298/482] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/arith_uint256.cpp.o
[299/482] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/hash.cpp.o
[300/482] Building CXX object src/CMakeFiles/script.dir/script/standard.cpp.o
[301/482] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/primitives/transaction.cpp.o
[302/482] Building CXX object src/CMakeFiles/script.dir/script/sign.cpp.o
[303/482] Building CXX object src/CMakeFiles/script.dir/script/descriptor.cpp.o
[304/482] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/uint256.cpp.o
[305/482] Building CXX object src/CMakeFiles/script.dir/script/signingprovider.cpp.o
[306/482] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/util/strencodings.cpp.o
[307/482] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/pubkey.cpp.o
[308/482] Building C object src/secp256k1/CMakeFiles/sign-bench.dir/src/bench_sign.c.o
[309/482] Building C object src/secp256k1/CMakeFiles/verify-bench.dir/src/bench_verify.c.o
[310/482] Building CXX object src/CMakeFiles/common.dir/warnings.cpp.o
[311/482] Building C object src/secp256k1/CMakeFiles/recover-bench.dir/src/bench_recover.c.o
[312/482] Building C object src/secp256k1/CMakeFiles/ecmult-bench.dir/src/bench_ecmult.c.o
[313/482] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/consensus/tx_check.cpp.o
[314/482] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[315/482] Building CXX object src/CMakeFiles/server.dir/txdb.cpp.o
[316/482] Building C object src/secp256k1/CMakeFiles/secp256k1.dir/src/secp256k1.c.o
[317/482] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[318/482] Linking C static library src/secp256k1/libsecp256k1.a
[319/482] Linking C executable src/secp256k1/ecmult-bench
[320/482] Linking C executable src/secp256k1/internal-bench
[321/482] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[322/482] Linking C executable src/secp256k1/sign-bench
[323/482] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[324/482] Linking C executable src/secp256k1/verify-bench
[325/482] Linking C executable src/secp256k1/recover-bench
[326/482] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[327/482] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[328/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[329/482] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[330/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[331/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[332/482] Building CXX object src/CMakeFiles/server.dir/init.cpp.o
[333/482] Building CXX object src/CMakeFiles/bitcoin-cli.dir/bitcoin-cli.cpp.o
[334/482] Building CXX object src/CMakeFiles/bitcoin-wallet.dir/bitcoin-wallet.cpp.o
[335/482] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[336/482] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[337/482] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[338/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/psbtwallet.cpp.o
[339/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[340/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[341/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[342/482] Building CXX object src/seeder/CMakeFiles/seeder.dir/dns.cpp.o
[343/482] Building CXX object src/seeder/CMakeFiles/seeder.dir/bitcoin.cpp.o
[344/482] Building CXX object src/seeder/CMakeFiles/seeder.dir/db.cpp.o
[345/482] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[346/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[347/482] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[348/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/__/interfaces/wallet.cpp.o
[349/482] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[350/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[351/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[352/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcdump.cpp.o
[353/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[354/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1
Fabien added a subscriber: Fabien.

Note for the future backports: this PR has some non functional dependencies that will need care when backporting:

  • PR15761
  • PR16923
  • PR18727
src/wallet/wallet.cpp
4069 ↗(On Diff #24108)

Layout

This revision is now accepted and ready to land.Oct 1 2020, 13:04