MCPcopy Create free account
hub / github.com/ElementsProject/elements / is_valid_bech32

Function is_valid_bech32

contrib/testgen/gen_key_io_test_vectors.py:128–133  ·  view source on GitHub ↗

Check vector v for bech32 validity

(v)

Source from the content-addressed store, hash-verified

126 return is_valid_bech32(v)
127
128def is_valid_bech32(v):
129 '''Check vector v for bech32 validity'''
130 for hrp in ['bc', 'tb', 'bcrt']:
131 if decode_segwit_address(hrp, v) != (None, None):
132 return True
133 return False
134
135def gen_valid_base58_vector(template):
136 '''Generate valid base58 vector'''

Callers 1

is_validFunction · 0.85

Calls 1

decode_segwit_addressFunction · 0.90

Tested by

no test coverage detected