Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
fixtures.hpp
Go to the documentation of this file.
3#include <cstdint>
4
5namespace bb::lmdblib {
6const uint32_t NUM_VALUES = 1024;
9
10inline std::string random_string()
11{
12 std::stringstream ss;
13 ss << random_engine.get_random_uint32();
14 return ss.str();
15}
16
17inline std::string random_temp_directory()
18{
19 std::stringstream ss;
20 ss << "/tmp/lmdb/" << random_string();
21 return ss.str();
22}
23
24inline std::vector<uint8_t> serialise(std::string key)
25{
26 std::vector<uint8_t> data(key.begin(), key.end());
27 return data;
28}
29
30inline Key get_key(int64_t keyCount)
31{
32 return serialise((std::stringstream() << "Key" << keyCount).str());
33}
34
35inline Value get_value(int64_t keyCount, int64_t valueCount)
36{
37 return serialise((std::stringstream() << "Key" << keyCount << "Data" << valueCount).str());
38}
39
40} // namespace bb::lmdblib
const std::vector< FF > data
std::vector< uint8_t > Key
Definition types.hpp:11
std::string random_string()
Definition fixtures.hpp:10
const uint32_t NUM_VALUES
Definition fixtures.hpp:6
std::vector< uint8_t > Value
Definition types.hpp:12
auto & random_engine
Definition fixtures.hpp:8
auto & engine
Definition fixtures.hpp:7
Key get_key(int64_t keyCount)
Definition fixtures.hpp:30
Value get_value(int64_t keyCount, int64_t valueCount)
Definition fixtures.hpp:35
std::vector< uint8_t > serialise(std::string key)
Definition fixtures.hpp:24
std::string random_temp_directory()
Definition fixtures.hpp:17
RNG & get_debug_randomness(bool reset, std::uint_fast64_t seed)
Definition engine.cpp:190
RNG & get_randomness()
Definition engine.cpp:203