File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1717
1818from __future__ import absolute_import , division , print_function , unicode_literals
1919
20+ import array
2021import sys
2122
2223_bord = ord
24+ _tobytes = lambda x : array .array ('B' , x ).tostring ()
2325if sys .version > '3' :
2426 _bord = lambda x : x
27+ _tobytes = bytes
2528
2629import bitcoin
2730import bitcoin .base58
@@ -72,9 +75,11 @@ class CBech32BitcoinAddress(bitcoin.bech32.CBech32Data, CBitcoinAddress):
7275 @classmethod
7376 def from_bytes (cls , witver , witprog ):
7477
75- assert (witver == 0 )
76-
77- self = super (CBech32BitcoinAddress , cls ).from_bytes (witver , witprog )
78+ assert witver == 0
79+ self = super (CBech32BitcoinAddress , cls ).from_bytes (
80+ witver ,
81+ _tobytes (witprog )
82+ )
7883
7984 if len (self ) == 32 :
8085 self .__class__ = P2WSHBitcoinAddress
You can’t perform that action at this time.
0 commit comments