From 82625986a8574eea0eda0a48b155156b95f6404f Mon Sep 17 00:00:00 2001 From: pgherveou Date: Fri, 15 Nov 2024 16:37:31 +0100 Subject: [PATCH] add other types --- substrate/frame/revive/rpc/src/client.rs | 2 +- substrate/frame/revive/src/evm/api.rs | 2 -- substrate/frame/revive/src/evm/api/rpc_types.rs | 13 +++++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/substrate/frame/revive/rpc/src/client.rs b/substrate/frame/revive/rpc/src/client.rs index 213628487b91..d37f1d760065 100644 --- a/substrate/frame/revive/rpc/src/client.rs +++ b/substrate/frame/revive/rpc/src/client.rs @@ -324,7 +324,7 @@ impl ClientInner { contract_address, from, logs, - to: tx_info.to, + tx_info.to, gas_price, gas_used.into(), success, diff --git a/substrate/frame/revive/src/evm/api.rs b/substrate/frame/revive/src/evm/api.rs index 8185a2c8f6f8..fe18c8735bed 100644 --- a/substrate/frame/revive/src/evm/api.rs +++ b/substrate/frame/revive/src/evm/api.rs @@ -25,9 +25,7 @@ pub use rlp; mod type_id; pub use type_id::*; -#[cfg(feature = "std")] mod rpc_types; - mod rpc_types_gen; pub use rpc_types_gen::*; diff --git a/substrate/frame/revive/src/evm/api/rpc_types.rs b/substrate/frame/revive/src/evm/api/rpc_types.rs index 8737bd36407f..d89a68282f4d 100644 --- a/substrate/frame/revive/src/evm/api/rpc_types.rs +++ b/substrate/frame/revive/src/evm/api/rpc_types.rs @@ -15,7 +15,8 @@ // See the License for the specific language governing permissions and // limitations under the License. //! Utility impl for the RPC types. -use super::{GenericTransaction, ReceiptInfo, TransactionInfo, TransactionSigned}; +use super::*; +use alloc::vec::Vec; use sp_core::{H160, U256}; impl TransactionInfo { @@ -139,7 +140,7 @@ fn logs_bloom_works() { assert_eq!(receipt.logs_bloom, ReceiptInfo::logs_bloom(&receipt.logs)); } -macro_rules! impl_into_generic_transaction { +macro_rules! impl_from_signed { ($tx: ident, $from: ident, { $($field:ident: $mapping:expr),* }) => { GenericTransaction { from: $from, @@ -160,7 +161,7 @@ impl GenericTransaction { match tx { TransactionLegacySigned(tx) => { let tx = tx.transaction_legacy_unsigned; - impl_into_generic_transaction!(tx, from, { + impl_from_signed!(tx, from, { chain_id: tx.chain_id, gas: Some(tx.gas), gas_price: Some(tx.gas_price), @@ -169,7 +170,7 @@ impl GenericTransaction { }, Transaction4844Signed(tx) => { let tx = tx.transaction_4844_unsigned; - impl_into_generic_transaction!(tx, from, { + impl_from_signed!(tx, from, { access_list: Some(tx.access_list), blob_versioned_hashes: Some(tx.blob_versioned_hashes), max_fee_per_blob_gas: Some(tx.max_fee_per_blob_gas), @@ -183,7 +184,7 @@ impl GenericTransaction { }, Transaction1559Signed(tx) => { let tx = tx.transaction_1559_unsigned; - impl_into_generic_transaction!(tx, from, { + impl_from_signed!(tx, from, { access_list: Some(tx.access_list), max_fee_per_gas: Some(tx.max_fee_per_gas), max_priority_fee_per_gas: Some(tx.max_priority_fee_per_gas), @@ -195,7 +196,7 @@ impl GenericTransaction { }, Transaction2930Signed(tx) => { let tx = tx.transaction_2930_unsigned; - impl_into_generic_transaction!(tx, from, { + impl_from_signed!(tx, from, { access_list: Some(tx.access_list), chain_id: Some(tx.chain_id), gas: Some(tx.gas),