yuan
yuan
You can refer this: https://github.com/yuan-xy/libra-client/blob/master/libra/transaction.py and the test code: https://github.com/yuan-xy/libra-client/blob/master/test/test_canoser.py ________________________________ 发件人: Gie Katon 发送时间: Thursday, September 26, 2019 5:13:34 PM 收件人: yuan-xy/canoser-python 抄送: Subscribed 主题: [yuan-xy/canoser-python] Trying to deserialize...
Added detailed doc here: https://github.com/yuan-xy/canoser-python#must-define-canoser-struct-by-serialized-fields-and-sequence-not-the-definition-in-the-rust-struct Hope it can help you.
Maybe you can tell me the transaction id, so I can figure out what's the problem there.
You are right. The above signed_txn is a RawTransaction. ``` txn_bytes = bytes.fromhex(signed_txn) result = libra.RawTransaction.deserialize(txn_bytes) print(result) ``` It works fine.
I'm writing a __str__ method to pretty print this object, comming soon
Update canoser to 0.3.4, add simple pretty print support.
after get a proto class `txn`, you can get the `SignedTransaction` object with: `stx = SignedTransaction.deserialize(txn.signed_txn)` you can refer to this code: [test_get_transaction of libra-client](https://github.com/yuan-xy/libra-client/blob/master/test/test_client.py)
The input of deserialize method should be bytes type, not str type. 在 2019年9月27日,16:43,Gie Katon 写道: Hi, regarding my second question, in your file test_client.py, I see that your client...
It’s not a hex str, so you can’t call bytes.fromhex. Hex str only contain 0-9a-f. Where did you get this signed_txn? You can use struct.unpack to parse it with correct...
It seems to be a base64 encoded str. base64.b64decode("IAAAAB/HpLI2") b' \x00\x00\x00\x1f\xc7\xa4\xb26' 在 2019年9月27日,23:00,Gie Katon 写道: I rebuilt the .proto files from another Libra branch, but the signed_txn is returned in...