2022-03-28 14:44:59 +00:00
|
|
|
import std/random
|
2022-04-13 16:41:48 +00:00
|
|
|
import std/sequtils
|
2022-03-28 14:44:59 +00:00
|
|
|
import pkg/stint
|
|
|
|
|
|
|
|
proc example*[T: SomeInteger](_: type T): T =
|
|
|
|
rand(T)
|
|
|
|
|
|
|
|
proc example*[T,N](_: type array[N, T]): array[N, T] =
|
|
|
|
for item in result.mitems:
|
|
|
|
item = T.example
|
|
|
|
|
2022-04-13 16:41:48 +00:00
|
|
|
proc example*[T](_: type seq[T]): seq[T] =
|
|
|
|
let length = uint8.example.int
|
|
|
|
newSeqWith(length, T.example)
|
|
|
|
|
2022-03-28 14:44:59 +00:00
|
|
|
proc example*(_: type UInt256): UInt256 =
|
|
|
|
UInt256.fromBytes(array[32, byte].example)
|