Improve panic message

This commit is contained in:
Michael Vines
2018-07-24 11:14:33 -07:00
committed by Grimes
parent 7a71adaa8c
commit 813e438d18

View File

@ -64,7 +64,15 @@ impl Entry {
has_more, has_more,
pad: [0, 0, 0], pad: [0, 0, 0],
}; };
assert!(serialized_size(&entry).unwrap() <= BLOB_DATA_SIZE as u64);
let size = serialized_size(&entry).unwrap();
if size > BLOB_DATA_SIZE as u64 {
panic!(
"Serialized entry size too large: {} ({} transactions):",
size,
entry.transactions.len()
);
}
entry entry
} }