chore: consistent _senders suffix (#2761)

This commit is contained in:
Matthias Seitz
2023-05-22 12:03:25 +02:00
committed by GitHub
parent 7849b4c38e
commit 0a54e47eab
2 changed files with 8 additions and 2 deletions

View File

@@ -695,7 +695,7 @@ where
&mut self,
block: SealedBlock,
) -> Result<PayloadStatus, InsertBlockError> {
self.blockchain.buffer_block_without_sender(block)?;
self.blockchain.buffer_block_without_senders(block)?;
Ok(PayloadStatus::from_status(PayloadStatusEnum::Syncing))
}

View File

@@ -15,6 +15,9 @@ pub mod error;
/// blocks from p2p. Do reorg in tables if canonical chain if needed.
pub trait BlockchainTreeEngine: BlockchainTreeViewer + Send + Sync {
/// Recover senders and call [`BlockchainTreeEngine::insert_block`].
///
/// This will recover all senders of the transactions in the block first, and then try to insert
/// the block.
fn insert_block_without_senders(
&self,
block: SealedBlock,
@@ -26,7 +29,10 @@ pub trait BlockchainTreeEngine: BlockchainTreeViewer + Send + Sync {
}
/// Recover senders and call [`BlockchainTreeEngine::buffer_block`].
fn buffer_block_without_sender(&self, block: SealedBlock) -> Result<(), InsertBlockError> {
///
/// This will recover all senders of the transactions in the block first, and then try to buffer
/// the block.
fn buffer_block_without_senders(&self, block: SealedBlock) -> Result<(), InsertBlockError> {
match block.try_seal_with_senders() {
Ok(block) => self.buffer_block(block),
Err(block) => Err(InsertBlockError::sender_recovery_error(block)),