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

estimate_size crashes on WASM #146

Closed
ivnsch opened this issue Mar 17, 2022 · 2 comments · Fixed by #158
Closed

estimate_size crashes on WASM #146

ivnsch opened this issue Mar 17, 2022 · 2 comments · Fixed by #158
Labels
bug Something isn't working high priority

Comments

@ivnsch
Copy link
Contributor

ivnsch commented Mar 17, 2022

Caused by using Account / ring when signing the transaction. See #59

Workaround: Instead of signing the transaction, hardcode the additional bytes, like in the Go SDK:

self.to_msg_pack()?.len() as u64 + 75;

The purpose of this function is not entirely clear though - what when it's a multi sig or logic sig?

@AlterionX
Copy link
Contributor

AlterionX commented Mar 17, 2022

Could we possibly attach an additional method to a transaction that's something like "signature byte length"? It'd be internal to the library in case we decide to change it.

@ivnsch
Copy link
Contributor Author

ivnsch commented Mar 19, 2022

Essentially like the NumOfAdditionalBytesAfterSigning constant in the Go SDK? But what about multi sig and logic sig? Transaction doesn't have any information yet about how it will be signed. And multi sig and logic sig have variable sizes (for multi sig it depends on how many accounts are participating, and logic sig on the program's size), so we wouldn't be able to estimate those before having the actual signature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants