move proof parameter loading out of gtest/main.cpp and into utiltest.cpp
This commit is contained in:
parent
0e6b004a64
commit
8f68166c24
|
@ -19,26 +19,6 @@ int main(int argc, char **argv) {
|
|||
assert(sodium_init() != -1);
|
||||
ECC_Start();
|
||||
|
||||
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()
|
||||
);
|
||||
|
||||
testing::InitGoogleMock(&argc, argv);
|
||||
|
||||
// The "threadsafe" style is necessary for correct operation of death/exit
|
||||
|
|
|
@ -357,3 +357,27 @@ CWalletTx GetValidSaplingReceive(const Consensus::Params& consensusParams,
|
|||
CWalletTx wtx {NULL, tx};
|
||||
return wtx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LoadProofParameters() {
|
||||
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()
|
||||
);
|
||||
}
|
||||
|
|
|
@ -76,4 +76,6 @@ CWalletTx GetValidSaplingReceive(const Consensus::Params& consensusParams,
|
|||
const libzcash::SaplingExtendedSpendingKey &sk,
|
||||
CAmount value);
|
||||
|
||||
void LoadProofParameters();
|
||||
|
||||
#endif // ZCASH_UTILTEST_H
|
||||
|
|
Loading…
Reference in New Issue