Skip to content

Commit

Permalink
Fix #26
Browse files Browse the repository at this point in the history
  • Loading branch information
ldmberman committed Jan 3, 2022
1 parent 63b4fb5 commit 79b563e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions arweave/arweave_lib.py
Expand Up @@ -19,7 +19,8 @@
owner_to_address,
create_tag,
encode_tag,
decode_tag
decode_tag,
base64url_decode
)
from .deep_hash import deep_hash
from .merkle import compute_root_hash, generate_transaction_chunks
Expand Down Expand Up @@ -204,10 +205,10 @@ def get_signature_data(self):

if int(self.data_size) > 0 and self.data_root == "" and not self.uses_uploader:
if type(self.data) == str:
root_hash = compute_root_hash(io.StringIO(self.data))
root_hash = compute_root_hash(io.BytesIO(base64url_decode(self.data.encode('utf-8'))))

if type(self.data) == bytes:
root_hash = compute_root_hash(io.BytesIO(self.data))
root_hash = compute_root_hash(io.BytesIO(base64url_decode(self.data)))

self.data_root = base64url_encode(root_hash)

Expand Down

0 comments on commit 79b563e

Please sign in to comment.