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
--- 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;
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
1use crate::{1use crate::{
2 runtime_common::{2 runtime_common::{
3 config::ethereum::CrossAccountId, ethereum::transaction_converter::TransactionConverter,3 config::ethereum::CrossAccountId,
4 },4 },
5 Runtime,5 Runtime,
6};6};
7use up_common::types::opaque::RuntimeInstance;7use up_common::types::opaque::RuntimeInstance;
88
9impl RuntimeInstance for Runtime {9impl RuntimeInstance for Runtime {
10 type CrossAccountId = CrossAccountId;10 type CrossAccountId = CrossAccountId;
11 type TransactionConverter = TransactionConverter;
12
13 fn get_transaction_converter() -> TransactionConverter {
14 TransactionConverter
15 }
16}11}
1712