difftreelog
refactor drop TransactionConverter support
in: master
4 files changed
primitives/common/src/types.rsdiffbeforeafterboth--- a/primitives/common/src/types.rs
+++ b/primitives/common/src/types.rs
@@ -48,13 +48,6 @@
+ Send
+ Sync
+ 'static;
-
- type TransactionConverter: fp_rpc::ConvertTransaction<UncheckedExtrinsic>
- + Send
- + Sync
- + 'static;
-
- fn get_transaction_converter() -> Self::TransactionConverter;
}
}
runtime/common/ethereum/mod.rsdiffbeforeafterboth--- 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;
runtime/common/ethereum/transaction_converter.rsdiffbeforeafterboth--- 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 <http://www.gnu.org/licenses/>.
-
-use codec::{Encode, Decode};
-use crate::{opaque, Runtime, UncheckedExtrinsic};
-
-pub struct TransactionConverter;
-
-impl fp_rpc::ConvertTransaction<UncheckedExtrinsic> for TransactionConverter {
- fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic {
- UncheckedExtrinsic::new_unsigned(
- pallet_ethereum::Call::<Runtime>::transact { transaction }.into(),
- )
- }
-}
-
-impl fp_rpc::ConvertTransaction<opaque::UncheckedExtrinsic> for TransactionConverter {
- fn convert_transaction(
- &self,
- transaction: pallet_ethereum::Transaction,
- ) -> opaque::UncheckedExtrinsic {
- let extrinsic = UncheckedExtrinsic::new_unsigned(
- pallet_ethereum::Call::<Runtime>::transact { transaction }.into(),
- );
- let encoded = extrinsic.encode();
- opaque::UncheckedExtrinsic::decode(&mut &encoded[..])
- .expect("Encoded extrinsic is always valid")
- }
-}
runtime/common/instance.rsdiffbeforeafterboth1use crate::{2 runtime_common::{3 config::ethereum::CrossAccountId, ethereum::transaction_converter::TransactionConverter,4 },5 Runtime,6};7use up_common::types::opaque::RuntimeInstance;89impl RuntimeInstance for Runtime {10 type CrossAccountId = CrossAccountId;11 type TransactionConverter = TransactionConverter;1213 fn get_transaction_converter() -> TransactionConverter {14 TransactionConverter15 }16}