Skip to content

Commit

Permalink
[State Sync] Remove clone() calls for storage synchronizer.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLind committed Oct 2, 2024
1 parent 7003c73 commit 6c5ef3a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions state-sync/state-sync-driver/src/bootstrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ impl<
BootstrappingMode::ApplyTransactionOutputsFromGenesis => {
if let Some(transaction_outputs_with_proof) = transaction_outputs_with_proof {
utils::apply_transaction_outputs(
self.storage_synchronizer.clone(),
&mut self.storage_synchronizer,
notification_metadata,
proof_ledger_info,
end_of_epoch_ledger_info,
Expand All @@ -1198,7 +1198,7 @@ impl<
BootstrappingMode::ExecuteTransactionsFromGenesis => {
if let Some(transaction_list_with_proof) = transaction_list_with_proof {
utils::execute_transactions(
self.storage_synchronizer.clone(),
&mut self.storage_synchronizer,
notification_metadata,
proof_ledger_info,
end_of_epoch_ledger_info,
Expand All @@ -1219,7 +1219,7 @@ impl<
BootstrappingMode::ExecuteOrApplyFromGenesis => {
if let Some(transaction_list_with_proof) = transaction_list_with_proof {
utils::execute_transactions(
self.storage_synchronizer.clone(),
&mut self.storage_synchronizer,
notification_metadata,
proof_ledger_info,
end_of_epoch_ledger_info,
Expand All @@ -1229,7 +1229,7 @@ impl<
} else if let Some(transaction_outputs_with_proof) = transaction_outputs_with_proof
{
utils::apply_transaction_outputs(
self.storage_synchronizer.clone(),
&mut self.storage_synchronizer,
notification_metadata,
proof_ledger_info,
end_of_epoch_ledger_info,
Expand Down
8 changes: 4 additions & 4 deletions state-sync/state-sync-driver/src/continuous_syncer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ impl<
ContinuousSyncingMode::ApplyTransactionOutputs => {
if let Some(transaction_outputs_with_proof) = transaction_outputs_with_proof {
utils::apply_transaction_outputs(
self.storage_synchronizer.clone(),
&mut self.storage_synchronizer,
notification_metadata,
ledger_info_with_signatures.clone(),
None,
Expand All @@ -323,7 +323,7 @@ impl<
ContinuousSyncingMode::ExecuteTransactions => {
if let Some(transaction_list_with_proof) = transaction_list_with_proof {
utils::execute_transactions(
self.storage_synchronizer.clone(),
&mut self.storage_synchronizer,
notification_metadata,
ledger_info_with_signatures.clone(),
None,
Expand All @@ -344,7 +344,7 @@ impl<
ContinuousSyncingMode::ExecuteTransactionsOrApplyOutputs => {
if let Some(transaction_list_with_proof) = transaction_list_with_proof {
utils::execute_transactions(
self.storage_synchronizer.clone(),
&mut self.storage_synchronizer,
notification_metadata,
ledger_info_with_signatures.clone(),
None,
Expand All @@ -354,7 +354,7 @@ impl<
} else if let Some(transaction_outputs_with_proof) = transaction_outputs_with_proof
{
utils::apply_transaction_outputs(
self.storage_synchronizer.clone(),
&mut self.storage_synchronizer,
notification_metadata,
ledger_info_with_signatures.clone(),
None,
Expand Down
8 changes: 4 additions & 4 deletions state-sync/state-sync-driver/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ pub fn update_new_epoch_metrics() {

/// Executes the given list of transactions and
/// returns the number of transactions in the list.
pub async fn execute_transactions<StorageSyncer: StorageSynchronizerInterface + Clone>(
mut storage_synchronizer: StorageSyncer,
pub async fn execute_transactions<StorageSyncer: StorageSynchronizerInterface>(
storage_synchronizer: &mut StorageSyncer,
notification_metadata: NotificationMetadata,
proof_ledger_info: LedgerInfoWithSignatures,
end_of_epoch_ledger_info: Option<LedgerInfoWithSignatures>,
Expand All @@ -397,8 +397,8 @@ pub async fn execute_transactions<StorageSyncer: StorageSynchronizerInterface +

/// Applies the given list of transaction outputs and
/// returns the number of outputs in the list.
pub async fn apply_transaction_outputs<StorageSyncer: StorageSynchronizerInterface + Clone>(
mut storage_synchronizer: StorageSyncer,
pub async fn apply_transaction_outputs<StorageSyncer: StorageSynchronizerInterface>(
storage_synchronizer: &mut StorageSyncer,
notification_metadata: NotificationMetadata,
proof_ledger_info: LedgerInfoWithSignatures,
end_of_epoch_ledger_info: Option<LedgerInfoWithSignatures>,
Expand Down

0 comments on commit 6c5ef3a

Please sign in to comment.