Remove proof parameter loading from btests
This commit is contained in:
parent
b865437e1e
commit
15e6e53738
|
@ -42,33 +42,6 @@ FastRandomContext insecure_rand_ctx(insecure_rand_seed);
|
||||||
extern bool fPrintToConsole;
|
extern bool fPrintToConsole;
|
||||||
extern void noui_connect();
|
extern void noui_connect();
|
||||||
|
|
||||||
JoinSplitTestingSetup::JoinSplitTestingSetup(const std::string& chainName) : BasicTestingSetup(chainName)
|
|
||||||
{
|
|
||||||
fs::path sapling_spend = ZC_GetParamsDir() / "sapling-spend.params";
|
|
||||||
fs::path sapling_output = ZC_GetParamsDir() / "sapling-output.params";
|
|
||||||
fs::path sprout_groth16 = ZC_GetParamsDir() / "sprout-groth16.params";
|
|
||||||
|
|
||||||
static_assert(
|
|
||||||
sizeof(fs::path::value_type) == sizeof(codeunit),
|
|
||||||
"librustzcash not configured correctly");
|
|
||||||
auto sapling_spend_str = sapling_spend.native();
|
|
||||||
auto sapling_output_str = sapling_output.native();
|
|
||||||
auto sprout_groth16_str = sprout_groth16.native();
|
|
||||||
|
|
||||||
librustzcash_init_zksnark_params(
|
|
||||||
reinterpret_cast<const codeunit*>(sapling_spend_str.c_str()),
|
|
||||||
sapling_spend_str.length(),
|
|
||||||
reinterpret_cast<const codeunit*>(sapling_output_str.c_str()),
|
|
||||||
sapling_output_str.length(),
|
|
||||||
reinterpret_cast<const codeunit*>(sprout_groth16_str.c_str()),
|
|
||||||
sprout_groth16_str.length()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
JoinSplitTestingSetup::~JoinSplitTestingSetup()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
BasicTestingSetup::BasicTestingSetup(const std::string& chainName)
|
BasicTestingSetup::BasicTestingSetup(const std::string& chainName)
|
||||||
{
|
{
|
||||||
assert(sodium_init() != -1);
|
assert(sodium_init() != -1);
|
||||||
|
@ -98,7 +71,7 @@ BasicTestingSetup::~BasicTestingSetup()
|
||||||
ECC_Stop();
|
ECC_Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
TestingSetup::TestingSetup(const std::string& chainName) : JoinSplitTestingSetup(chainName)
|
TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(chainName)
|
||||||
{
|
{
|
||||||
const CChainParams& chainparams = Params();
|
const CChainParams& chainparams = Params();
|
||||||
// Ideally we'd move all the RPC tests to the functional testing framework
|
// Ideally we'd move all the RPC tests to the functional testing framework
|
||||||
|
|
|
@ -20,16 +20,10 @@ struct BasicTestingSetup {
|
||||||
~BasicTestingSetup();
|
~BasicTestingSetup();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Setup w.r.t. zk-SNARK API
|
|
||||||
struct JoinSplitTestingSetup: public BasicTestingSetup {
|
|
||||||
JoinSplitTestingSetup(const std::string& chainName = CBaseChainParams::MAIN);
|
|
||||||
~JoinSplitTestingSetup();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Testing setup that configures a complete environment.
|
/** Testing setup that configures a complete environment.
|
||||||
* Included are data directory, coins database, script check threads setup.
|
* Included are data directory, coins database, script check threads setup.
|
||||||
*/
|
*/
|
||||||
struct TestingSetup: public JoinSplitTestingSetup {
|
struct TestingSetup: public BasicTestingSetup {
|
||||||
CCoinsViewDB *pcoinsdbview;
|
CCoinsViewDB *pcoinsdbview;
|
||||||
fs::path orig_current_path;
|
fs::path orig_current_path;
|
||||||
fs::path pathTemp;
|
fs::path pathTemp;
|
||||||
|
|
Loading…
Reference in New Issue