Skip to content

Commit

Permalink
[executor] trivial: use ref in gen_ledger_info_with_sigs
Browse files Browse the repository at this point in the history
  • Loading branch information
msmouse authored and bors-libra committed Jun 4, 2021
1 parent c4af0ec commit ec0f780
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion execution/execution-correctness/src/tests/suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn run_test_suite(executor_pair: (Box<dyn ExecutionCorrectness>, Option<Ed25
.unwrap();
}

let ledger_info_with_sigs = gen_ledger_info_with_sigs(1, result, block_id, vec![&signer]);
let ledger_info_with_sigs = gen_ledger_info_with_sigs(1, &result, block_id, vec![&signer]);
let (_, _) = executor
.commit_blocks(vec![block_id], ledger_info_with_sigs)
.unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ pub fn test_execution_with_storage_impl() -> Arc<DiemDB> {
let output2 = executor
.execute_block((block2_id, block2.clone()), block1_id)
.unwrap();
let ledger_info_with_sigs = gen_ledger_info_with_sigs(1, output2, block2_id, vec![&signer]);
let ledger_info_with_sigs = gen_ledger_info_with_sigs(1, &output2, block2_id, vec![&signer]);
executor
.commit_blocks(vec![block2_id], ledger_info_with_sigs)
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion execution/executor-test-helpers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub fn gen_block_id(index: u8) -> HashValue {

pub fn gen_ledger_info_with_sigs(
epoch: u64,
output: StateComputeResult,
output: &StateComputeResult,
commit_block_id: HashValue,
signer: Vec<&ValidatorSigner>,
) -> LedgerInfoWithSignatures {
Expand Down
2 changes: 1 addition & 1 deletion execution/executor/tests/db_bootstrapper_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn execute_and_commit(txns: Vec<Transaction>, db: &DbReaderWriter, signer: &Vali
.execute_block((block_id, txns), executor.committed_block_id())
.unwrap();
assert_eq!(output.num_leaves(), target_version + 1);
let ledger_info_with_sigs = gen_ledger_info_with_sigs(epoch, output, block_id, vec![&signer]);
let ledger_info_with_sigs = gen_ledger_info_with_sigs(epoch, &output, block_id, vec![&signer]);
executor
.commit_blocks(vec![block_id], ledger_info_with_sigs)
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion execution/executor/tests/storage_integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ fn test_change_publishing_option_to_custom() {
.execute_block((block2_id, block2.clone()), executor.committed_block_id())
.unwrap();

let ledger_info_with_sigs = gen_ledger_info_with_sigs(2, output2, block2_id, vec![&signer]);
let ledger_info_with_sigs = gen_ledger_info_with_sigs(2, &output2, block2_id, vec![&signer]);
let (_, reconfig_events) = executor
.commit_blocks(vec![block2_id], ledger_info_with_sigs)
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion state-sync/src/executor_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ mod tests {

// Commit block
let ledger_info_with_sigs =
gen_ledger_info_with_sigs(block_id.into(), output, block_hash, vec![]);
gen_ledger_info_with_sigs(block_id.into(), &output, block_hash, vec![]);
let (_, reconfig_events) = block_executor
.commit_blocks(vec![block_hash], ledger_info_with_sigs.clone())
.unwrap();
Expand Down

0 comments on commit ec0f780

Please sign in to comment.