mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
feat: support no_std for reth-primitives (#8817)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@@ -8,6 +8,9 @@ use crate::{
|
||||
use alloy_primitives::TxKind;
|
||||
use alloy_rlp::Error as RlpError;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
impl TryFrom<alloy_rpc_types::Block> for Block {
|
||||
type Error = alloy_rpc_types::ConversionError;
|
||||
|
||||
|
||||
@@ -14,6 +14,9 @@ use reth_codecs::derive_arbitrary;
|
||||
pub use reth_primitives_traits::test_utils::{generate_valid_header, valid_header_strategy};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
// HACK(onbjerg): we need this to always set `requests` to `None` since we might otherwise generate
|
||||
// a block with `None` withdrawals and `Some` requests, in which case we end up trying to decode the
|
||||
// requests as withdrawals
|
||||
@@ -177,9 +180,9 @@ impl Block {
|
||||
pub fn size(&self) -> usize {
|
||||
self.header.size() +
|
||||
// take into account capacity
|
||||
self.body.iter().map(TransactionSigned::size).sum::<usize>() + self.body.capacity() * std::mem::size_of::<TransactionSigned>() +
|
||||
self.ommers.iter().map(Header::size).sum::<usize>() + self.ommers.capacity() * std::mem::size_of::<Header>() +
|
||||
self.withdrawals.as_ref().map_or(std::mem::size_of::<Option<Withdrawals>>(), Withdrawals::total_size)
|
||||
self.body.iter().map(TransactionSigned::size).sum::<usize>() + self.body.capacity() * core::mem::size_of::<TransactionSigned>() +
|
||||
self.ommers.iter().map(Header::size).sum::<usize>() + self.ommers.capacity() * core::mem::size_of::<Header>() +
|
||||
self.withdrawals.as_ref().map_or(core::mem::size_of::<Option<Withdrawals>>(), Withdrawals::total_size)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,9 +395,9 @@ impl SealedBlock {
|
||||
pub fn size(&self) -> usize {
|
||||
self.header.size() +
|
||||
// take into account capacity
|
||||
self.body.iter().map(TransactionSigned::size).sum::<usize>() + self.body.capacity() * std::mem::size_of::<TransactionSigned>() +
|
||||
self.ommers.iter().map(Header::size).sum::<usize>() + self.ommers.capacity() * std::mem::size_of::<Header>() +
|
||||
self.withdrawals.as_ref().map_or(std::mem::size_of::<Option<Withdrawals>>(), Withdrawals::total_size)
|
||||
self.body.iter().map(TransactionSigned::size).sum::<usize>() + self.body.capacity() * core::mem::size_of::<TransactionSigned>() +
|
||||
self.ommers.iter().map(Header::size).sum::<usize>() + self.ommers.capacity() * core::mem::size_of::<Header>() +
|
||||
self.withdrawals.as_ref().map_or(core::mem::size_of::<Option<Withdrawals>>(), Withdrawals::total_size)
|
||||
}
|
||||
|
||||
/// Calculates the total gas used by blob transactions in the sealed block.
|
||||
@@ -573,12 +576,12 @@ impl BlockBody {
|
||||
#[inline]
|
||||
pub fn size(&self) -> usize {
|
||||
self.transactions.iter().map(TransactionSigned::size).sum::<usize>() +
|
||||
self.transactions.capacity() * std::mem::size_of::<TransactionSigned>() +
|
||||
self.transactions.capacity() * core::mem::size_of::<TransactionSigned>() +
|
||||
self.ommers.iter().map(Header::size).sum::<usize>() +
|
||||
self.ommers.capacity() * std::mem::size_of::<Header>() +
|
||||
self.ommers.capacity() * core::mem::size_of::<Header>() +
|
||||
self.withdrawals
|
||||
.as_ref()
|
||||
.map_or(std::mem::size_of::<Option<Withdrawals>>(), Withdrawals::total_size)
|
||||
.map_or(core::mem::size_of::<Option<Withdrawals>>(), Withdrawals::total_size)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,15 +10,25 @@ use crate::{
|
||||
Hardfork, Head, Header, NamedChain, NodeRecord, SealedHeader, B256, EMPTY_OMMER_ROOT_HASH,
|
||||
MAINNET_DEPOSIT_CONTRACT, U256,
|
||||
};
|
||||
use core::{
|
||||
fmt,
|
||||
fmt::{Display, Formatter},
|
||||
};
|
||||
use derive_more::From;
|
||||
use once_cell::sync::Lazy;
|
||||
use reth_trie_common::root::state_root_ref_unhashed;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::{
|
||||
collections::BTreeMap,
|
||||
fmt::{Display, Formatter},
|
||||
format,
|
||||
string::{String, ToString},
|
||||
sync::Arc,
|
||||
vec::Vec,
|
||||
};
|
||||
#[cfg(feature = "std")]
|
||||
use std::{collections::BTreeMap, sync::Arc};
|
||||
|
||||
pub use alloy_eips::eip1559::BaseFeeParams;
|
||||
|
||||
@@ -1477,7 +1487,7 @@ struct DisplayFork {
|
||||
}
|
||||
|
||||
impl Display for DisplayFork {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||
let name_with_eip = if let Some(eip) = &self.eip {
|
||||
format!("{} ({})", self.name, eip)
|
||||
} else {
|
||||
@@ -1551,13 +1561,13 @@ pub struct DisplayHardforks {
|
||||
}
|
||||
|
||||
impl Display for DisplayHardforks {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||
fn format(
|
||||
header: &str,
|
||||
forks: &[DisplayFork],
|
||||
next_is_empty: bool,
|
||||
f: &mut Formatter<'_>,
|
||||
) -> std::fmt::Result {
|
||||
) -> fmt::Result {
|
||||
writeln!(f, "{header}:")?;
|
||||
let mut iter = forks.iter().peekable();
|
||||
while let Some(fork) = iter.next() {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
use std::{cell::RefCell, thread_local};
|
||||
use zstd::bulk::{Compressor, Decompressor};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Compression/Decompression dictionary for `Receipt`.
|
||||
pub static RECEIPT_DICTIONARY: &[u8] = include_bytes!("./receipt_dictionary.bin");
|
||||
/// Compression/Decompression dictionary for `Transaction`.
|
||||
|
||||
@@ -38,7 +38,7 @@ mod trusted_setup {
|
||||
}
|
||||
|
||||
/// Error type for loading the trusted setup.
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
#[derive(Debug, thiserror_no_std::Error)]
|
||||
pub enum LoadKzgSettingsError {
|
||||
/// Failed to create temp file to store bytes for loading [`KzgSettings`] via
|
||||
/// [`KzgSettings::load_trusted_setup_file`].
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
use std::{
|
||||
use core::{
|
||||
fmt,
|
||||
ops::{Deref, DerefMut},
|
||||
};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::boxed::Box;
|
||||
|
||||
/// A pair of values, one of which is expected and one of which is actual.
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct GotExpected<T> {
|
||||
@@ -18,6 +21,7 @@ impl<T: fmt::Display> fmt::Display for GotExpected<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl<T: fmt::Debug + fmt::Display> std::error::Error for GotExpected<T> {}
|
||||
|
||||
impl<T> From<(T, T)> for GotExpected<T> {
|
||||
@@ -55,6 +59,7 @@ impl<T: fmt::Display> fmt::Display for GotExpectedBoxed<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl<T: fmt::Debug + fmt::Display> std::error::Error for GotExpectedBoxed<T> {}
|
||||
|
||||
impl<T> Deref for GotExpectedBoxed<T> {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use bytes::BufMut;
|
||||
use core::fmt;
|
||||
use derive_more::Deref;
|
||||
use roaring::RoaringTreemap;
|
||||
use serde::{
|
||||
@@ -6,7 +7,9 @@ use serde::{
|
||||
ser::SerializeSeq,
|
||||
Deserialize, Deserializer, Serialize, Serializer,
|
||||
};
|
||||
use std::fmt;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Uses Roaring Bitmaps to hold a list of integers. It provides really good compression with the
|
||||
/// capability to access its elements without decoding it.
|
||||
@@ -98,7 +101,7 @@ struct IntegerListVisitor;
|
||||
impl<'de> Visitor<'de> for IntegerListVisitor {
|
||||
type Value = IntegerList;
|
||||
|
||||
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str("a usize array")
|
||||
}
|
||||
|
||||
@@ -137,7 +140,7 @@ impl<'a> Arbitrary<'a> for IntegerList {
|
||||
}
|
||||
|
||||
/// Primitives error type.
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
#[derive(Debug, thiserror_no_std::Error)]
|
||||
pub enum RoaringBitmapError {
|
||||
/// The provided input is invalid.
|
||||
#[error("the provided input is invalid")]
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
// TODO: remove when https://github.com/proptest-rs/proptest/pull/427 is merged
|
||||
#![allow(unknown_lints, non_local_definitions)]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
extern crate alloc;
|
||||
|
||||
mod account;
|
||||
#[cfg(feature = "alloy-compat")]
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
pub use reth_network_peers::{NodeRecord, NodeRecordParseError, TrustedPeer};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
// Ethereum bootnodes come from <https://github.com/ledgerwatch/erigon/blob/devel/params/bootnodes.go>
|
||||
// OP bootnodes come from <https://github.com/ethereum-optimism/op-geth/blob/optimism/params/bootnodes.go>
|
||||
|
||||
|
||||
@@ -8,6 +8,9 @@ use reth_trie_common::root::{ordered_trie_root, ordered_trie_root_with_encoder};
|
||||
|
||||
use alloy_eips::eip7685::Encodable7685;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Calculate a transaction root.
|
||||
///
|
||||
/// `(rlp(index), encoded(tx))` pairs.
|
||||
|
||||
@@ -4,13 +4,16 @@ use crate::{logs_bloom, Bloom, Bytes, TxType, B256};
|
||||
use alloy_primitives::Log;
|
||||
use alloy_rlp::{length_of_length, Decodable, Encodable, RlpDecodable, RlpEncodable};
|
||||
use bytes::{Buf, BufMut};
|
||||
use core::{cmp::Ordering, ops::Deref};
|
||||
use derive_more::{Deref, DerefMut, From, IntoIterator};
|
||||
#[cfg(any(test, feature = "arbitrary"))]
|
||||
use proptest::strategy::Strategy;
|
||||
#[cfg(feature = "zstd-codec")]
|
||||
use reth_codecs::CompactZstd;
|
||||
use reth_codecs::{add_arbitrary_tests, main_codec, Compact};
|
||||
use std::{cmp::Ordering, ops::Deref};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::{vec, vec::Vec};
|
||||
|
||||
/// Receipt containing result of transaction execution.
|
||||
#[cfg_attr(feature = "zstd-codec", main_codec(no_arbitrary, zstd))]
|
||||
|
||||
@@ -7,6 +7,9 @@ use derive_more::{Deref, DerefMut, From, IntoIterator};
|
||||
use reth_codecs::{main_codec, Compact};
|
||||
use revm_primitives::Bytes;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// A list of EIP-7685 requests.
|
||||
#[main_codec]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default, Hash, Deref, DerefMut, From, IntoIterator)]
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
use crate::{revm_primitives::AccountInfo, Account, Address, TxKind, KECCAK_EMPTY, U256};
|
||||
use revm::{interpreter::gas::validate_initial_tx_gas, primitives::SpecId};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Converts a Revm [`AccountInfo`] into a Reth [`Account`].
|
||||
///
|
||||
/// Sets `bytecode_hash` to `None` if `code_hash` is [`KECCAK_EMPTY`].
|
||||
|
||||
@@ -9,6 +9,9 @@ use alloy_eips::{eip4788::BEACON_ROOTS_ADDRESS, eip7002::WITHDRAWAL_REQUEST_PRED
|
||||
#[cfg(feature = "optimism")]
|
||||
use revm_primitives::OptimismFields;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Fill block environment from Block.
|
||||
pub fn fill_block_env(
|
||||
block_env: &mut BlockEnv,
|
||||
@@ -73,7 +76,7 @@ pub fn block_coinbase(chain_spec: &ChainSpec, header: &Header, after_merge: bool
|
||||
}
|
||||
|
||||
/// Error type for recovering Clique signer from a header.
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
#[derive(Debug, thiserror_no_std::Error)]
|
||||
pub enum CliqueSignerRecoveryError {
|
||||
/// Header extradata is too short.
|
||||
#[error("Invalid extra data length")]
|
||||
|
||||
@@ -2,8 +2,8 @@ use super::access_list::AccessList;
|
||||
use crate::{keccak256, Bytes, ChainId, Signature, TxKind, TxType, B256, U256};
|
||||
use alloy_rlp::{length_of_length, Decodable, Encodable, Header};
|
||||
use bytes::BytesMut;
|
||||
use core::mem;
|
||||
use reth_codecs::{main_codec, Compact};
|
||||
use std::mem;
|
||||
|
||||
/// A transaction with a priority fee ([EIP-1559](https://eips.ethereum.org/EIPS/eip-1559)).
|
||||
#[main_codec]
|
||||
|
||||
@@ -2,8 +2,8 @@ use super::access_list::AccessList;
|
||||
use crate::{keccak256, Bytes, ChainId, Signature, TxKind, TxType, B256, U256};
|
||||
use alloy_rlp::{length_of_length, Decodable, Encodable, Header};
|
||||
use bytes::BytesMut;
|
||||
use core::mem;
|
||||
use reth_codecs::{main_codec, Compact};
|
||||
use std::mem;
|
||||
|
||||
/// Transaction with an [`AccessList`] ([EIP-2930](https://eips.ethereum.org/EIPS/eip-2930)).
|
||||
#[main_codec]
|
||||
|
||||
@@ -4,12 +4,15 @@ use crate::{
|
||||
B256, U256,
|
||||
};
|
||||
use alloy_rlp::{length_of_length, Decodable, Encodable, Header};
|
||||
use core::mem;
|
||||
use reth_codecs::{main_codec, Compact, CompactPlaceholder};
|
||||
use std::mem;
|
||||
|
||||
#[cfg(feature = "c-kzg")]
|
||||
use crate::kzg::KzgSettings;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// [EIP-4844 Blob Transaction](https://eips.ethereum.org/EIPS/eip-4844#blob-transaction)
|
||||
///
|
||||
/// A transaction with blob hashes and max blob fee
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::{GotExpectedBoxed, U256};
|
||||
|
||||
/// Represents error variants that can happen when trying to validate a
|
||||
/// [Transaction](crate::Transaction)
|
||||
#[derive(Debug, Clone, Eq, PartialEq, thiserror::Error)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq, thiserror_no_std::Error)]
|
||||
pub enum InvalidTransactionError {
|
||||
/// The sender does not have enough funds to cover the transaction fees
|
||||
#[error(
|
||||
@@ -55,7 +55,7 @@ pub enum InvalidTransactionError {
|
||||
|
||||
/// Represents error variants that can happen when trying to convert a transaction to
|
||||
/// [`PooledTransactionsElement`](crate::PooledTransactionsElement)
|
||||
#[derive(Debug, Clone, Eq, PartialEq, thiserror::Error)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq, thiserror_no_std::Error)]
|
||||
pub enum TransactionConversionError {
|
||||
/// This error variant is used when a transaction cannot be converted into a
|
||||
/// [`PooledTransactionsElement`](crate::PooledTransactionsElement) because it is not supported
|
||||
@@ -66,7 +66,7 @@ pub enum TransactionConversionError {
|
||||
|
||||
/// Represents error variants than can happen when trying to convert a
|
||||
/// [`TransactionSignedEcRecovered`](crate::TransactionSignedEcRecovered) transaction.
|
||||
#[derive(Debug, Clone, Eq, PartialEq, thiserror::Error)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq, thiserror_no_std::Error)]
|
||||
pub enum TryFromRecoveredTransactionError {
|
||||
/// Thrown if the transaction type is unsupported.
|
||||
#[error("Unsupported transaction type: {0}")]
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use crate::{keccak256, Bytes, ChainId, Signature, TxKind, TxType, B256, U256};
|
||||
use alloy_rlp::{length_of_length, Encodable, Header};
|
||||
use bytes::BytesMut;
|
||||
use core::mem;
|
||||
use reth_codecs::{main_codec, Compact};
|
||||
use std::mem;
|
||||
|
||||
/// Legacy transaction.
|
||||
#[main_codec]
|
||||
|
||||
@@ -8,12 +8,12 @@ use alloy_rlp::{
|
||||
Decodable, Encodable, Error as RlpError, Header, EMPTY_LIST_CODE, EMPTY_STRING_CODE,
|
||||
};
|
||||
use bytes::Buf;
|
||||
use core::mem;
|
||||
use derive_more::{AsRef, Deref};
|
||||
use once_cell::sync::Lazy;
|
||||
use rayon::prelude::{IntoParallelIterator, ParallelIterator};
|
||||
use reth_codecs::{add_arbitrary_tests, derive_arbitrary, Compact};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::mem;
|
||||
|
||||
pub use access_list::{AccessList, AccessListItem};
|
||||
pub use eip1559::TxEip1559;
|
||||
@@ -60,6 +60,9 @@ pub use optimism::TxDeposit;
|
||||
#[cfg(feature = "optimism")]
|
||||
pub use tx_type::DEPOSIT_TX_TYPE_ID;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Either a transaction hash or number.
|
||||
pub type TxHashOrNumber = BlockHashOrNumber;
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@ use derive_more::{AsRef, Deref};
|
||||
use reth_codecs::add_arbitrary_tests;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// A response to `GetPooledTransactions`. This can include either a blob transaction, or a
|
||||
/// non-4844 signed transaction.
|
||||
#[add_arbitrary_tests]
|
||||
|
||||
@@ -12,6 +12,9 @@ pub use alloy_eips::eip4844::BlobTransactionSidecar;
|
||||
#[cfg(feature = "c-kzg")]
|
||||
pub use alloy_eips::eip4844::BlobTransactionValidationError;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// A response to `GetPooledTransactions` that includes blob data, their commitments, and their
|
||||
/// corresponding proofs.
|
||||
///
|
||||
|
||||
@@ -193,7 +193,7 @@ impl Signature {
|
||||
/// Calculates a heuristic for the in-memory size of the [Signature].
|
||||
#[inline]
|
||||
pub const fn size(&self) -> usize {
|
||||
std::mem::size_of::<Self>()
|
||||
core::mem::size_of::<Self>()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::{
|
||||
Address, Transaction, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash,
|
||||
B256,
|
||||
};
|
||||
use std::ops::Deref;
|
||||
use core::ops::Deref;
|
||||
|
||||
/// Represents various different transaction formats used in reth.
|
||||
///
|
||||
|
||||
@@ -4,6 +4,9 @@ use alloy_rlp::{RlpDecodableWrapper, RlpEncodableWrapper};
|
||||
use derive_more::{AsRef, Deref, DerefMut, From, IntoIterator};
|
||||
use reth_codecs::{main_codec, Compact};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Re-export from `alloy_eips`.
|
||||
#[doc(inline)]
|
||||
pub use alloy_eips::eip4895::Withdrawal;
|
||||
@@ -37,22 +40,22 @@ impl Withdrawals {
|
||||
/// Calculate the total size, including capacity, of the Withdrawals.
|
||||
#[inline]
|
||||
pub fn total_size(&self) -> usize {
|
||||
self.capacity() * std::mem::size_of::<Withdrawal>()
|
||||
self.capacity() * core::mem::size_of::<Withdrawal>()
|
||||
}
|
||||
|
||||
/// Calculate a heuristic for the in-memory size of the [Withdrawals].
|
||||
#[inline]
|
||||
pub fn size(&self) -> usize {
|
||||
self.len() * std::mem::size_of::<Withdrawal>()
|
||||
self.len() * core::mem::size_of::<Withdrawal>()
|
||||
}
|
||||
|
||||
/// Get an iterator over the Withdrawals.
|
||||
pub fn iter(&self) -> std::slice::Iter<'_, Withdrawal> {
|
||||
pub fn iter(&self) -> core::slice::Iter<'_, Withdrawal> {
|
||||
self.0.iter()
|
||||
}
|
||||
|
||||
/// Get a mutable iterator over the Withdrawals.
|
||||
pub fn iter_mut(&mut self) -> std::slice::IterMut<'_, Withdrawal> {
|
||||
pub fn iter_mut(&mut self) -> core::slice::IterMut<'_, Withdrawal> {
|
||||
self.0.iter_mut()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user