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

Improve wallet-accounts test #11552

Merged
merged 1 commit into from Nov 9, 2017
Merged

Improve wallet-accounts test #11552

merged 1 commit into from Nov 9, 2017

Conversation

ryanofsky
Copy link
Contributor

Add comments and

  • Verify sending to a account causes getaccountaddress to generate new addresses.
  • Verify sending to a account causes getreceivedbyaccount to return amount received.
  • Verify ways setaccount updates the accounts of existing addresses.

Add comments and

- Verify sending to a account causes getaccountaddress to generate new addresses.
- Verify sending to a account causes getreceivedbyaccount to return amount received.
- Verify ways setaccount updates the accounts of existing addresses.
@fanquake fanquake added the Tests label Oct 24, 2017
Copy link
Member

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth since accounts is deprecated?


def verify(self, node):
if self.receive_address is not None:
assert self.receive_address in self.addresses
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assert to detect if receive_address is incorrecly changed?

# address.
if address == old_account.receive_address:
new_address = node.getaccountaddress(old_account.name)
assert_equal(new_address not in old_account.addresses, True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert ... not in ...;?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert ... not in ...;?

Assert statements are skipped when python is run in optimized mode. I only use assert statements in tests when asserting conditions that indicate bugs in test setup, as opposed to conditions that could be caused by bugs in the code under test. (If you're familiar with google test framework, this is the distinction between CHECK and ASSERT_TRUE).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation, wasn't aware of this.

@ryanofsky
Copy link
Contributor Author

Is it worth since accounts is deprecated?

Yes, all of the new tests apply to both accounts and labels. The new tests helped me identify two bugs in #7729.

@laanwj
Copy link
Member

laanwj commented Nov 9, 2017

utACK bc9c0a7

@laanwj laanwj merged commit bc9c0a7 into bitcoin:master Nov 9, 2017
laanwj added a commit that referenced this pull request Nov 9, 2017
bc9c0a7 Improve wallet-accounts test (Russell Yanofsky)

Pull request description:

  Add comments and

  - Verify sending to a account causes getaccountaddress to generate new addresses.
  - Verify sending to a account causes getreceivedbyaccount to return amount received.
  - Verify ways setaccount updates the accounts of existing addresses.

Tree-SHA512: 4facc8d10fb23847081e8081839d4050faa855cca40f34012b82297bf1a8cfdb975b26314bc518dc6b3f5997452a7acf309f9627e0dff359347c628b37014bfa
@maflcko
Copy link
Member

maflcko commented Nov 9, 2017

post merge utACK bc9c0a7

PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Dec 22, 2019
bc9c0a7 Improve wallet-accounts test (Russell Yanofsky)

Pull request description:

  Add comments and

  - Verify sending to a account causes getaccountaddress to generate new addresses.
  - Verify sending to a account causes getreceivedbyaccount to return amount received.
  - Verify ways setaccount updates the accounts of existing addresses.

Tree-SHA512: 4facc8d10fb23847081e8081839d4050faa855cca40f34012b82297bf1a8cfdb975b26314bc518dc6b3f5997452a7acf309f9627e0dff359347c628b37014bfa
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 2, 2020
bc9c0a7 Improve wallet-accounts test (Russell Yanofsky)

Pull request description:

  Add comments and

  - Verify sending to a account causes getaccountaddress to generate new addresses.
  - Verify sending to a account causes getreceivedbyaccount to return amount received.
  - Verify ways setaccount updates the accounts of existing addresses.

Tree-SHA512: 4facc8d10fb23847081e8081839d4050faa855cca40f34012b82297bf1a8cfdb975b26314bc518dc6b3f5997452a7acf309f9627e0dff359347c628b37014bfa
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 4, 2020
bc9c0a7 Improve wallet-accounts test (Russell Yanofsky)

Pull request description:

  Add comments and

  - Verify sending to a account causes getaccountaddress to generate new addresses.
  - Verify sending to a account causes getreceivedbyaccount to return amount received.
  - Verify ways setaccount updates the accounts of existing addresses.

Tree-SHA512: 4facc8d10fb23847081e8081839d4050faa855cca40f34012b82297bf1a8cfdb975b26314bc518dc6b3f5997452a7acf309f9627e0dff359347c628b37014bfa
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 12, 2020
bc9c0a7 Improve wallet-accounts test (Russell Yanofsky)

Pull request description:

  Add comments and

  - Verify sending to a account causes getaccountaddress to generate new addresses.
  - Verify sending to a account causes getreceivedbyaccount to return amount received.
  - Verify ways setaccount updates the accounts of existing addresses.

Tree-SHA512: 4facc8d10fb23847081e8081839d4050faa855cca40f34012b82297bf1a8cfdb975b26314bc518dc6b3f5997452a7acf309f9627e0dff359347c628b37014bfa
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 12, 2020
bc9c0a7 Improve wallet-accounts test (Russell Yanofsky)

Pull request description:

  Add comments and

  - Verify sending to a account causes getaccountaddress to generate new addresses.
  - Verify sending to a account causes getreceivedbyaccount to return amount received.
  - Verify ways setaccount updates the accounts of existing addresses.

Tree-SHA512: 4facc8d10fb23847081e8081839d4050faa855cca40f34012b82297bf1a8cfdb975b26314bc518dc6b3f5997452a7acf309f9627e0dff359347c628b37014bfa
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 12, 2020
bc9c0a7 Improve wallet-accounts test (Russell Yanofsky)

Pull request description:

  Add comments and

  - Verify sending to a account causes getaccountaddress to generate new addresses.
  - Verify sending to a account causes getreceivedbyaccount to return amount received.
  - Verify ways setaccount updates the accounts of existing addresses.

Tree-SHA512: 4facc8d10fb23847081e8081839d4050faa855cca40f34012b82297bf1a8cfdb975b26314bc518dc6b3f5997452a7acf309f9627e0dff359347c628b37014bfa
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 12, 2020
bc9c0a7 Improve wallet-accounts test (Russell Yanofsky)

Pull request description:

  Add comments and

  - Verify sending to a account causes getaccountaddress to generate new addresses.
  - Verify sending to a account causes getreceivedbyaccount to return amount received.
  - Verify ways setaccount updates the accounts of existing addresses.

Tree-SHA512: 4facc8d10fb23847081e8081839d4050faa855cca40f34012b82297bf1a8cfdb975b26314bc518dc6b3f5997452a7acf309f9627e0dff359347c628b37014bfa
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 12, 2020
bc9c0a7 Improve wallet-accounts test (Russell Yanofsky)

Pull request description:

  Add comments and

  - Verify sending to a account causes getaccountaddress to generate new addresses.
  - Verify sending to a account causes getreceivedbyaccount to return amount received.
  - Verify ways setaccount updates the accounts of existing addresses.

Tree-SHA512: 4facc8d10fb23847081e8081839d4050faa855cca40f34012b82297bf1a8cfdb975b26314bc518dc6b3f5997452a7acf309f9627e0dff359347c628b37014bfa
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 12, 2020
bc9c0a7 Improve wallet-accounts test (Russell Yanofsky)

Pull request description:

  Add comments and

  - Verify sending to a account causes getaccountaddress to generate new addresses.
  - Verify sending to a account causes getreceivedbyaccount to return amount received.
  - Verify ways setaccount updates the accounts of existing addresses.

Tree-SHA512: 4facc8d10fb23847081e8081839d4050faa855cca40f34012b82297bf1a8cfdb975b26314bc518dc6b3f5997452a7acf309f9627e0dff359347c628b37014bfa
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 16, 2020
bc9c0a7 Improve wallet-accounts test (Russell Yanofsky)

Pull request description:

  Add comments and

  - Verify sending to a account causes getaccountaddress to generate new addresses.
  - Verify sending to a account causes getreceivedbyaccount to return amount received.
  - Verify ways setaccount updates the accounts of existing addresses.

Tree-SHA512: 4facc8d10fb23847081e8081839d4050faa855cca40f34012b82297bf1a8cfdb975b26314bc518dc6b3f5997452a7acf309f9627e0dff359347c628b37014bfa
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 22, 2020
bc9c0a7 Improve wallet-accounts test (Russell Yanofsky)

Pull request description:

  Add comments and

  - Verify sending to a account causes getaccountaddress to generate new addresses.
  - Verify sending to a account causes getreceivedbyaccount to return amount received.
  - Verify ways setaccount updates the accounts of existing addresses.

Tree-SHA512: 4facc8d10fb23847081e8081839d4050faa855cca40f34012b82297bf1a8cfdb975b26314bc518dc6b3f5997452a7acf309f9627e0dff359347c628b37014bfa
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 29, 2020
bc9c0a7 Improve wallet-accounts test (Russell Yanofsky)

Pull request description:

  Add comments and

  - Verify sending to a account causes getaccountaddress to generate new addresses.
  - Verify sending to a account causes getreceivedbyaccount to return amount received.
  - Verify ways setaccount updates the accounts of existing addresses.

Tree-SHA512: 4facc8d10fb23847081e8081839d4050faa855cca40f34012b82297bf1a8cfdb975b26314bc518dc6b3f5997452a7acf309f9627e0dff359347c628b37014bfa
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 29, 2020
bc9c0a7 Improve wallet-accounts test (Russell Yanofsky)

Pull request description:

  Add comments and

  - Verify sending to a account causes getaccountaddress to generate new addresses.
  - Verify sending to a account causes getreceivedbyaccount to return amount received.
  - Verify ways setaccount updates the accounts of existing addresses.

Tree-SHA512: 4facc8d10fb23847081e8081839d4050faa855cca40f34012b82297bf1a8cfdb975b26314bc518dc6b3f5997452a7acf309f9627e0dff359347c628b37014bfa
@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
Development

Successfully merging this pull request may close these issues.

None yet

5 participants