Skip to content

Commit 7640160

Browse files
authored
Fix output formatting (#5)
1 parent 5cbd251 commit 7640160

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

dist/cjs/rustbn_bg.wasm

1.73 KB
Binary file not shown.

dist/esm/wasm.json

+1-1
Large diffs are not rendered by default.

src.ts/wasm.json

+1-1
Large diffs are not rendered by default.

src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub fn ec_mul(input_hex: String) -> String {
2121
match ethereum_bn128::bn128_mul(&input_parsed[..], &mut output) {
2222
Ok(_) => {
2323
let output_hex = output.to_hex();
24-
return output_hex.into();
24+
return format!("{}{}", "0x", output_hex);
2525
}
2626
Err(_) => return "0x".into(),
2727
}
@@ -35,7 +35,7 @@ pub fn ec_add(input_str: String) -> String {
3535
match ethereum_bn128::bn128_add(&input_parsed[..], &mut output) {
3636
Ok(_) => {
3737
let output_hex = output.to_hex();
38-
return output_hex.into();
38+
return format!("{}{}", "0x", output_hex);
3939
}
4040
Err(_) => return "0x".into(),
4141
}
@@ -49,7 +49,7 @@ pub fn ec_pairing(input_str: String) -> String {
4949
match ethereum_bn128::bn128_pairing(&input_parsed[..], &mut output) {
5050
Ok(_) => {
5151
let output_hex = output.to_hex();
52-
return output_hex.into();
52+
return format!("{}{}", "0x", output_hex);
5353
}
5454
Err(_) => return "0x".into(),
5555
}

0 commit comments

Comments
 (0)