mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-01-09 12:35:51 +00:00
b88561e090
* Update dagger-contracts * [proving] rename ProofTiming -> Proofs * Update nim-ethers to 0.1.4 * [proving] Subscribe to proof submissions * [proving] support proof submission through the Proving abstraction
18 lines
415 B
Nim
18 lines
415 B
Nim
import std/random
|
|
import std/sequtils
|
|
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
|
|
|
|
proc example*[T](_: type seq[T]): seq[T] =
|
|
let length = uint8.example.int
|
|
newSeqWith(length, T.example)
|
|
|
|
proc example*(_: type UInt256): UInt256 =
|
|
UInt256.fromBytes(array[32, byte].example)
|