Improve wallet-accounts test #11552

pull ryanofsky wants to merge 1 commits into bitcoin:master from ryanofsky:pr/acctt changing 1 files +105 −32
  1. ryanofsky commented at 12:19 PM on October 24, 2017: member

    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.
  2. Improve wallet-accounts test
    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.
    bc9c0a7b74
  3. in test/functional/wallet-accounts.py:174 in bc9c0a7b74
     201 | +        self.add_address(address)
     202 | +        self.receive_address = address
     203 | +
     204 | +    def verify(self, node):
     205 | +        if self.receive_address is not None:
     206 | +            assert self.receive_address in self.addresses
    


    promag commented at 12:55 PM on October 24, 2017:

    Assert to detect if receive_address is incorrecly changed?

  4. in test/functional/wallet-accounts.py:197 in bc9c0a7b74
     224 | +    # address of a different account should reset the receiving address of
     225 | +    # the old account, causing getaccountaddress to return a brand new
     226 | +    # address.
     227 | +    if address == old_account.receive_address:
     228 | +        new_address = node.getaccountaddress(old_account.name)
     229 | +        assert_equal(new_address not in old_account.addresses, True)
    


    promag commented at 1:02 PM on October 24, 2017:

    assert ... not in ...;?


    ryanofsky commented at 1:30 PM on October 24, 2017:

    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).


    promag commented at 1:33 PM on October 24, 2017:

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

  5. fanquake added the label Tests on Oct 24, 2017
  6. promag commented at 1:09 PM on October 24, 2017: member

    Is it worth since accounts is deprecated?

  7. ryanofsky commented at 1:23 PM on October 24, 2017: member

    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.

  8. laanwj merged this on Nov 9, 2017
  9. laanwj closed this on Nov 9, 2017

  10. laanwj referenced this in commit b5f9f025fe on Nov 9, 2017
  11. MarcoFalke commented at 8:40 PM on November 9, 2017: member

    post merge utACK bc9c0a7

  12. PastaPastaPasta referenced this in commit da406e0663 on Dec 22, 2019
  13. PastaPastaPasta referenced this in commit 94e44bbbd6 on Jan 2, 2020
  14. PastaPastaPasta referenced this in commit 6307f66b53 on Jan 4, 2020
  15. PastaPastaPasta referenced this in commit c1a9d5f8dc on Jan 12, 2020
  16. PastaPastaPasta referenced this in commit 8316cb6059 on Jan 12, 2020
  17. PastaPastaPasta referenced this in commit e0e94cee01 on Jan 12, 2020
  18. PastaPastaPasta referenced this in commit 01724df3f6 on Jan 12, 2020
  19. PastaPastaPasta referenced this in commit f2b3fd3642 on Jan 12, 2020
  20. PastaPastaPasta referenced this in commit 1fe256cdb4 on Jan 12, 2020
  21. PastaPastaPasta referenced this in commit e5ad819c30 on Jan 16, 2020
  22. PastaPastaPasta referenced this in commit 6d4839fd89 on Jan 22, 2020
  23. PastaPastaPasta referenced this in commit f6715027be on Jan 29, 2020
  24. PastaPastaPasta referenced this in commit 50edf1a5b1 on Jan 29, 2020
  25. ckti referenced this in commit ed724350fe on Mar 28, 2021
  26. DrahtBot locked this on Sep 8, 2021

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-04-25 00:15 UTC

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