difftreelog
style fix clippy warnings
in: master
7 files changed
crates/evm-coder-macros/src/lib.rsdiffbeforeafterboth--- a/crates/evm-coder-macros/src/lib.rs
+++ b/crates/evm-coder-macros/src/lib.rs
@@ -5,7 +5,10 @@
use proc_macro::TokenStream;
use quote::quote;
use sha3::{Digest, Keccak256};
-use syn::{AttributeArgs, DeriveInput, GenericArgument, Ident, ItemImpl, Pat, Path, PathArguments, PathSegment, Type, parse_macro_input, spanned::Spanned};
+use syn::{
+ AttributeArgs, DeriveInput, GenericArgument, Ident, ItemImpl, Pat, Path, PathArguments,
+ PathSegment, Type, parse_macro_input, spanned::Spanned,
+};
mod solidity_interface;
mod to_log;
@@ -196,11 +199,12 @@
Err(e) => e.to_compile_error(),
};
- (quote! {
- #input
+ (quote! {
+ #input
- #expanded
- }).into()
+ #expanded
+ })
+ .into()
}
#[proc_macro_attribute]
crates/evm-coder/src/lib.rsdiffbeforeafterboth1#![cfg_attr(not(feature = "std"), no_std)]2#[cfg(not(feature = "std"))]3extern crate alloc;45use abi::{AbiReader, AbiWriter};6pub use evm_coder_macros::{event_topic, fn_selector, solidity_interface, solidity, ToLog};7pub mod abi;8pub mod events;9pub use events::ToLog;10pub mod execution;11pub mod solidity;1213/// Solidity type definitions14pub mod types {15 #![allow(non_camel_case_types)]1617 #[cfg(not(feature = "std"))]18 use alloc::{vec::Vec};19 use primitive_types::{U256, H160, H256};2021 pub type address = H160;2223 pub type uint8 = u8;24 pub type uint16 = u16;25 pub type uint32 = u32;26 pub type uint64 = u64;27 pub type uint128 = u128;28 pub type uint256 = U256;2930 pub type bytes4 = u32;3132 pub type topic = H256;3334 #[cfg(not(feature = "std"))]35 pub type string = ::alloc::string::String;36 #[cfg(feature = "std")]37 pub type string = ::std::string::String;38 pub type bytes = Vec<u8>;3940 pub type void = ();4142 //#region Special types43 /// Makes function payable44 pub type value = U256;45 /// Makes function caller-sensitive46 pub type caller = address;47 //#endregion4849 pub struct Msg<C> {50 pub call: C,51 pub caller: H160,52 pub value: U256,53 }54}5556pub trait Call: Sized {57 fn parse(selector: u32, input: &mut AbiReader) -> execution::Result<Option<Self>>;58}5960pub trait Callable<C: Call> {61 fn call(&mut self, call: types::Msg<C>) -> execution::Result<AbiWriter>;62}6364#[cfg(test)]65mod tests {66 use super::*;6768 #[test]69 fn function_selector_generation() {70 assert_eq!(fn_selector!(transfer(address, uint256)), 0xa9059cbb);71 }7273 #[test]74 fn event_topic_generation() {75 assert_eq!(76 hex::encode(&event_topic!(Transfer(address, address, uint256))[..]),77 "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",78 );79 }80}crates/evm-coder/src/solidity.rsdiffbeforeafterboth--- a/crates/evm-coder/src/solidity.rs
+++ b/crates/evm-coder/src/solidity.rs
@@ -186,4 +186,4 @@
writeln!(out, "}}")?;
Ok(())
}
-}
\ No newline at end of file
+}
crates/evm-coder/tests/a.rsdiffbeforeafterboth--- a/crates/evm-coder/tests/a.rs
+++ b/crates/evm-coder/tests/a.rs
@@ -8,33 +8,38 @@
#[solidity_interface(name = "OurInterface")]
impl Impls {
fn fn_a(&self, input: uint256) -> Result<bool> {
- todo!()
- }
+ todo!()
+ }
}
#[solidity_interface(name = "OurInterface1")]
impl Impls {
fn fn_b(&self, input: uint128) -> Result<uint32> {
- todo!()
- }
+ todo!()
+ }
}
-#[solidity_interface(name = "OurInterface2", is(OurInterface), inline_is(OurInterface1), events(ERC721Log))]
+#[solidity_interface(
+ name = "OurInterface2",
+ is(OurInterface),
+ inline_is(OurInterface1),
+ events(ERC721Log)
+)]
impl Impls {
#[solidity(rename_selector = "fnK")]
fn fn_c(&self, input: uint32) -> Result<uint8> {
- todo!()
- }
+ todo!()
+ }
fn fn_d(&self, value: uint32) -> Result<uint32> {
- todo!()
- }
+ todo!()
+ }
fn caller_sensitive(&self, caller: caller) -> Result<uint8> {
- todo!()
- }
+ todo!()
+ }
fn payable(&mut self, value: value) -> Result<uint8> {
- todo!()
- }
+ todo!()
+ }
}
#[derive(ToLog)]
@@ -58,14 +63,14 @@
#[solidity_interface(name = "ERC20")]
impl ERC20 {
fn decimals(&self) -> Result<uint8> {
- todo!()
- }
+ todo!()
+ }
fn balance_of(&self, owner: address) -> Result<uint256> {
- todo!()
- }
+ todo!()
+ }
fn transfer(&mut self, caller: caller, to: address, value: uint256) -> Result<bool> {
- todo!()
- }
+ todo!()
+ }
fn transfer_from(
&mut self,
caller: caller,
@@ -73,12 +78,13 @@
to: address,
value: uint256,
) -> Result<bool> {
- todo!()
- }
+ todo!()
+ }
fn approve(&mut self, caller: caller, spender: address, value: uint256) -> Result<bool> {
- todo!()
- }
+ todo!()
+ }
fn allowance(&self, owner: address, spender: address) -> Result<uint256> {
- todo!()
- }
+ todo!()
+ }
}
+
node/cli/src/service.rsdiffbeforeafterboth--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -304,7 +304,7 @@
nft_rpc::create_full::<_, _, _, RuntimeApi, _>(full_deps, subscription_executor.clone())
});
-
+
task_manager.spawn_essential_handle().spawn(
"frontier-mapping-sync-worker",
MappingSyncWorker::new(
@@ -313,7 +313,8 @@
client.clone(),
backend.clone(),
frontier_backend.clone(),
- ).for_each(|()| futures::future::ready(()))
+ )
+ .for_each(|()| futures::future::ready(())),
);
sc_service::spawn_tasks(sc_service::SpawnTasksParams {
pallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -136,7 +136,7 @@
let limit = <SponsoringRateLimit<T>>::get(&call.0);
if let Some(last_tx_block) = <SponsorBasket<T>>::get(&call.0, who) {
<SponsorBasket<T>>::insert(&call.0, who, block_number);
- let limit_time = last_tx_block + limit.into();
+ let limit_time = last_tx_block + limit;
if block_number > limit_time {
return Some(call.0);
}
runtime/src/lib.rsdiffbeforeafterboth--- a/runtime/src/lib.rs
+++ b/runtime/src/lib.rs
@@ -281,7 +281,7 @@
impl pallet_ethereum::Config for Runtime {
type Event = Event;
type StateRoot = pallet_ethereum::IntermediateStateRoot;
- type EvmSubmitLog = pallet_evm::Pallet<Runtime>;
+ type EvmSubmitLog = pallet_evm::Pallet<Self>;
}
impl pallet_randomness_collective_flip::Config for Runtime {}
@@ -329,7 +329,7 @@
/// This is used as an identifier of the chain. 42 is the generic substrate prefix.
type SS58Prefix = SS58Prefix;
/// Weight information for the extrinsics of this pallet.
- type SystemWeightInfo = system::weights::SubstrateWeight<Runtime>;
+ type SystemWeightInfo = system::weights::SubstrateWeight<Self>;
/// Version of the runtime.
type Version = Version;
}
@@ -363,7 +363,7 @@
type DustRemoval = Treasury;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
- type WeightInfo = pallet_balances::weights::SubstrateWeight<Runtime>;
+ type WeightInfo = pallet_balances::weights::SubstrateWeight<Self>;
}
pub const MICROUNIQUE: Balance = 1_000_000_000;
@@ -487,7 +487,7 @@
type Burn = Burn;
type BurnDestination = ();
type SpendFunds = ();
- type WeightInfo = pallet_treasury::weights::SubstrateWeight<Runtime>;
+ type WeightInfo = pallet_treasury::weights::SubstrateWeight<Self>;
type MaxApprovals = MaxApprovals;
}
@@ -516,7 +516,7 @@
impl cumulus_pallet_parachain_system::Config for Runtime {
type Event = Event;
type OnValidationData = ();
- type SelfParaId = parachain_info::Pallet<Runtime>;
+ type SelfParaId = parachain_info::Pallet<Self>;
// type DownwardMessageHandlers = cumulus_primitives_utility::UnqueuedDmpAsParent<
// MaxDownwardMessageWeight,
// XcmExecutor<XcmConfig>,