git.delta.rocks / unique-network / refs/commits / 55ce0a62aad1

difftreelog

refactor drop TransactionConverter support

Yaroslav Bolyukin2023-06-16parent: #4d3b620.patch.diff
in: master

4 files changed

modifiedprimitives/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;
 	}
 }
 
modifiedruntime/common/ethereum/mod.rsdiffbeforeafterboth
17pub mod precompiles;17pub mod precompiles;
18pub mod self_contained_call;18pub mod self_contained_call;
19pub mod sponsoring;19pub mod sponsoring;
20pub mod transaction_converter;
2120
deletedruntime/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")
-	}
-}
modifiedruntime/common/instance.rsdiffbeforeafterboth
--- 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
-	}
 }