Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
add TxType
Browse files Browse the repository at this point in the history
  • Loading branch information
lightsing committed Feb 8, 2024
1 parent 8ba838b commit 6457d71
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions eth-types/src/geth_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,33 @@ use num_bigint::BigUint;
use serde::{Serialize, Serializer};
use serde_with::serde_as;
use std::collections::HashMap;
use strum_macros::EnumIter;

/// Tx type
#[derive(Default, Debug, Copy, Clone, EnumIter, Serialize, PartialEq, Eq)]
pub enum TxType {
/// EIP 155 tx
#[default]
Eip155 = 0,
/// Pre EIP 155 tx
PreEip155,
/// EIP 1559 tx
Eip1559,
/// EIP 2930 tx
Eip2930,
}

impl From<TxType> for usize {
fn from(value: TxType) -> Self {
value as usize
}
}

impl From<TxType> for u64 {
fn from(value: TxType) -> Self {
value as u64
}
}

/// Definition of all of the data related to an account.
#[serde_as]
Expand Down

0 comments on commit 6457d71

Please sign in to comment.