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

fixed-hash: allow opting out rand when std enabled #805

Closed
Farhad-Shabani opened this issue Dec 1, 2023 · 0 comments · Fixed by #804
Closed

fixed-hash: allow opting out rand when std enabled #805

Farhad-Shabani opened this issue Dec 1, 2023 · 0 comments · Fixed by #804

Comments

@Farhad-Shabani
Copy link
Contributor

Farhad-Shabani commented Dec 1, 2023

Context

at ibc-rs, we use primitives_types::U256 for an Amount type, but there's an issue for projects using ibc-rs, when integrating with CosmWasm and compiling with wasm32-unknown-unknown target. We need there, to enable the std feature and avoid pulling in rand or getrandom crates as CosmWasm VM doesn't allow them.

Thus, when we enable primitive_types/std, fixed_hash/std is brought in, and rand is pulled in afterward. This causes compatibility issues with CosmWasm.

Related issue at ibc-rs: cosmos/ibc-rs#991

Proposal

Adding an extra rand feature, so can exclude rand from the fixed_hash crate when:

  primitive-types = { version = "0.12.2", default-features = false, features = "std" }

This allows our users to stick with standard libraries without pulling in the rand while the fixed-hash retains its default behavior.

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