Removed assert
This commit is contained in:
parent
81db3461fe
commit
03ec27be66
@ -103,8 +103,9 @@ pub fn to_fat_rlps(account_hash: &H256, acc: &BasicAccount, acct_db: &AccountDB,
|
||||
}
|
||||
|
||||
if let Some(pair) = leftover.take() {
|
||||
let leftover_appended = account_stream.append_raw_checked(&pair, 1, target_chunk_size);
|
||||
assert!(leftover_appended);
|
||||
if !account_stream.append_raw_checked(&pair, 1, target_chunk_size) {
|
||||
return Err(Error::ChunkTooSmall);
|
||||
}
|
||||
}
|
||||
|
||||
loop {
|
||||
|
@ -55,6 +55,8 @@ pub enum Error {
|
||||
Io(::std::io::Error),
|
||||
/// Snapshot version is not supported.
|
||||
VersionNotSupported(u64),
|
||||
/// Max chunk size is to small to fit basic account data.
|
||||
ChunkTooSmall,
|
||||
}
|
||||
|
||||
impl fmt::Display for Error {
|
||||
@ -76,6 +78,7 @@ impl fmt::Display for Error {
|
||||
Error::Decoder(ref err) => err.fmt(f),
|
||||
Error::Trie(ref err) => err.fmt(f),
|
||||
Error::VersionNotSupported(ref ver) => write!(f, "Snapshot version {} is not supprted.", ver),
|
||||
Error::ChunkTooSmall => write!(f, "Chunk size is too small."),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user