Skip to content

Commit

Permalink
feat(ic-response-verification): remove unused debug feature
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
  • Loading branch information
nathanosdev committed Sep 11, 2024
1 parent de81442 commit e77b4a7
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,5 @@ features = ["derive"]

[workspace.dependencies.miracl_core_bls12381]
version = "4.2"
default_features = false
default-features = false
features = ["std", "allow_alt_compress"]
1 change: 0 additions & 1 deletion packages/ic-response-verification-tests/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::agent::create_agent;
use anyhow::{anyhow, Result};
use core::panic;
use ic_agent::export::Principal;
use ic_agent::Agent;
use ic_http_certification::{HttpRequest, HttpResponse};
Expand Down
3 changes: 0 additions & 3 deletions packages/ic-response-verification-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ repository.workspace = true
license.workspace = true
homepage.workspace = true

[features]
debug = ["ic-response-verification/debug"]

[lib]
crate-type = ["cdylib", "rlib"]

Expand Down
2 changes: 1 addition & 1 deletion packages/ic-response-verification-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub fn verify_request_response_pair(
max_cert_time_offset_ns: u64,
ic_public_key: &[u8],
min_requested_verification_version: u8,
) -> Result<JsVerificationInfo, ResponseVerificationJsError> {
) -> Result<JsVerificationInfo, ic_response_verification::ResponseVerificationJsError> {
let request = request_from_js(JsValue::from(request));
let response = response_from_js(JsValue::from(response));

Expand Down
3 changes: 1 addition & 2 deletions packages/ic-response-verification/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ license.workspace = true
homepage.workspace = true

[features]
debug = ["log/max_level_trace", "log/release_max_level_trace"]
js = ["dep:wasm-bindgen", "dep:js-sys"]

[lib]
Expand All @@ -37,7 +36,7 @@ ic-certificate-verification.workspace = true
flate2.workspace = true
leb128.workspace = true
candid.workspace = true
log = { workspace = true, features = ["max_level_off", "release_max_level_off"] }
log.workspace = true
hex.workspace = true
urlencoding.workspace = true

Expand Down
10 changes: 0 additions & 10 deletions packages/ic-response-verification/src/cel/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,9 @@ fn cel_value<'a, E: ParseError<&'a str> + ContextError<&'a str>>(
}

pub(crate) fn parse_cel_expression(i: &str) -> CelParserResult<CelValue> {
#[cfg(feature = "debug")]
let result = cel_value::<nom::error::VerboseError<&str>>(i);

#[cfg(not(feature = "debug"))]
let result = cel_value::<nom::error::Error<&str>>(i);

match result {
#[cfg(feature = "debug")]
Err(nom::Err::Error(e)) | Err(nom::Err::Failure(e)) => {
let stacktrace = nom::error::convert_error(i, e);

Err(CelParserError::CelSyntaxException(stacktrace))
}
Err(e) => Err(CelParserError::CelSyntaxException(e.to_string())),
Ok((_remaining, result)) => Ok(result),
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ build_release_packages() {
}

build_debug_packages() {
wasm-pack build --target web --out-name web --out-dir $OUT_DIR/debug/dist/web --dev $PKG_ROOT -- --features "debug" || early_exit
wasm-pack build --target nodejs --out-name nodejs --out-dir $OUT_DIR/debug/dist/nodejs --dev $PKG_ROOT -- --features "debug" || early_exit
wasm-pack build --target web --out-name web --out-dir $OUT_DIR/debug/dist/web --dev $PKG_ROOT -- || early_exit
wasm-pack build --target nodejs --out-name nodejs --out-dir $OUT_DIR/debug/dist/nodejs --dev $PKG_ROOT -- || early_exit
}

delete_generated_files() {
Expand Down

0 comments on commit e77b4a7

Please sign in to comment.