Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qa: Add wallet_encryption error tests #14813

Merged
merged 1 commit into from Nov 27, 2018

Conversation

@MarcoFalke
Copy link
Member

@MarcoFalke MarcoFalke commented Nov 26, 2018

The errors for empty passphrases are the help text of the RPC call, which is not very specific. Replace that with proper RPC errors and test them.

Copy link
Member

@jamesob jamesob left a comment

utACK fa739d4

Nice changeset. Seems like a less confusing user experience, good code cleanup, and adds test coverage.

@MarcoFalke MarcoFalke added this to the 0.18.0 milestone Nov 26, 2018
@DrahtBot
Copy link
Contributor

@DrahtBot DrahtBot commented Nov 26, 2018

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #14796 (rpc: Pass argument descriptions to RPCHelpMan by MarcoFalke)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

Copy link
Member

@promag promag left a comment

Tested ACK fa739d4.

if (!pwallet->Unlock(strWalletPass)) {
throw JSONRPCError(RPC_WALLET_PASSPHRASE_INCORRECT, "Error: The wallet passphrase entered was incorrect.");
}
if (strWalletPass.empty()) {
Copy link
Member

@promag promag Nov 27, 2018

I guess we shouldn't trim?

@meshcollider
Copy link
Member

@meshcollider meshcollider commented Nov 27, 2018

utACK fa739d4

@MarcoFalke MarcoFalke merged commit fa739d4 into bitcoin:master Nov 27, 2018
2 checks passed
MarcoFalke added a commit that referenced this issue Nov 27, 2018
fa739d4 qa: Add wallet_encryption error tests (MarcoFalke)

Pull request description:

  The errors for empty passphrases are the help text of the RPC call, which is not very specific. Replace that with proper RPC errors and test them.

Tree-SHA512: 3137e0f8f2e42a1f8ab1eeb57c99052557725f6f85139ff48c24acc8f3cf4087802de5216f3ce97375b291d21bddb7cd1379a6f280166136a306a0c9663bbd42
@MarcoFalke MarcoFalke deleted the Mf1811-qaWalletEncTest branch Nov 27, 2018
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this issue Mar 26, 2020
Summary:
fa739d4bd7 qa: Add wallet_encryption error tests (MarcoFalke)

Pull request description:

  The errors for empty passphrases are the help text of the RPC call, which is not very specific. Replace that with proper RPC errors and test them.

Tree-SHA512: 3137e0f8f2e42a1f8ab1eeb57c99052557725f6f85139ff48c24acc8f3cf4087802de5216f3ce97375b291d21bddb7cd1379a6f280166136a306a0c9663bbd42

Backport of Core [[bitcoin/bitcoin#14813 | PR14813]]

Test Plan:
  ninja
  test_runner.py wallet_encryption

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5582
ftrader added a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this issue Dec 1, 2020
qa: Add wallet_encryption error tests

See merge request bitcoin-cash-node/bitcoin-cash-node!865

Port of [PR14813](bitcoin/bitcoin#14813)

> The errors for empty passphrases are the help text of the RPC call, which is not very specific. Replace that with proper RPC errors and test them.

Backport by Dagur <dagurval@pvv.ntnu.no>

## Test plan

RPC test improved. Run `ninja check-functional`.
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants