Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts-web/rt: retrying a transaction etc? #31

Closed
pro-wh opened this issue Mar 8, 2021 · 2 comments · Fixed by #36
Closed

ts-web/rt: retrying a transaction etc? #31

pro-wh opened this issue Mar 8, 2021 · 2 comments · Fixed by #36

Comments

@pro-wh
Copy link
Contributor

pro-wh commented Mar 8, 2021

There are some drawbacks to having a single helper that does the signing and submission, one of which is that it reduces the flexibility if you want to have the user sign it once and then send it either later or multiple times, etc. if, for example, there are network issues.

For our records, the reason we have a draft doing it this way is to carry method type information between (i) constructing the transaction with the request body type, which happens before signing, and (ii) parsing the response data, which happens after submitting.

Maybe we should look into making some clearly container structs like UnverifiedTransaction and SignatureSigned have a type parameter instead of unknown content. It takes us farther away from the possibility of translating type definitions automatically, but seems worth it.

@pro-wh
Copy link
Contributor Author

pro-wh commented Mar 8, 2021

this will be more good for the future when we (i) make similar wrappers for consensus and (ii) have gas in runtimes. the gas estimation also wants to look at the transaction, so it'll be one more thing that fits better when the steps are separated

@pro-wh
Copy link
Contributor Author

pro-wh commented Mar 9, 2021

making some clearly container structs like UnverifiedTransaction and SignatureSigned have a type parameter

a later idea: keep those types as they are, because there are lots of places where we end up with such a structure without actually knowing what's inside. instead, make wrappers that know what its member SignatureSigned contains, somewhat similar to the types like SignedTransaction in go and its embedded Signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant