Skip to content

Commit

Permalink
fix: disable cacao tests by default
Browse files Browse the repository at this point in the history
  • Loading branch information
heilhead committed Jan 20, 2025
1 parent 6208069 commit d0cf10b
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
rust: nightly
- name: "Tests"
cmd: nextest
args: run --workspace --all-features
args: run --workspace
rust: stable
- name: "Documentation Tests"
cmd: test
Expand Down
2 changes: 1 addition & 1 deletion relay_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl MessageIdGenerator {
pub fn next(&self) -> MessageId {
let next = self.next.fetch_add(1, Ordering::Relaxed) as u64;
let timestamp = chrono::Utc::now().timestamp_millis() as u64;
let id = timestamp << 8 | next;
let id = (timestamp << 8) | next;

MessageId::new(id)
}
Expand Down
14 changes: 8 additions & 6 deletions relay_rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ edition = "2021"
license = "Apache-2.0"

[features]
cacao = [
"dep:k256",
"dep:sha3",
"dep:alloy"
]
cacao = ["dep:k256", "dep:sha3", "dep:alloy"]
cacao-tests = []

[dependencies]
bs58 = "0.4"
Expand Down Expand Up @@ -37,7 +34,12 @@ k256 = { version = "0.13", optional = true }
sha3 = { version = "0.10", optional = true }
sha2 = { version = "0.10.6" }
url = "2"
alloy = { version = "0.3.6", optional = true, features = ["json-rpc", "provider-http", "contract", "rpc-types-eth"] }
alloy = { version = "0.3.6", optional = true, features = [
"json-rpc",
"provider-http",
"contract",
"rpc-types-eth",
] }
strum = { version = "0.26", features = ["strum_macros", "derive"] }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion relay_rpc/src/auth/cacao.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,5 @@ impl Cacao {
}
}

#[cfg(test)]
#[cfg(all(test, feature = "cacao-tests"))]
mod tests;
2 changes: 1 addition & 1 deletion relay_rpc/src/auth/cacao/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl Payload {
}
}

#[cfg(test)]
#[cfg(all(test, feature = "cacao-tests"))]
mod tests {
use super::*;

Expand Down
2 changes: 1 addition & 1 deletion relay_rpc/src/auth/cacao/signature/eip1271.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub async fn verify_eip1271(
}
}

#[cfg(test)]
#[cfg(all(test, feature = "cacao-tests"))]
mod test {
use {
super::*,
Expand Down
2 changes: 1 addition & 1 deletion relay_rpc/src/auth/cacao/signature/eip191.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub fn verify_eip191(
}
}

#[cfg(test)]
#[cfg(all(test, feature = "cacao-tests"))]
mod tests {
use {
crate::auth::cacao::signature::{
Expand Down
2 changes: 1 addition & 1 deletion relay_rpc/src/auth/cacao/signature/eip6492.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub async fn verify_eip6492(
}
}

#[cfg(test)]
#[cfg(all(test, feature = "cacao-tests"))]
mod test {
use {
super::*,
Expand Down
2 changes: 1 addition & 1 deletion relay_rpc/src/auth/cacao/signature/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub mod eip191;
pub mod eip6492;
pub mod get_rpc_url;

#[cfg(test)]
#[cfg(all(test, feature = "cacao-tests"))]
mod test_helpers;

#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, Hash)]
Expand Down

0 comments on commit d0cf10b

Please sign in to comment.