Further improved availability recovery (#3711)

* WiP.

* Things compile.

* cargo fmt

* Passing tests + fix warnings.

* Metrics for availability recovery.

* Basic test.

* Fix typos and actually check for overflow.

* cargo fmt

* Register metrics.

* More tests.

* Fix warning.

* cargo +nightly fmt

* Fix metrics

* Get rid of unsafe.

* tabify

* spellcheck

Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
Robert Klotzner
2021-08-27 18:59:23 +02:00
committed by GitHub
parent 353cfc8e37
commit e56efb82d9
8 changed files with 750 additions and 63 deletions
+7
View File
@@ -304,6 +304,13 @@ impl Proof {
pub fn as_vec(&self) -> Vec<Vec<u8>> {
self.0.as_vec().iter().map(|v| v.as_vec().clone()).collect()
}
/// Construct an invalid dummy proof
///
/// Useful for testing, should absolutely not be used in production.
pub fn dummy_proof() -> Proof {
Proof(BoundedVec::from_vec(vec![BoundedVec::from_vec(vec![0]).unwrap()]).unwrap())
}
}
#[derive(thiserror::Error, Debug)]