entropyxyz / programs

Source, toolchain, and examples for using programs on Entropy
https://docs.entropy.xyz/concepts/programs/
GNU Affero General Public License v3.0
19 stars 3 forks source link

Allow `std` in program tests #61

Open jakehemmerle opened 5 months ago

jakehemmerle commented 5 months ago

There are several examples that simply have #![no_std] at the top, while this default should be changed to something more like #![cfg_attr(not(test), no_std)].

This won't affect the generated artifacts for compiling programs for production, but will allow for things like randomness to be used in tests.

This should be relatively trivial, but I'm not positive if it breaks things because we also use register_custom_getrandom!(always_fail); everywhere.