Skip to content

Commit

Permalink
add other types
Browse files Browse the repository at this point in the history
  • Loading branch information
pgherveou committed Nov 15, 2024
1 parent 3b2b834 commit 8262598
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion substrate/frame/revive/rpc/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ impl ClientInner {
contract_address,
from,
logs,
to: tx_info.to,
tx_info.to,
gas_price,
gas_used.into(),
success,
Expand Down
2 changes: 0 additions & 2 deletions substrate/frame/revive/src/evm/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;

Expand Down
13 changes: 7 additions & 6 deletions substrate/frame/revive/src/evm/api/rpc_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand Down

0 comments on commit 8262598

Please sign in to comment.