Skip to content

Commit 90a7b0a

Browse files
committed
Use ewasm_api::abort() instead of panic!()
1 parent 07a8d20 commit 90a7b0a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

ecadd/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ pub extern "C" fn main() {
1717
let mut output = [0u8; 64];
1818
match ethereum_bn128::bn128_add(&input[..], &mut BytesRef::Fixed(&mut output[..])) {
1919
Ok(_) => ewasm_api::finish_data(&output),
20-
Err(_) => panic!(),
20+
Err(_) => ewasm_api::abort(),
2121
}
2222
}

ecmul/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ pub extern "C" fn main() {
1717
let mut output = [0u8; 64];
1818
match ethereum_bn128::bn128_mul(&input[..], &mut BytesRef::Fixed(&mut output[..])) {
1919
Ok(_) => ewasm_api::finish_data(&output),
20-
Err(_) => panic!(),
20+
Err(_) => ewasm_api::abort(),
2121
}
2222
}

ecpairing/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub extern "C" fn main() {
1212
// NOTE: this validation will also be done by bn128_pairing
1313

1414
if length % 192 != 0 {
15-
panic!();
15+
ewasm_api::abort();
1616
}
1717

1818
// charge a base fee plus a word fee for every element
@@ -27,6 +27,6 @@ pub extern "C" fn main() {
2727
let mut output = [0u8; 32];
2828
match ethereum_bn128::bn128_pairing(&input[..], &mut BytesRef::Fixed(&mut output[..])) {
2929
Ok(_) => ewasm_api::finish_data(&output),
30-
Err(_) => panic!(),
30+
Err(_) => ewasm_api::abort(),
3131
}
3232
}

0 commit comments

Comments
 (0)