Fix some random typos, formatting/whitespace (#11128)
* Fix some random typos, formatting/whitespace * Remove unecessary lifetime annotations * Revert "Remove unecessary lifetime annotations" This reverts commit 2357ccc3743a234e3181a79aff825370461543bf.
This commit is contained in:
parent
4fd1ec643f
commit
b31bff5ce2
@ -487,17 +487,17 @@ pub trait ChainNotify: Send + Sync {
|
|||||||
|
|
||||||
/// Provides a method for importing/exporting blocks
|
/// Provides a method for importing/exporting blocks
|
||||||
pub trait ImportExportBlocks {
|
pub trait ImportExportBlocks {
|
||||||
/// Export blocks to destination, with the given from, to and format argument.
|
/// Export blocks to destination, with the given from, to and format argument.
|
||||||
/// destination could be a file or stdout.
|
/// destination could be a file or stdout.
|
||||||
/// If the format is hex, each block is written on a new line.
|
/// If the format is hex, each block is written on a new line.
|
||||||
/// For binary exports, all block data is written to the same line.
|
/// For binary exports, all block data is written to the same line.
|
||||||
fn export_blocks<'a>(
|
fn export_blocks<'a>(
|
||||||
&self,
|
&self,
|
||||||
destination: Box<dyn std::io::Write + 'a>,
|
destination: Box<dyn std::io::Write + 'a>,
|
||||||
from: BlockId,
|
from: BlockId,
|
||||||
to: BlockId,
|
to: BlockId,
|
||||||
format: Option<DataFormat>
|
format: Option<DataFormat>
|
||||||
) -> Result<(), String>;
|
) -> Result<(), String>;
|
||||||
|
|
||||||
/// Import blocks from destination, with the given format argument
|
/// Import blocks from destination, with the given format argument
|
||||||
/// Source could be a file or stdout.
|
/// Source could be a file or stdout.
|
||||||
|
@ -806,7 +806,13 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> {
|
|||||||
pub fn transact<T, V>(&'a mut self, t: &SignedTransaction, options: TransactOptions<T, V>)
|
pub fn transact<T, V>(&'a mut self, t: &SignedTransaction, options: TransactOptions<T, V>)
|
||||||
-> Result<Executed<T::Output, V::Output>, ExecutionError> where T: Tracer, V: VMTracer,
|
-> Result<Executed<T::Output, V::Output>, ExecutionError> where T: Tracer, V: VMTracer,
|
||||||
{
|
{
|
||||||
self.transact_with_tracer(t, options.check_nonce, options.output_from_init_contract, options.tracer, options.vm_tracer)
|
self.transact_with_tracer(
|
||||||
|
t,
|
||||||
|
options.check_nonce,
|
||||||
|
options.output_from_init_contract,
|
||||||
|
options.tracer,
|
||||||
|
options.vm_tracer
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Execute a transaction in a "virtual" context.
|
/// Execute a transaction in a "virtual" context.
|
||||||
@ -1142,7 +1148,7 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> {
|
|||||||
let suicide_refunds = U256::from(schedule.suicide_refund_gas) * U256::from(substate.suicides.len());
|
let suicide_refunds = U256::from(schedule.suicide_refund_gas) * U256::from(substate.suicides.len());
|
||||||
let refunds_bound = sstore_refunds + suicide_refunds;
|
let refunds_bound = sstore_refunds + suicide_refunds;
|
||||||
|
|
||||||
// real ammount to refund
|
// real amount to refund
|
||||||
let gas_left_prerefund = match result { Ok(FinalizationResult{ gas_left, .. }) => gas_left, _ => 0.into() };
|
let gas_left_prerefund = match result { Ok(FinalizationResult{ gas_left, .. }) => gas_left, _ => 0.into() };
|
||||||
let refunded = cmp::min(refunds_bound, (t.gas - gas_left_prerefund) >> 1);
|
let refunded = cmp::min(refunds_bound, (t.gas - gas_left_prerefund) >> 1);
|
||||||
let gas_left = gas_left_prerefund + refunded;
|
let gas_left = gas_left_prerefund + refunded;
|
||||||
@ -1155,14 +1161,14 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
trace!("exec::finalize: t.gas={}, sstore_refunds={}, suicide_refunds={}, refunds_bound={}, gas_left_prerefund={}, refunded={}, gas_left={}, gas_used={}, refund_value={}, fees_value={}\n",
|
trace!(target: "executive", "exec::finalize: t.gas={}, sstore_refunds={}, suicide_refunds={}, refunds_bound={}, gas_left_prerefund={}, refunded={}, gas_left={}, gas_used={}, refund_value={}, fees_value={}\n",
|
||||||
t.gas, sstore_refunds, suicide_refunds, refunds_bound, gas_left_prerefund, refunded, gas_left, gas_used, refund_value, fees_value);
|
t.gas, sstore_refunds, suicide_refunds, refunds_bound, gas_left_prerefund, refunded, gas_left, gas_used, refund_value, fees_value);
|
||||||
|
|
||||||
let sender = t.sender();
|
let sender = t.sender();
|
||||||
trace!("exec::finalize: Refunding refund_value={}, sender={}\n", refund_value, sender);
|
trace!(target: "executive", "exec::finalize: Refunding refund_value={}, sender={}\n", refund_value, sender);
|
||||||
// Below: NoEmpty is safe since the sender must already be non-null to have sent this transaction
|
// Below: NoEmpty is safe since the sender must already be non-null to have sent this transaction
|
||||||
self.state.add_balance(&sender, &refund_value, CleanupMode::NoEmpty)?;
|
self.state.add_balance(&sender, &refund_value, CleanupMode::NoEmpty)?;
|
||||||
trace!("exec::finalize: Compensating author: fees_value={}, author={}\n", fees_value, &self.info.author);
|
trace!(target: "executive", "exec::finalize: Compensating author: fees_value={}, author={}\n", fees_value, &self.info.author);
|
||||||
self.state.add_balance(&self.info.author, &fees_value, cleanup_mode(&mut substate, &schedule))?;
|
self.state.add_balance(&self.info.author, &fees_value, cleanup_mode(&mut substate, &schedule))?;
|
||||||
|
|
||||||
// perform suicides
|
// perform suicides
|
||||||
|
Loading…
Reference in New Issue
Block a user