claim: update code format
#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Decode, Encode};
use frame_support::{
- traits::Currency,
- decl_error, decl_event, decl_module, decl_storage, dispatch, ensure, RuntimeDebug,
+ decl_error, decl_event, decl_module, decl_storage, dispatch, ensure, traits::Currency,
+ RuntimeDebug,
};
-use frame_system::{ensure_root, ensure_signed, ensure_none};
+use frame_system::{ensure_none, ensure_root, ensure_signed};
#[cfg(feature = "std")]
use serde::{self, Deserialize, Deserializer, Serialize, Serializer};
use sp_io::{crypto::secp256k1_ecdsa_recover, hashing::keccak_256};
+use sp_runtime::transaction_validity::{
+ InvalidTransaction, TransactionLongevity, TransactionSource, TransactionValidity,
+ ValidTransaction,
+};
use sp_std::prelude::*;
-use sp_runtime::{transaction_validity::{
- TransactionLongevity, InvalidTransaction, TransactionSource,
- TransactionValidity, ValidTransaction,
-}};
#[cfg(test)]
mod mock;
@@ -132,7 +132,7 @@ decl_event!(
pub enum Event<T>
where
AccountId = <T as frame_system::Trait>::AccountId,
- Balance = BalanceOf<T>
+ Balance = BalanceOf<T>,
{
/// Event emitted when a transaction has been stored.
ERC20TransactionStored(AccountId, EthereumTxHash, EthereumAddress, Balance),
@@ -247,8 +247,7 @@ impl<T: Trait> Module<T> {
fn eth_recover(s: &EcdsaSignature, what: &[u8], extra: &[u8]) -> Option<EthereumAddress> {
let msg = keccak_256(&Self::ethereum_signable_message(what, extra));
let mut res = EthereumAddress::default();
- res.0
- .copy_from_slice(&keccak_256(&secp256k1_ecdsa_recover(&s.0, &msg).ok()?[..])[12..]);
+ res.0.copy_from_slice(&keccak_256(&secp256k1_ecdsa_recover(&s.0, &msg).ok()?[..])[12..]);
Some(res)
}
}
@@ -288,8 +287,7 @@ impl<T: Trait> frame_support::unsigned::ValidateUnsigned for Module<T> {
let e = InvalidTransaction::Custom(ValidityError::TxHashNotFound.into());
ensure!(BurnedTransactions::<T>::contains_key(&tx_hash), e);
- let signer = maybe_signer
- .ok_or(InvalidTransaction::BadProof)?;
+ let signer = maybe_signer.ok_or(InvalidTransaction::BadProof)?;
let e = InvalidTransaction::Custom(ValidityError::InvalidSigner.into());
let stored_tx = BurnedTransactions::<T>::get(&tx_hash);
