import std/sequtils import std/sugar import std/random import std/strutils import pkg/questionable/results import pkg/constantine/math/arithmetic import pkg/constantine/math/io/io_fields import pkg/poseidon2/io import pkg/poseidon2 import pkg/chronos import pkg/nimcrypto import pkg/asynctest/chronos/unittest import pkg/codex/stores/cachestore import pkg/codex/chunker import pkg/codex/stores import pkg/codex/blocktype as bt import pkg/codex/contracts/requests import pkg/codex/contracts import pkg/codex/merkletree import pkg/codex/stores/cachestore import pkg/codex/slots/sampler import pkg/codex/slots/builder/builder import ../helpers import ../examples import ../merkletree/helpers import testsampler_expected import ./provingtestenv asyncchecksuite "Test DataSampler": var env: ProvingTestEnvironment dataSampler: DataSampler blk: bt.Block cell0Bytes: seq[byte] cell1Bytes: seq[byte] cell2Bytes: seq[byte] proc createDataSampler(): Future[void] {.async.} = dataSampler = DataSampler.new( datasetSlotIndex, env.localStore, SlotsBuilder.new(env.localStore, env.manifest).tryGet()).tryGet() setup: randomize() env = await createProvingTestEnvironment() let bytes = newSeqWith(bytesPerBlock, rand(uint8)) blk = bt.Block.new(bytes).tryGet() cell0Bytes = bytes[0..