Replace unwrap with expect (#1684)

* Replace unwrap with expect

* Move expect to call sites

* Bubble errors up and trap

* Update wasm

* Update invalid pointer

* Remove test which makes problems in CI

* Check for underflow
This commit is contained in:
Michael Müller
2019-02-10 12:29:45 +01:00
committed by Gav Wood
parent e5ac7f0957
commit de4bb87bea
5 changed files with 136 additions and 66 deletions
+1
View File
@@ -59,6 +59,7 @@ impl_stubs!(
b"all ok!".to_vec()
},
test_empty_return => |_| Vec::new(),
test_exhaust_heap => |_| Vec::with_capacity(16777216),
test_panic => |_| panic!("test panic"),
test_conditional_panic => |input: &[u8]| {
if input.len() > 0 {