Skip to content

env.block.random in queries returns a single byte of zero #1624

Open
@luca992

Description

@luca992

In queries, env.block.random returns a Vec<u8>[0] (a byte array with a single byte which is zero).

If randomness in queries is unsupported (which it appears it is), I think this behavior is dangerous and can lead to someone unknowing using the query block "random" as an actual random, when it is not random at all.

It would make much more sense to just return None in this case to completely avoid misuse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions