diff --git a/src/ethereum/ethash.rs b/src/ethereum/ethash.rs index 6ab49c1ac..13d7b1af3 100644 --- a/src/ethereum/ethash.rs +++ b/src/ethereum/ethash.rs @@ -152,6 +152,7 @@ impl Engine for Ethash { } } +#[allow(wrong_self_convention)] // to_ethash should take self impl Ethash { fn calculate_difficuty(&self, header: &Header, parent: &Header) -> U256 { const EXP_DIFF_PERIOD: u64 = 100000; diff --git a/src/executive.rs b/src/executive.rs index e0f35d712..7671f3cc9 100644 --- a/src/executive.rs +++ b/src/executive.rs @@ -75,7 +75,7 @@ impl<'a> Executive<'a> { } /// Creates `Externalities` from `Executive`. - pub fn to_externalities<'_>(&'_ mut self, origin_info: OriginInfo, substate: &'_ mut Substate, output: OutputPolicy<'_>) -> Externalities { + pub fn as_externalities<'_>(&'_ mut self, origin_info: OriginInfo, substate: &'_ mut Substate, output: OutputPolicy<'_>) -> Externalities { Externalities::new(self.state, self.info, self.engine, self.depth, origin_info, substate, output) } @@ -198,7 +198,7 @@ impl<'a> Executive<'a> { let mut unconfirmed_substate = Substate::new(); let res = { - let mut ext = self.to_externalities(OriginInfo::from(¶ms), &mut unconfirmed_substate, OutputPolicy::Return(output)); + let mut ext = self.as_externalities(OriginInfo::from(¶ms), &mut unconfirmed_substate, OutputPolicy::Return(output)); self.engine.vm_factory().create().exec(params, &mut ext) }; @@ -230,7 +230,7 @@ impl<'a> Executive<'a> { self.state.transfer_balance(¶ms.sender, ¶ms.address, ¶ms.value); let res = { - let mut ext = self.to_externalities(OriginInfo::from(¶ms), &mut unconfirmed_substate, OutputPolicy::InitContract); + let mut ext = self.as_externalities(OriginInfo::from(¶ms), &mut unconfirmed_substate, OutputPolicy::InitContract); self.engine.vm_factory().create().exec(params, &mut ext) }; self.enact_result(&res, substate, unconfirmed_substate, backup); diff --git a/src/spec.rs b/src/spec.rs index 363fd9a49..95f2d9a23 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -93,10 +93,10 @@ pub struct Spec { state_root_memo: RwLock>, } +#[allow(wrong_self_convention)] // because to_engine(self) should be to_engine(&self) impl Spec { /// Convert this object into a boxed Engine of the right underlying type. // TODO avoid this hard-coded nastiness - use dynamic-linked plugin framework instead. - #[allow(wrong_self_convention)] pub fn to_engine(self) -> Result, Error> { match self.engine_name.as_ref() { "NullEngine" => Ok(NullEngine::new_boxed(self)),