Skip to content

Commit

Permalink
feat: allow verify functions to build for wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
rvcas committed Feb 6, 2023
1 parent 5d0c5d2 commit 2377245
Show file tree
Hide file tree
Showing 4 changed files with 233 additions and 33 deletions.
163 changes: 163 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion crates/uplc/Cargo.toml
Expand Up @@ -31,11 +31,14 @@ strum = "0.24.1"
strum_macros = "0.24.3"
itertools = "0.10.5"
indexmap = "1.9.2"
secp256k1 = "0.26.0"
secp256k1 = { version = "0.26.0", optional = true }
k256 = { version = "0.12.0", optional = true }

[dev-dependencies]
hex = "0.4.3"
proptest = "1.0.0"

[features]
default = ["dep:secp256k1"]
wasm = ["dep:k256"]
unstable = []
4 changes: 4 additions & 0 deletions crates/uplc/src/machine/error.rs
Expand Up @@ -48,6 +48,10 @@ pub enum Error {
DeserialisationError(String, Value),
#[error("Integer overflow")]
OverflowError,
#[cfg(not(feature = "wasm"))]
#[error(transparent)]
Secp256k1(#[from] secp256k1::Error),
#[cfg(feature = "wasm")]
#[error(transparent)]
Secp256k1(#[from] k256::ecdsa::Error),
}

0 comments on commit 2377245

Please sign in to comment.