bee icon indicating copy to clipboard operation
bee copied to clipboard

Investigate a `Random` trait for rejection sampling in `bee-test`

Open grtlr opened this issue 3 years ago • 0 comments

The random generation in bee-test is becoming more and more complex, for example by introducing conditions for random values. A concrete example is the StateControllerAddressUnlockCondition in AliasOutput. It is required that the AliasIds are different from each other.

Maybe we could benefit from a Random trait and a RandomCondition trait that allows an easier impementation, or maybe even a proc-derive macro, of rejection sampling.

Another benefit would be that we could simply import the trait and the original type, not having to always find the matching rand_* method for a given type.

grtlr avatar Feb 03 '22 10:02 grtlr