--- a/primitives/common/src/types.rs +++ b/primitives/common/src/types.rs @@ -48,13 +48,6 @@ + Send + Sync + 'static; - - type TransactionConverter: fp_rpc::ConvertTransaction - + Send - + Sync - + 'static; - - fn get_transaction_converter() -> Self::TransactionConverter; } } --- a/runtime/common/ethereum/mod.rs +++ b/runtime/common/ethereum/mod.rs @@ -17,4 +17,3 @@ pub mod precompiles; pub mod self_contained_call; pub mod sponsoring; -pub mod transaction_converter; --- a/runtime/common/ethereum/transaction_converter.rs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -use codec::{Encode, Decode}; -use crate::{opaque, Runtime, UncheckedExtrinsic}; - -pub struct TransactionConverter; - -impl fp_rpc::ConvertTransaction for TransactionConverter { - fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic { - UncheckedExtrinsic::new_unsigned( - pallet_ethereum::Call::::transact { transaction }.into(), - ) - } -} - -impl fp_rpc::ConvertTransaction for TransactionConverter { - fn convert_transaction( - &self, - transaction: pallet_ethereum::Transaction, - ) -> opaque::UncheckedExtrinsic { - let extrinsic = UncheckedExtrinsic::new_unsigned( - pallet_ethereum::Call::::transact { transaction }.into(), - ); - let encoded = extrinsic.encode(); - opaque::UncheckedExtrinsic::decode(&mut &encoded[..]) - .expect("Encoded extrinsic is always valid") - } -} --- a/runtime/common/instance.rs +++ b/runtime/common/instance.rs @@ -1,6 +1,6 @@ use crate::{ runtime_common::{ - config::ethereum::CrossAccountId, ethereum::transaction_converter::TransactionConverter, + config::ethereum::CrossAccountId, }, Runtime, }; @@ -8,9 +8,4 @@ impl RuntimeInstance for Runtime { type CrossAccountId = CrossAccountId; - type TransactionConverter = TransactionConverter; - - fn get_transaction_converter() -> TransactionConverter { - TransactionConverter - } }