Skip to content

Commit d79068f

Browse files
committed
Merge branch 'refactor' of https://github.com/bandprotocol/owasm into refactor
2 parents 39d9608 + 66d6ee3 commit d79068f

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

packages/kit/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
2-
name = "owasm-kit"
3-
version = "0.1.13"
42
authors = ["Band Protocol <[email protected]>"]
3+
description = "Standard library for oracle scripts on BandChain"
54
edition = "2018"
65
license = "Apache-2.0"
7-
repository = "https://github.com/bandprotocol/owasm/tree/master/packages/kit"
8-
description = "Standard library for oracle scripts on BandChain"
6+
name = "owasm-kit"
97
readme = "README.md"
8+
repository = "https://github.com/bandprotocol/owasm/tree/master/packages/kit"
9+
version = "0.2.0"
1010

1111
[dependencies]
1212
num = "0.2.1"

packages/kit/src/oei/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,19 @@ pub fn get_external_data(eid: i64, vid: i64) -> Result<String, i64> {
6969

7070
/// Return the verification result of ecvrf given a pubkey, a vrf proof, and the
7171
/// corresponding result.
72-
pub fn ecvrf_verify(y: &[u8], pi: &[u8], alpha: &[u8]) -> u32 {
72+
pub fn ecvrf_verify(y: &[u8], pi: &[u8], alpha: &[u8]) -> Result<bool, u32> {
7373
unsafe {
74-
raw::ecvrf_verify(
74+
match raw::ecvrf_verify(
7575
y.as_ptr() as i64,
7676
y.len() as i64,
7777
pi.as_ptr() as i64,
7878
pi.len() as i64,
7979
alpha.as_ptr() as i64,
8080
alpha.len() as i64,
81-
)
81+
) {
82+
0 => Ok(true),
83+
1 => Ok(false),
84+
x => Err(x),
85+
}
8286
}
8387
}

0 commit comments

Comments
 (0)