File "main.py", line 6, in <module> bc.add_block("Send 1 BTC to Ivan") File "/home/bxb/repo/py/blockchain-py/blockchain.py", line 30, in add_block new_block = Block(data, last_hash) File "/home/bxb/repo/py/blockchain-py/block.py", line 26, in __init__ self._prev_block_hash = utils.encode(prev_block_hash) File "/home/bxb/repo/py/blockchain-py/utils.py", line 7, in encode return string.encode(code) AttributeError: 'bytes' object has no attribute 'encode'
File "main.py", line 6, in <module> bc.add_block("Send 1 BTC to Ivan") File "/home/bxb/repo/py/blockchain-py/blockchain.py", line 30, in add_block new_block = Block(data, last_hash) File "/home/bxb/repo/py/blockchain-py/block.py", line 26, in __init__ self._prev_block_hash = utils.encode(prev_block_hash) File "/home/bxb/repo/py/blockchain-py/utils.py", line 7, in encode return string.encode(code) AttributeError: 'bytes' object has no attribute 'encode'