Skip to content

Commit

Permalink
More linter and fmt fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenGround0 committed May 22, 2024
1 parent a3e9705 commit 1bb6111
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 41 deletions.
7 changes: 1 addition & 6 deletions actors/miner/tests/exported_getters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,7 @@ fn collateral_getters() {
let pcc = ProveCommitConfig::empty();

let sector = h
.prove_commit_sector_and_confirm(
&rt,
&vec![],
h.make_prove_commit_params(sector_no),
pcc,
)
.prove_commit_sector_and_confirm(&rt, &vec![], h.make_prove_commit_params(sector_no), pcc)
.unwrap();

// query available balance
Expand Down
7 changes: 1 addition & 6 deletions actors/miner/tests/prove_commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,7 @@ fn prove_single_sector() {
pcc.add_activated_deals(sector_no, vec![verified_deal]);

let sector = h
.prove_commit_sector_and_confirm(
&rt,
&deal_ids,
h.make_prove_commit_params(sector_no),
pcc,
)
.prove_commit_sector_and_confirm(&rt, &deal_ids, h.make_prove_commit_params(sector_no), pcc)
.unwrap();

assert_eq!(precommit.info.seal_proof, sector.seal_proof);
Expand Down
9 changes: 4 additions & 5 deletions actors/miner/tests/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,9 @@ impl ActorHarness {
CompactCommD::empty()
} else {
let piece_cids: Vec<Cid> = deal_ids[i]
.iter().enumerate()
.map(|(j, _deal_id)| {
make_piece_cid(sector_no, j, DEFAULT_PIECE_SIZE)
})
.iter()
.enumerate()
.map(|(j, _deal_id)| make_piece_cid(sector_no, j, DEFAULT_PIECE_SIZE))
.collect();

sector_commd_from_pieces(&piece_cids)
Expand All @@ -432,7 +431,7 @@ impl ActorHarness {
precommit_epoch - 1,
expiration,
// We are committing with deals but pass their info in CommD as PCD with deal_ids will fail after nv21
vec![],
vec![],
compact_commd,
);

Expand Down
5 changes: 0 additions & 5 deletions actors/power/tests/harness/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use fvm_shared::clock::ChainEpoch;
use fvm_shared::econ::TokenAmount;
use fvm_shared::error::ExitCode;
use fvm_shared::sector::SealVerifyInfo;
use fvm_shared::sector::SectorNumber;
use fvm_shared::sector::{RegisteredPoStProof, RegisteredSealProof, StoragePower};
use fvm_shared::MethodNum;
use lazy_static::lazy_static;
Expand Down Expand Up @@ -214,10 +213,6 @@ impl Harness {
ret.miner_count
}

pub fn this_epoch_baseline_power(&self) -> &StoragePower {
&self.this_epoch_baseline_power
}

pub fn get_claim(&self, rt: &MockRuntime, miner: &Address) -> Option<Claim> {
let st: State = rt.get_state();
st.get_claim(rt.store(), miner).unwrap()
Expand Down
8 changes: 3 additions & 5 deletions integration_tests/src/tests/commit_post_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ use crate::expects::Expect;
use crate::util::{
advance_by_deadline_to_epoch, advance_to_proving_deadline, assert_invariants, create_accounts,
create_miner, cron_tick, expect_invariants, get_network_stats, invariant_failure_patterns,
miner_balance, precommit_sectors_v2, submit_windowed_post, miner_prove_sector
miner_balance, miner_prove_sector, precommit_sectors_v2, submit_windowed_post,
};
use crate::TEST_VM_RAND_ARRAY;
use fil_actor_cron::Method as CronMethod;
use fil_actor_market::Method as MarketMethod;
use fil_actor_miner::{
max_prove_commit_duration, power_for_sector, DeadlineInfo, Method as MinerMethod,
PoStPartition, ProveCommitAggregateParams, State as MinerState,
SubmitWindowedPoStParams,
PoStPartition, ProveCommitAggregateParams, State as MinerState, SubmitWindowedPoStParams,
};
use fil_actor_power::{Method as PowerMethod, State as PowerState};
use fil_actors_runtime::runtime::Policy;
Expand Down Expand Up @@ -63,7 +62,7 @@ fn setup(v: &dyn VM) -> (MinerInfo, SectorInfo) {

// precommit and advance to prove commit time
let sector_number: SectorNumber = 100;
let infos = precommit_sectors_v2(
let _ = precommit_sectors_v2(
v,
1,
1,
Expand All @@ -75,7 +74,6 @@ fn setup(v: &dyn VM) -> (MinerInfo, SectorInfo) {
true,
None,
);
let pc = &infos[0];

let balances = miner_balance(v, &id_addr);
assert!(balances.pre_commit_deposit.is_positive());
Expand Down
12 changes: 6 additions & 6 deletions integration_tests/src/tests/replica_update_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ use fil_actor_market::Method as MarketMethod;
use fil_actor_market::State as MarketState;
use fil_actor_miner::{
power_for_sector, DisputeWindowedPoStParams, ExpirationExtension, ExtendSectorExpirationParams,
Method as MinerMethod, PowerPair, ProveReplicaUpdatesParams,
ReplicaUpdate, SectorOnChainInfo, SectorOnChainInfoFlags, Sectors, State as MinerState,
TerminateSectorsParams, TerminationDeclaration, SECTORS_AMT_BITWIDTH,
Method as MinerMethod, PowerPair, ProveReplicaUpdatesParams, ReplicaUpdate, SectorOnChainInfo,
SectorOnChainInfoFlags, Sectors, State as MinerState, TerminateSectorsParams,
TerminationDeclaration, SECTORS_AMT_BITWIDTH,
};
use fil_actor_verifreg::Method as VerifregMethod;
use fil_actors_runtime::runtime::Policy;
Expand All @@ -36,9 +36,9 @@ use crate::util::{
assert_invariants, bf_all, check_sector_active, check_sector_faulty, create_accounts,
create_miner, cron_tick, deadline_state, declare_recovery, expect_invariants, get_deal_weights,
get_network_stats, invariant_failure_patterns, make_bitfield, market_publish_deal,
miner_balance, miner_power, override_compute_unsealed_sector_cid, precommit_sectors_v2,
prove_commit_sectors, sector_info, submit_invalid_post, submit_windowed_post,
verifreg_add_client, verifreg_add_verifier, miner_prove_sector
miner_balance, miner_power, miner_prove_sector, override_compute_unsealed_sector_cid,
precommit_sectors_v2, prove_commit_sectors, sector_info, submit_invalid_post,
submit_windowed_post, verifreg_add_client, verifreg_add_verifier,
};

#[vm_test]
Expand Down
8 changes: 4 additions & 4 deletions integration_tests/src/tests/terminate_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use fil_actor_market::{
DealMetaArray, Method as MarketMethod, State as MarketState, WithdrawBalanceParams,
};
use fil_actor_miner::{
power_for_sector, Method as MinerMethod, State as MinerState,
TerminateSectorsParams, TerminationDeclaration,
power_for_sector, Method as MinerMethod, State as MinerState, TerminateSectorsParams,
TerminationDeclaration,
};
use fil_actor_power::State as PowerState;
use fil_actor_verifreg::{Method as VerifregMethod, VerifierParams};
Expand All @@ -33,8 +33,8 @@ use crate::util::{
advance_by_deadline_to_epoch, advance_by_deadline_to_epoch_while_proving,
advance_to_proving_deadline, assert_invariants, create_accounts, create_miner, cron_tick,
deal_cid_for_testing, make_bitfield, market_publish_deal, miner_balance,
miner_precommit_one_sector_v2, precommit_meta_data_from_deals, submit_windowed_post,
verifreg_add_verifier, miner_prove_sector
miner_precommit_one_sector_v2, miner_prove_sector, precommit_meta_data_from_deals,
submit_windowed_post, verifreg_add_verifier,
};

#[vm_test]
Expand Down
8 changes: 4 additions & 4 deletions integration_tests/src/util/workflows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ use fil_actor_miner::{
max_prove_commit_duration, ChangeBeneficiaryParams, CompactCommD, DeadlineInfo,
DeclareFaultsRecoveredParams, ExpirationExtension2, ExtendSectorExpiration2Params,
Method as MinerMethod, PoStPartition, PowerPair, PreCommitSectorBatchParams2,
ProveCommitAggregateParams, ProveCommitSectors3Params, RecoveryDeclaration, SectorClaim,
SectorPreCommitInfo, SectorPreCommitOnChainInfo, State as MinerState, SubmitWindowedPoStParams,
WithdrawBalanceParams, WithdrawBalanceReturn, SectorActivationManifest
ProveCommitAggregateParams, ProveCommitSectors3Params, RecoveryDeclaration,
SectorActivationManifest, SectorClaim, SectorPreCommitInfo, SectorPreCommitOnChainInfo,
State as MinerState, SubmitWindowedPoStParams, WithdrawBalanceParams, WithdrawBalanceReturn,
};
use fil_actor_multisig::Method as MultisigMethod;
use fil_actor_multisig::ProposeParams;
Expand Down Expand Up @@ -167,7 +167,7 @@ pub fn miner_prove_sector(
sector_number: SectorNumber,
) {
let prove_commit_params = ProveCommitSectors3Params {
sector_activations: vec![SectorActivationManifest{sector_number, pieces: vec![]}],
sector_activations: vec![SectorActivationManifest { sector_number, pieces: vec![] }],
sector_proofs: vec![vec![].into()],
aggregate_proof: RawBytes::default(),
aggregate_proof_type: None,
Expand Down

0 comments on commit 1bb6111

Please sign in to comment.