Skip to content

Commit d4282ec

Browse files
committed
refactor: ♻️ rename "real" to "used"
1 parent 578ddd0 commit d4282ec

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/standard/gasometer/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ impl GasometerState {
7979
Ok(())
8080
}
8181

82-
/// Record real and floor costs of a transaction.
82+
/// Record used and floor costs of a transaction.
8383
pub fn records_transaction_cost(&mut self, cost: TransactionCost) -> Result<(), ExitError> {
84-
self.record_gas64(cost.real)?;
84+
self.record_gas64(cost.used)?;
8585
self.floor_gas = cost.floor;
8686
Ok(())
8787
}
@@ -955,7 +955,7 @@ enum Transaction {
955955
}
956956

957957
pub struct TransactionCost {
958-
real: u64,
958+
used: u64,
959959
floor: u64,
960960
}
961961

@@ -996,7 +996,7 @@ impl Transaction {
996996
access_list_address_len,
997997
access_list_storage_len,
998998
} => {
999-
let cost = config.gas_transaction_call()
999+
let used = config.gas_transaction_call()
10001000
+ *zero_data_len as u64 * config.gas_transaction_zero_data()
10011001
+ *non_zero_data_len as u64 * config.gas_transaction_non_zero_data()
10021002
+ *access_list_address_len as u64 * config.gas_access_list_address()
@@ -1006,7 +1006,7 @@ impl Transaction {
10061006
+ *zero_data_len as u64 * config.gas_floor_transaction_zero_data()
10071007
+ *non_zero_data_len as u64 * config.gas_floor_transaction_non_zero_data();
10081008

1009-
TransactionCost { real: cost, floor }
1009+
TransactionCost { used, floor }
10101010
}
10111011
Transaction::Create {
10121012
zero_data_len,
@@ -1015,21 +1015,21 @@ impl Transaction {
10151015
access_list_storage_len,
10161016
initcode_cost,
10171017
} => {
1018-
let mut cost = config.gas_transaction_create()
1018+
let mut used = config.gas_transaction_create()
10191019
+ *zero_data_len as u64 * config.gas_transaction_zero_data()
10201020
+ *non_zero_data_len as u64 * config.gas_transaction_non_zero_data()
10211021
+ *access_list_address_len as u64 * config.gas_access_list_address()
10221022
+ *access_list_storage_len as u64 * config.gas_access_list_storage_key();
10231023

10241024
if config.max_initcode_size().is_some() {
1025-
cost += initcode_cost;
1025+
used += initcode_cost;
10261026
}
10271027

10281028
let floor = config.gas_transaction_call()
10291029
+ *zero_data_len as u64 * config.gas_floor_transaction_zero_data()
10301030
+ *non_zero_data_len as u64 * config.gas_floor_transaction_non_zero_data();
10311031

1032-
TransactionCost { real: cost, floor }
1032+
TransactionCost { used, floor }
10331033
}
10341034
}
10351035
}

0 commit comments

Comments
 (0)