mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add try_into_pooled_eip4844 (#12792)
This commit is contained in:
@ -770,6 +770,14 @@ impl EthPoolTransaction for MockTransaction {
|
||||
}
|
||||
}
|
||||
|
||||
fn try_into_pooled_eip4844(self, sidecar: Arc<BlobTransactionSidecar>) -> Option<Self::Pooled> {
|
||||
Self::Pooled::try_from_blob_transaction(
|
||||
self.into_consensus(),
|
||||
Arc::unwrap_or_clone(sidecar),
|
||||
)
|
||||
.ok()
|
||||
}
|
||||
|
||||
fn validate_blob(
|
||||
&self,
|
||||
_blob: &BlobTransactionSidecar,
|
||||
|
||||
@ -1093,6 +1093,13 @@ pub trait EthPoolTransaction:
|
||||
/// Returns the number of blobs this transaction has.
|
||||
fn blob_count(&self) -> usize;
|
||||
|
||||
/// A specialization for the EIP-4844 transaction type.
|
||||
/// Tries to reattach the blob sidecar to the transaction.
|
||||
///
|
||||
/// This returns an option, but callers should ensure that the transaction is an EIP-4844
|
||||
/// transaction: [`PoolTransaction::is_eip4844`].
|
||||
fn try_into_pooled_eip4844(self, sidecar: Arc<BlobTransactionSidecar>) -> Option<Self::Pooled>;
|
||||
|
||||
/// Validates the blob sidecar of the transaction with the given settings.
|
||||
fn validate_blob(
|
||||
&self,
|
||||
@ -1324,6 +1331,14 @@ impl EthPoolTransaction for EthPooledTransaction {
|
||||
}
|
||||
}
|
||||
|
||||
fn try_into_pooled_eip4844(self, sidecar: Arc<BlobTransactionSidecar>) -> Option<Self::Pooled> {
|
||||
PooledTransactionsElementEcRecovered::try_from_blob_transaction(
|
||||
self.into_consensus(),
|
||||
Arc::unwrap_or_clone(sidecar),
|
||||
)
|
||||
.ok()
|
||||
}
|
||||
|
||||
fn validate_blob(
|
||||
&self,
|
||||
sidecar: &BlobTransactionSidecar,
|
||||
|
||||
Reference in New Issue
Block a user