test: Add test that addmultisigaddress fails for watchonly addresses #15831

pull MarcoFalke wants to merge 2 commits into bitcoin:master from MarcoFalke:1904-testMulti changing 1 files +31 −15
  1. MarcoFalke commented at 5:08 PM on April 16, 2019: member

    Just to make sure this is not regressed on accidentally in the future

  2. test: Fixup creatmultisig documentation and whitespace fad81d870a
  3. MarcoFalke commented at 5:10 PM on April 16, 2019: member
  4. DrahtBot added the label Tests on Apr 16, 2019
  5. in test/functional/rpc_createmultisig.py:32 in fa9e18e5ba outdated
      31 |  
      32 |      def run_test(self):
      33 | -        node0,node1,node2 = self.nodes
      34 | +        node0, node1, node2 = self.nodes
      35 | +
      36 | +        self.check_createmultisig_errors()
    


    jonatack commented at 10:29 AM on April 17, 2019:

    Perhaps an info log for the new test "Test addmultisigaddress fails for watchonly addresses" and one to replace the comment "# 50 BTC each, rest will be 25 BTC each" with something clearer.

    Current output:

    $ test/functional/rpc_createmultisig.py 
    2019-04-17T10:26:29.745000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_chsfh_ip
    2019-04-17T10:26:32.375000Z TestFramework (INFO): n/m=2/3 bech32 size=337 vsize=147 weight=586
    2019-04-17T10:26:32.581000Z TestFramework (INFO): n/m=2/3 p2sh-segwit size=372 vsize=182 weight=726
    2019-04-17T10:26:32.797000Z TestFramework (INFO): n/m=2/3 legacy size=335 vsize=335 weight=1340
    2019-04-17T10:26:33.053000Z TestFramework (INFO): n/m=3/3 bech32 size=409 vsize=165 weight=658
    2019-04-17T10:26:33.339000Z TestFramework (INFO): n/m=3/3 p2sh-segwit size=444 vsize=200 weight=798
    2019-04-17T10:26:33.606000Z TestFramework (INFO): n/m=3/3 legacy size=409 vsize=409 weight=1636
    2019-04-17T10:26:33.931000Z TestFramework (INFO): n/m=2/5 bech32 size=405 vsize=164 weight=654
    2019-04-17T10:26:34.253000Z TestFramework (INFO): n/m=2/5 p2sh-segwit size=440 vsize=199 weight=794
    2019-04-17T10:26:34.581000Z TestFramework (INFO): n/m=2/5 legacy size=405 vsize=405 weight=1620
    2019-04-17T10:26:34.872000Z TestFramework (INFO): n/m=3/5 bech32 size=477 vsize=182 weight=726
    2019-04-17T10:26:35.187000Z TestFramework (INFO): n/m=3/5 p2sh-segwit size=512 vsize=217 weight=866
    2019-04-17T10:26:35.517000Z TestFramework (INFO): n/m=3/5 legacy size=477 vsize=477 weight=1908
    2019-04-17T10:26:37.090000Z TestFramework (INFO): Stopping nodes
    2019-04-17T10:26:37.495000Z TestFramework (INFO): Cleaning up /tmp/bitcoin_func_test_chsfh_ip on exit
    2019-04-17T10:26:37.495000Z TestFramework (INFO): Tests successful
    
  6. in test/functional/rpc_createmultisig.py:50 in fa9e18e5ba outdated
      50 |  
      51 |          self.checkbalances()
      52 |  
      53 | +    def check_createmultisig_errors(self):
      54 | +        addresses = [self.nodes[1].getnewaddress(address_type='legacy') for _ in range(2)]
      55 | +        assert_raises_rpc_error(-5, 'no full public key for address', lambda: self.nodes[0].addmultisigaddress(nrequired=1, keys=addresses))
    


    jonatack commented at 10:31 AM on April 17, 2019:

    Perhaps line wrap the two assertions in check_createmultisig_errors

  7. jonatack commented at 10:42 AM on April 17, 2019: member

    ACK

  8. test: Add test that addmultisigaddress fails for watchonly addresses fab6a0a659
  9. MarcoFalke force-pushed on Apr 17, 2019
  10. MarcoFalke commented at 11:44 AM on April 17, 2019: member

    Added logging as requested by @jonatack

  11. MarcoFalke merged this on Apr 17, 2019
  12. MarcoFalke closed this on Apr 17, 2019

  13. MarcoFalke referenced this in commit 429a7cf34f on Apr 17, 2019
  14. MarcoFalke deleted the branch on Apr 17, 2019
  15. MarcoFalke referenced this in commit 13b3bb5644 on Jun 21, 2019
  16. MarcoFalke referenced this in commit 23ba460c1a on Jun 21, 2019
  17. HashUnlimited referenced this in commit a5f2d6f8d7 on Aug 23, 2019
  18. HashUnlimited referenced this in commit 576a6bc878 on Aug 23, 2019
  19. Bushstar referenced this in commit b12c899a80 on Aug 24, 2019
  20. Bushstar referenced this in commit f0bdc7a48b on Aug 24, 2019
  21. Bushstar referenced this in commit b06060dd4d on Aug 24, 2019
  22. Bushstar referenced this in commit e43dd04bda on Aug 24, 2019
  23. Bushstar referenced this in commit c783eba859 on Aug 24, 2019
  24. Bushstar referenced this in commit f9ee3c9124 on Aug 24, 2019
  25. Bushstar referenced this in commit 383b19be21 on Aug 24, 2019
  26. Bushstar referenced this in commit ebfa5c2d15 on Aug 24, 2019
  27. deadalnix referenced this in commit a42abd11cf on Jun 12, 2020
  28. ftrader referenced this in commit e927c69798 on Aug 17, 2020
  29. DrahtBot locked this on Dec 16, 2021
Contributors
Labels

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-17 06:14 UTC

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