chore: cargo fmt
This commit is contained in:
committed by
Michael Vines
parent
6514096a67
commit
789f33e8db
@@ -1889,13 +1889,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
|
||||
pubkey,
|
||||
output_file,
|
||||
use_lamports_unit,
|
||||
} => process_show_account(
|
||||
&rpc_client,
|
||||
config,
|
||||
pubkey,
|
||||
output_file,
|
||||
*use_lamports_unit,
|
||||
),
|
||||
} => process_show_account(&rpc_client, config, pubkey, output_file, *use_lamports_unit),
|
||||
CliCommand::Transfer {
|
||||
amount,
|
||||
to,
|
||||
|
@@ -218,13 +218,7 @@ impl Tower {
|
||||
)
|
||||
.clone();
|
||||
|
||||
Self::new(
|
||||
my_pubkey,
|
||||
vote_account,
|
||||
root,
|
||||
&heaviest_bank,
|
||||
ledger_path,
|
||||
)
|
||||
Self::new(my_pubkey, vote_account, root, &heaviest_bank, ledger_path)
|
||||
}
|
||||
|
||||
pub(crate) fn collect_vote_lockouts<F>(
|
||||
|
@@ -754,12 +754,7 @@ impl ReplayStage {
|
||||
)
|
||||
};
|
||||
|
||||
Self::initialize_progress_and_fork_choice(
|
||||
&root_bank,
|
||||
frozen_banks,
|
||||
my_pubkey,
|
||||
vote_account,
|
||||
)
|
||||
Self::initialize_progress_and_fork_choice(&root_bank, frozen_banks, my_pubkey, vote_account)
|
||||
}
|
||||
|
||||
pub(crate) fn initialize_progress_and_fork_choice(
|
||||
@@ -777,14 +772,7 @@ impl ReplayStage {
|
||||
let prev_leader_slot = progress.get_bank_prev_leader_slot(bank);
|
||||
progress.insert(
|
||||
bank.slot(),
|
||||
ForkProgress::new_from_bank(
|
||||
bank,
|
||||
my_pubkey,
|
||||
vote_account,
|
||||
prev_leader_slot,
|
||||
0,
|
||||
0,
|
||||
),
|
||||
ForkProgress::new_from_bank(bank, my_pubkey, vote_account, prev_leader_slot, 0, 0),
|
||||
);
|
||||
}
|
||||
let root = root_bank.slot();
|
||||
@@ -3107,8 +3095,7 @@ mod tests {
|
||||
let mut entries =
|
||||
entry::create_ticks(bank.ticks_per_slot(), hashes_per_tick, blockhash);
|
||||
let last_entry_hash = entries.last().unwrap().hash;
|
||||
let tx =
|
||||
system_transaction::transfer(genesis_keypair, &keypair.pubkey(), 2, blockhash);
|
||||
let tx = system_transaction::transfer(genesis_keypair, &keypair.pubkey(), 2, blockhash);
|
||||
let trailing_entry = entry::next_entry(&last_entry_hash, 1, vec![tx]);
|
||||
entries.push(trailing_entry);
|
||||
entries_to_test_shreds(entries, slot, slot.saturating_sub(1), true, 0)
|
||||
|
@@ -275,13 +275,7 @@ impl CrdsGossipPush {
|
||||
let need = Self::compute_need(self.num_active, self.active_set.len(), ratio);
|
||||
let mut new_items = HashMap::new();
|
||||
let (weights, peers): (Vec<_>, Vec<_>) = self
|
||||
.push_options(
|
||||
crds,
|
||||
self_id,
|
||||
self_shred_version,
|
||||
stakes,
|
||||
gossip_validators,
|
||||
)
|
||||
.push_options(crds, self_id, self_shred_version, stakes, gossip_validators)
|
||||
.into_iter()
|
||||
.unzip();
|
||||
if peers.is_empty() {
|
||||
|
@@ -448,8 +448,7 @@ impl LocalCluster {
|
||||
let (blockhash, _fee_calculator, _last_valid_slot) = client
|
||||
.get_recent_blockhash_with_commitment(CommitmentConfig::processed())
|
||||
.unwrap();
|
||||
let mut tx =
|
||||
system_transaction::transfer(source_keypair, dest_pubkey, lamports, blockhash);
|
||||
let mut tx = system_transaction::transfer(source_keypair, dest_pubkey, lamports, blockhash);
|
||||
info!(
|
||||
"executing transfer of {} from {} to {}",
|
||||
lamports,
|
||||
|
@@ -2844,10 +2844,7 @@ fn test_hard_fork_invalidates_tower() {
|
||||
thread.join().unwrap();
|
||||
|
||||
// new slots should be rooted after hard-fork cluster relaunch
|
||||
cluster
|
||||
.lock()
|
||||
.unwrap()
|
||||
.check_for_new_roots(16, "hard fork");
|
||||
cluster.lock().unwrap().check_for_new_roots(16, "hard fork");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@@ -311,9 +311,8 @@ impl ExchangeProcessor {
|
||||
|
||||
Self::is_account_unallocated(keyed_accounts[ORDER_INDEX].try_account_ref()?.data())?;
|
||||
|
||||
let mut account = Self::deserialize_account(
|
||||
keyed_accounts[ACCOUNT_INDEX].try_account_ref_mut()?.data(),
|
||||
)?;
|
||||
let mut account =
|
||||
Self::deserialize_account(keyed_accounts[ACCOUNT_INDEX].try_account_ref_mut()?.data())?;
|
||||
|
||||
if &account.owner != keyed_accounts[OWNER_INDEX].unsigned_key() {
|
||||
error!("Signer does not own account");
|
||||
@@ -367,8 +366,7 @@ impl ExchangeProcessor {
|
||||
return Err(InstructionError::InvalidArgument);
|
||||
}
|
||||
|
||||
let order =
|
||||
Self::deserialize_order(keyed_accounts[ORDER_INDEX].try_account_ref()?.data())?;
|
||||
let order = Self::deserialize_order(keyed_accounts[ORDER_INDEX].try_account_ref()?.data())?;
|
||||
|
||||
if &order.owner != keyed_accounts[OWNER_INDEX].unsigned_key() {
|
||||
error!("Signer does not own order");
|
||||
|
@@ -1495,11 +1495,8 @@ impl AccountsDb {
|
||||
.map(|pubkeys: &[Pubkey]| {
|
||||
let mut reclaims = Vec::new();
|
||||
for pubkey in pubkeys {
|
||||
self.accounts_index.clean_rooted_entries(
|
||||
pubkey,
|
||||
&mut reclaims,
|
||||
max_clean_root,
|
||||
);
|
||||
self.accounts_index
|
||||
.clean_rooted_entries(pubkey, &mut reclaims, max_clean_root);
|
||||
}
|
||||
reclaims
|
||||
});
|
||||
@@ -9517,10 +9514,7 @@ pub mod tests {
|
||||
|
||||
let dummy_id1 = 22;
|
||||
let entry1 = Arc::new(AccountStorageEntry::new(
|
||||
dummy_path,
|
||||
dummy_slot,
|
||||
dummy_id1,
|
||||
dummy_size,
|
||||
dummy_path, dummy_slot, dummy_id1, dummy_size,
|
||||
));
|
||||
entry1.alive_bytes.store(8000, Ordering::Relaxed);
|
||||
|
||||
@@ -9531,10 +9525,7 @@ pub mod tests {
|
||||
|
||||
let dummy_id2 = 44;
|
||||
let entry2 = Arc::new(AccountStorageEntry::new(
|
||||
dummy_path,
|
||||
dummy_slot,
|
||||
dummy_id2,
|
||||
dummy_size,
|
||||
dummy_path, dummy_slot, dummy_id2, dummy_size,
|
||||
));
|
||||
entry2.alive_bytes.store(3000, Ordering::Relaxed);
|
||||
candidates
|
||||
@@ -9553,10 +9544,7 @@ pub mod tests {
|
||||
let dummy_size = 4 * PAGE_SIZE;
|
||||
let dummy_id1 = 22;
|
||||
let entry1 = Arc::new(AccountStorageEntry::new(
|
||||
dummy_path,
|
||||
dummy_slot,
|
||||
dummy_id1,
|
||||
dummy_size,
|
||||
dummy_path, dummy_slot, dummy_id1, dummy_size,
|
||||
));
|
||||
entry1.alive_bytes.store(3500, Ordering::Relaxed);
|
||||
|
||||
@@ -11037,18 +11025,12 @@ pub mod tests {
|
||||
|
||||
let dummy_id1 = 22;
|
||||
let entry1 = Arc::new(AccountStorageEntry::new(
|
||||
dummy_path,
|
||||
dummy_slot,
|
||||
dummy_id1,
|
||||
dummy_size,
|
||||
dummy_path, dummy_slot, dummy_id1, dummy_size,
|
||||
));
|
||||
|
||||
let dummy_id2 = 44;
|
||||
let entry2 = Arc::new(AccountStorageEntry::new(
|
||||
dummy_path,
|
||||
dummy_slot,
|
||||
dummy_id2,
|
||||
dummy_size,
|
||||
dummy_path, dummy_slot, dummy_id2, dummy_size,
|
||||
));
|
||||
|
||||
let mut recycle_stores = RecycleStores::default();
|
||||
|
@@ -7320,8 +7320,7 @@ pub(crate) mod tests {
|
||||
.map(move |(_stake_pubkey, stake_account)| (stake_account, vote_account))
|
||||
})
|
||||
.map(|(stake_account, vote_account)| {
|
||||
stake_state::calculate_points(stake_account, vote_account, None, true)
|
||||
.unwrap_or(0)
|
||||
stake_state::calculate_points(stake_account, vote_account, None, true).unwrap_or(0)
|
||||
})
|
||||
.sum();
|
||||
|
||||
|
@@ -308,10 +308,8 @@ impl Message {
|
||||
nonce_account_pubkey: &Pubkey,
|
||||
nonce_authority_pubkey: &Pubkey,
|
||||
) -> Self {
|
||||
let nonce_ix = system_instruction::advance_nonce_account(
|
||||
nonce_account_pubkey,
|
||||
nonce_authority_pubkey,
|
||||
);
|
||||
let nonce_ix =
|
||||
system_instruction::advance_nonce_account(nonce_account_pubkey, nonce_authority_pubkey);
|
||||
instructions.insert(0, nonce_ix);
|
||||
Self::new(&instructions, payer)
|
||||
}
|
||||
|
@@ -76,10 +76,9 @@ fn main() {
|
||||
*/
|
||||
|
||||
}
|
||||
let last_median = get_last_metrics(&"median".to_string(), &db, &name, branch)
|
||||
.unwrap_or_default();
|
||||
let last_deviation =
|
||||
get_last_metrics(&"deviation".to_string(), &db, &name, branch)
|
||||
let last_median =
|
||||
get_last_metrics(&"median".to_string(), &db, &name, branch).unwrap_or_default();
|
||||
let last_deviation = get_last_metrics(&"deviation".to_string(), &db, &name, branch)
|
||||
.unwrap_or_default();
|
||||
|
||||
results.insert(name, (median, deviation, last_median, last_deviation));
|
||||
|
Reference in New Issue
Block a user