Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
tao-stones committed Aug 10, 2021
1 parent 6e93fca commit a3e08b4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions core/src/cost_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl CostModel {
self.transaction_cost.account_access_cost += account_write_cost();
} else {
self.transaction_cost.account_access_cost += account_read_cost();
}
}
});
debug!(
"transaction {:?} has cost {:?}",
Expand Down Expand Up @@ -390,9 +390,8 @@ mod tests {
.try_into()
.unwrap();

let expected_account_cost = account_write_cost()
+ account_write_cost()
+ account_read_cost();
let expected_account_cost =
account_write_cost() + account_write_cost() + account_read_cost();
let expected_execution_cost = 8;

let mut cost_model = CostModel::default();
Expand Down Expand Up @@ -447,9 +446,8 @@ mod tests {
);

let number_threads = 10;
let expected_account_cost = account_write_cost()
+ account_write_cost() * 2
+ account_read_cost() * 2;
let expected_account_cost =
account_write_cost() + account_write_cost() * 2 + account_read_cost() * 2;
let cost1 = 100;
let cost2 = 200;
// execution cost can be either 2 * Default (before write) or cost1+cost2 (after write)
Expand Down

0 comments on commit a3e08b4

Please sign in to comment.