Skip to content

Commit 8c82df7

Browse files
committed
feat: only test snarkpack v2 in api version 1.2.x
fix: apply review feedback
1 parent 666f33a commit 8c82df7

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

filecoin-proofs/tests/api.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -943,10 +943,16 @@ fn aggregate_seal_proofs<Tree: 'static + MerkleTreeTrait>(
943943
let mut prover_id = [0u8; 32];
944944
prover_id.copy_from_slice(AsRef::<[u8]>::as_ref(&prover_fr));
945945

946-
let aggregate_versions = vec![
947-
groth16::aggregate::AggregateVersion::V1,
948-
groth16::aggregate::AggregateVersion::V2,
949-
];
946+
// Note that ApiVersion 1.2.0 only supports SnarkPack v2, so only
947+
// allow that testing here.
948+
let aggregate_versions = match porep_config.api_version {
949+
ApiVersion::V1_2_0 => vec![groth16::aggregate::AggregateVersion::V2],
950+
ApiVersion::V1_1_0 => vec![
951+
groth16::aggregate::AggregateVersion::V1,
952+
groth16::aggregate::AggregateVersion::V2,
953+
],
954+
ApiVersion::V1_0_0 => vec![groth16::aggregate::AggregateVersion::V1],
955+
};
950956
info!(
951957
"Aggregating {} seal proof with ApiVersion {}, Features {:?}, and PoRep ID {:?}",
952958
num_proofs_to_aggregate,

storage-proofs-porep/tests/common.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ use storage_proofs_porep::stacked::{PersistentAux, PublicParams, StackedDrg, Tau
1313

1414
// This method should ONLY be used in purposed test code.
1515
#[allow(dead_code)]
16-
pub fn remove_replica_and_tree_r<Tree: MerkleTreeTrait + 'static>(cache_path: &Path) -> Result<()> {
16+
pub(crate) fn remove_replica_and_tree_r<Tree: MerkleTreeTrait + 'static>(
17+
cache_path: &Path,
18+
) -> Result<()> {
1719
let replica_path = cache_path.join("replica-path");
1820
let tree_r_last_config = StoreConfig {
1921
path: cache_path.to_path_buf(),

0 commit comments

Comments
 (0)