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

Function encode

test/functional/test_framework/liquid_addr.py:104–109  ·  view source on GitHub ↗

Encode a segwit address.

(hrp, witver, witprog)

Source from the content-addressed store, hash-verified

102
103
104def encode(hrp, witver, witprog):
105 """Encode a segwit address."""
106 ret = blech32_encode(hrp, [witver] + convertbits(witprog, 8, 5))
107 if decode(hrp, ret) == (None, None):
108 return None
109 return ret

Callers 1

run_testMethod · 0.90

Calls 3

blech32_encodeFunction · 0.85
convertbitsFunction · 0.70
decodeFunction · 0.70

Tested by

no test coverage detected