-
Notifications
You must be signed in to change notification settings - Fork 45
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
Remove dependency on micromath, compute height with integers only #18
Conversation
To expand on this - the use of floats is not supported on CosmWasm's WASM VM, so removing this means the crate will now be able to used in smart contracts deployed on CosmWasm without any issues. |
7eb5839
to
93dc641
Compare
To be more precise WebAssembly supports floats just fine by itself, but Sasha has an application that only supports a subset of WASM that doesn't support floats. |
@matthiasgoergens @sashaduke This uses |
Thanks for checking! I wonder if we can ask the compiler or so to enforce the no-std rule? |
|
93dc641
to
43a3b83
Compare
@sashaduke Thanks, I implemented your suggestion! @antouhou I can build the fixed version with I think about how to automate this check. |
This reduces the overall dependency tree, which was only being used in computing the tree height.
It may also be benefitial in some environments (e.g.: zk) to be able to use integer math only.
The snippet
leaves_count as f32
caused some trouble. Let's remove it.(Description stolen from #16 because it's honestly much better than what I had originally typed up.)