Closed muawiakh closed 7 years ago
Same issue in the The Fulfilled Transaction, when I run:
In [0]: message = json.dumps(
...: handcrafted_creation_tx,
...: sort_keys=True,
...: separators=(',', ':'),
...: ensure_ascii=False,
...: )
In [0]: json.dumps(fulfilled_creation_tx, sort_keys=True) == json.dumps(handcrafted_creation_tx, sort_keys=True)
In a nutshell, code snippet.
returned_creation_tx = bdb.transactions.send(handcrafted_creation_tx)
I verified the guide on two different setups and it seems like I had some packaging/versioning issue with some python modules(on the setup that I was using). The guide works fine with the current set of instructions. Verified it. Closing the ticket.
Description
While following the handcrafting guide for a CREATE transaction, came across an issue after creating a transaction ID right after the Up to now section. I was trying to serialize the handcrafted_creation_tx to json string as per the guide and it fails by complaining that the transaction ID is not JSON serializable. Same scenario with prepared_creation_tx
What I Did
Traceback
Solution
json_str_handcrafted_tx = json.dumps(handcrafted_creation_tx, sort_keys=True) json_str_prepared_tx = json.dumps(prepared_creation_tx, sort_keys=True)
handcrafted_creation_tx['id'] = handcrafted_creation_tx['id'].encode('utf-8') prepared_creation_tx['id'] = prepared_creation_tx['id'].encode('utf-8')