Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
gitofdeepanshu committed Nov 7, 2023
1 parent 183613c commit c8de067
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
3 changes: 2 additions & 1 deletion pallets/unified-accounts/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ fn account_claim_should_work() {

// transfer some funds to alice_eth (H160)
assert_ok!(Balances::transfer_allow_death(
RuntimeOrigin::signed(BOB), alice_eth_old_account.clone().into(),
RuntimeOrigin::signed(BOB),
alice_eth_old_account.clone().into(),
1001
));

Expand Down
10 changes: 2 additions & 8 deletions precompiles/unified-accounts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@

use astar_primitives::evm::{UnifiedAddress, UnifiedAddressMapper};
use core::marker::PhantomData;
use fp_evm::{ExitError, Precompile, PrecompileFailure};
use fp_evm::Precompile;
use fp_evm::{PrecompileHandle, PrecompileOutput};
use frame_support::dispatch::Dispatchable;
use frame_system::Account;
use pallet_evm::ExitFatal;
use precompile_utils::{
revert, succeed, Address, Bytes, EvmDataWriter, EvmResult, FunctionModifier,
PrecompileHandleExt,
succeed, Address, EvmDataWriter, EvmResult, FunctionModifier, PrecompileHandleExt,
};
use sp_core::{crypto::AccountId32, H160, H256};

Check failure on line 29 in precompiles/unified-accounts/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

unused import: `H160`

error: unused import: `H160` --> precompiles/unified-accounts/src/lib.rs:29:36 | 29 | use sp_core::{crypto::AccountId32, H160, H256}; | ^^^^ | = note: `-D unused-imports` implied by `-D warnings`
use sp_std::prelude::*;
Expand All @@ -37,9 +34,6 @@ mod mock;
#[cfg(test)]
mod tests;

/// Dummy H160 address representing no mapping
const DEFAULT_ADDRESS: H160 = H160::zero();

#[precompile_utils::generate_function_selector]
#[derive(Debug, PartialEq)]
pub enum Action {
Expand Down
9 changes: 0 additions & 9 deletions precompiles/utils/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use alloc::borrow::ToOwned;
use core::{any::type_name, marker::PhantomData, ops::Range};
use impl_trait_for_tuples::impl_for_tuples;
use sp_core::{Get, H160, H256, U256};
use sp_runtime::AccountId32;
use sp_std::{convert::TryInto, vec, vec::Vec};

/// The `address` type of Solidity.
Expand Down Expand Up @@ -84,14 +83,6 @@ impl From<Bytes> for Vec<u8> {
}
}

impl From<AccountId32> for Bytes {
fn from(a: AccountId32) -> Self {
// TODO: use some better way to do this
let raw_bytes: &[u8; 32] = a.as_ref();
raw_bytes.as_ref().into()
}
}

/// Wrapper around an EVM input slice, helping to parse it.
/// Provide functions to parse common types.
#[derive(Clone, Copy, Debug)]
Expand Down

0 comments on commit c8de067

Please sign in to comment.