feat: add tx_number consistency check to StaticFileProviderRW (#12570)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Arsenii Kulikov
2024-11-15 23:04:35 +04:00
committed by GitHub
parent 6e00e58426
commit f0b8b9b221
4 changed files with 25 additions and 46 deletions

View File

@ -133,6 +133,9 @@ pub enum ProviderError {
/// Trying to insert data from an unexpected block number.
#[display("trying to append data to {_0} as block #{_1} but expected block #{_2}")]
UnexpectedStaticFileBlockNumber(StaticFileSegment, BlockNumber, BlockNumber),
/// Trying to insert data from an unexpected block number.
#[display("trying to append row to {_0} at index #{_1} but expected index #{_2}")]
UnexpectedStaticFileTxNumber(StaticFileSegment, TxNumber, TxNumber),
/// Static File Provider was initialized as read-only.
#[display("cannot get a writer on a read-only environment.")]
ReadOnlyStaticFileAccess,