chore: some no-std touchups (#9480)

This commit is contained in:
Matthias Seitz
2024-07-12 19:54:25 +02:00
committed by GitHub
parent da0efbe0d4
commit d8b104fce2
4 changed files with 14 additions and 2 deletions

View File

@@ -4,6 +4,9 @@ use alloy_rlp::{length_of_length, Decodable, Encodable, Header};
use core::mem;
use reth_codecs::{main_codec, Compact};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// A transaction with a priority fee ([EIP-1559](https://eips.ethereum.org/EIPS/eip-1559)).
#[main_codec]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)]

View File

@@ -4,6 +4,9 @@ use alloy_rlp::{length_of_length, Decodable, Encodable, Header};
use core::mem;
use reth_codecs::{main_codec, Compact};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// Transaction with an [`AccessList`] ([EIP-2930](https://eips.ethereum.org/EIPS/eip-2930)).
#[main_codec]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)]

View File

@@ -2,8 +2,11 @@ use super::access_list::AccessList;
use crate::{keccak256, Bytes, ChainId, Signature, TxKind, TxType, B256, U256};
use alloy_eips::eip7702::SignedAuthorization;
use alloy_rlp::{length_of_length, Decodable, Encodable, Header};
use core::mem;
use reth_codecs::{main_codec, Compact};
use std::mem;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// [EIP-7702 Set Code Transaction](https://eips.ethereum.org/EIPS/eip-7702)
///
@@ -306,7 +309,7 @@ impl<'a> arbitrary::Arbitrary<'a> for TxEip7702 {
}
// TODO(onbjerg): This is temporary until we upstream `Hash` for EIP-7702 types in alloy
impl std::hash::Hash for TxEip7702 {
impl core::hash::Hash for TxEip7702 {
fn hash<H: core::hash::Hasher>(&self, state: &mut H) {
self.chain_id.hash(state);
self.nonce.hash(state);

View File

@@ -3,6 +3,9 @@ use alloy_rlp::{length_of_length, Encodable, Header};
use core::mem;
use reth_codecs::{main_codec, Compact};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
/// Legacy transaction.
#[main_codec]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)]