test: Add python bech32 impl round-trip test #16864

pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:bech32_encode_test changing 1 files +13 −1
  1. instagibbs commented at 3:12 PM on September 13, 2019: member

    Currently there is a single use of segwit_addr.encode, and zero uses of segwit_addr.decode in the codebase.

    This adds a simple round-trip test of the implementation to avoid future regressions.

  2. DrahtBot added the label Tests on Sep 13, 2019
  3. laanwj commented at 4:43 PM on September 13, 2019: member

    A unit test for the test framework? Interesting. As we don't really have a determined place for these, this seems fine to me.

  4. instagibbs commented at 6:52 PM on September 13, 2019: member

    Theoretically it's cross-checking the 2 bech32 implementations, so it's kind of a test of Core too :)

  5. MarcoFalke renamed this:
    Add python bech32 impl round-trip test
    test: Add python bech32 impl round-trip test
    on Sep 14, 2019
  6. promag commented at 5:09 PM on September 15, 2019: member

    Concept ACK, won't be tested if wallet is disabled.

  7. Add python bech32 impl round-trip test ae0add8dfe
  8. in test/functional/wallet_address_types.py:105 in 7df35efdbb outdated
      99 | @@ -97,6 +100,13 @@ def get_balances(self, confirmed=True):
     100 |          else:
     101 |              return [self.nodes[i].getunconfirmedbalance() for i in range(4)]
     102 |  
     103 | +    # Quick test of python bech32 implementation
     104 | +    def test_python_bech32(self, addr):
     105 | +        hrp =addr[:4]
    


    promag commented at 5:14 PM on September 15, 2019:

    nit, space.

  9. instagibbs force-pushed on Sep 15, 2019
  10. meshcollider commented at 2:54 AM on September 17, 2019: contributor

    Concept ACK, simple but better than nothing :)

  11. MarcoFalke referenced this in commit 99beda47f5 on Sep 17, 2019
  12. MarcoFalke merged this on Sep 17, 2019
  13. MarcoFalke closed this on Sep 17, 2019

  14. sidhujag referenced this in commit ce8e3c768e on Sep 23, 2019
  15. DrahtBot locked this on Dec 16, 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-27 03:15 UTC

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