Skip to content

Commit

Permalink
test: adjust tests with proofs instead of proof
Browse files Browse the repository at this point in the history
  • Loading branch information
th7nder committed Feb 16, 2025
1 parent 7edfd7a commit c6a494e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions pallets/proofs/src/tests/porep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use primitives::{
};
use rand::SeedableRng;
use rand_xorshift::XorShiftRng;
use sp_core::bounded_vec;
use sp_runtime::BoundedVec;

use crate::{mock::*, tests::TEST_SEED, Error, PoRepVerifyingKey};
Expand Down
4 changes: 2 additions & 2 deletions pallets/storage-provider/src/tests/declare_faults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ pub(crate) fn setup_sp_with_one_sector(storage_provider: &str, storage_client: &
// Prove commit sector
let sector = ProveCommitSector {
sector_number,
proof: bounded_vec![0xd, 0xe, 0xa, 0xd],
proofs: bounded_vec![bounded_vec![0xd, 0xe, 0xa, 0xd]],
};

assert_ok!(StorageProvider::prove_commit_sectors(
Expand Down Expand Up @@ -539,7 +539,7 @@ pub(crate) fn setup_sp_with_many_sectors_multiple_partitions(
// Prove commit sector
let sector = ProveCommitSector {
sector_number,
proof: bounded_vec![0xb, 0xe, 0xe, 0xf],
proofs: bounded_vec![bounded_vec![0xb, 0xe, 0xe, 0xf]],
};

assert_ok!(StorageProvider::prove_commit_sectors(
Expand Down
2 changes: 1 addition & 1 deletion pallets/storage-provider/src/tests/post_hook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ fn precommit_and_prove(storage_provider: &'static str, deal_id: DealId, sector_n
RuntimeOrigin::signed(account(storage_provider)),
bounded_vec![ProveCommitSector {
sector_number,
proof: bounded_vec![0xde],
proofs: bounded_vec![bounded_vec![0xde]],
}],
)
.unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn pre_commit_hook_slashed_deal() {
RuntimeOrigin::signed(account(storage_provider)),
bounded_vec![ProveCommitSector {
sector_number: 2.into(),
proof: bounded_vec![0xde],
proofs: bounded_vec![bounded_vec![0xde]],
}],
)
.unwrap();
Expand Down
12 changes: 6 additions & 6 deletions pallets/storage-provider/src/tests/prove_commit_sectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn successfully_prove_sector() {
// Test prove commits
let sector = ProveCommitSector {
sector_number,
proof: bounded_vec![0xd, 0xe, 0xa, 0xd],
proofs: bounded_vec![bounded_vec![0xd, 0xe, 0xa, 0xd]],
};

// Run to the block, where we will be able to prove commit the sector.
Expand Down Expand Up @@ -157,7 +157,7 @@ fn successfully_prove_multiple_sectors() {
sectors
.try_push(ProveCommitSector {
sector_number,
proof: bounded_vec![0xd, 0xe, 0xa, 0xd],
proofs: bounded_vec![bounded_vec![0xd, 0xe, 0xa, 0xd]],
})
.expect("BoundedVec should fit all 6 elements");
expected_sector_results
Expand Down Expand Up @@ -297,7 +297,7 @@ fn successfully_prove_after_period_start_and_check_mutability() {
sectors
.try_push(ProveCommitSector {
sector_number,
proof: bounded_vec![0xd, 0xe, 0xa, 0xd],
proofs: bounded_vec![bounded_vec![0xd, 0xe, 0xa, 0xd]],
})
.expect("BoundedVec should fit all elements");
expected_sector_results
Expand All @@ -322,7 +322,7 @@ fn fails_storage_provider_not_found() {
// Test prove commits
let sector = ProveCommitSector {
sector_number: 1.into(),
proof: bounded_vec![0xd, 0xe, 0xa, 0xd],
proofs: bounded_vec![bounded_vec![0xd, 0xe, 0xa, 0xd]],
};

assert_noop!(
Expand All @@ -346,7 +346,7 @@ fn fails_storage_precommit_missing() {
// Test prove commits
let sector = ProveCommitSector {
sector_number: 1.into(),
proof: bounded_vec![0xd, 0xe, 0xa, 0xd],
proofs: bounded_vec![bounded_vec![0xd, 0xe, 0xa, 0xd]],
};

assert_noop!(
Expand Down Expand Up @@ -394,7 +394,7 @@ fn fails_prove_commit_after_deadline() {
// Test prove commits
let sector = ProveCommitSector {
sector_number,
proof: bounded_vec![0xd, 0xe, 0xa, 0xd],
proofs: bounded_vec![bounded_vec![0xd, 0xe, 0xa, 0xd]],
};

run_to_block(proving_at_block_number);
Expand Down
2 changes: 1 addition & 1 deletion pallets/storage-provider/src/tests/submit_windowed_post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fn setup() {
// Prove commit sector
let sector = ProveCommitSector {
sector_number,
proof: bounded_vec![0xd, 0xe, 0xa, 0xd],
proofs: bounded_vec![bounded_vec![0xd, 0xe, 0xa, 0xd]],
};

assert_ok!(StorageProvider::prove_commit_sectors(
Expand Down

0 comments on commit c6a494e

Please sign in to comment.