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
Improve wallet-accounts test #11552
Conversation
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert ... not in ...;
?
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
Yes, all of the new tests apply to both accounts and labels. The new tests helped me identify two bugs in #7729. |
utACK bc9c0a7 |
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
post merge utACK bc9c0a7 |
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
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
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
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
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
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
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
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
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
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
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
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
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
Add comments and