You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.
TransactionSerializer.Deserialize was designed to restore tx data from JsonRPC result. It has txHash. But I agree that serialized tx data by TransactionSerializer can be deserialized to Transaction object.
If you want to contribute the fix I suggest you to use Hasher in IconSDK.Crypto namespace. Hasher.Digest(param) will generate hash based on param. And the param will be a Dictionary<string, object> object which excludes "txHash" and "signature" from txSerialized.
I am summarizing below.
txSerialized has txHash
Use it.
txSerialized does not have txhash.
Copy txSerialized to new variable(to avoid modifying original data). Then delete signature from copied one. Use Hasher.Digest(coped) as tx hash.
You can see how to use Hasher.Digest in TestTransaction.cs.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
After serializing transaction with
TransactionSerializer
we can't de-serialize result object back to original one.Expected:
TransactionSerializer
should deserialize transaction that is serialized by him.Actual:
KeyNotFoundException
is thrown fortxHash
key.As I understood, the reason is that send transaction rpc call isn't accepting "txHash".
Any Ideas, how to fix this? Maybe we can build hash during deserialization, if it isn't set.
Up to contribute the fix.
The text was updated successfully, but these errors were encountered: