-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
92 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,5 @@ | ||
[package] | ||
authors = ["Pluto developers <pluto.xyz>"] | ||
description = """web proofs by TEE""" | ||
edition = "2021" | ||
license = "Apache2.0 OR MIT" | ||
name = "web-proof-tee" | ||
repository = "https://github.com/pluto/web-proof-tee" | ||
version = "0.1.0" | ||
|
||
[dependencies] | ||
anyhow = "1.0" | ||
tracing = "0.1" | ||
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] } | ||
tokio = { version = "1", features = ["full"] } | ||
futures = "0.3" | ||
|
||
[dev-dependencies] | ||
rstest = "0.18" | ||
env_logger = "0.11" | ||
criterion = "0.5" | ||
|
||
# [[bench]] | ||
# name = "bench" | ||
# harness = false | ||
[workspace] | ||
members = [ | ||
"client", | ||
"proxy" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
authors = ["Pluto developers <pluto.xyz>"] | ||
description = """TEE client""" | ||
edition = "2021" | ||
license = "Apache2.0 OR MIT" | ||
name = "web-proof-tee-client" | ||
repository = "https://github.com/pluto/web-proof-tee" | ||
version = "0.1.0" | ||
|
||
[dependencies] | ||
anyhow = "1.0" | ||
tracing = "0.1" | ||
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] } | ||
tokio = { version = "1", features = ["full"] } | ||
reqwest = "0.12.9" | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[package] | ||
authors = ["Pluto developers <pluto.xyz>"] | ||
description = """web proofs by TEE""" | ||
edition = "2021" | ||
license = "Apache2.0 OR MIT" | ||
name = "web-proof-tee-proxy" | ||
repository = "https://github.com/pluto/web-proof-tee" | ||
version = "0.1.0" | ||
|
||
[dependencies] | ||
anyhow = "1.0" | ||
tracing = "0.1" | ||
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] } | ||
tokio = { version = "1", features = ["full"] } | ||
# futures = "0.3" | ||
|
||
[dev-dependencies] | ||
rstest = "0.18" | ||
env_logger = "0.11" | ||
criterion = "0.5" | ||
|
||
# [[bench]] | ||
# name = "bench" | ||
# harness = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#![allow(unused_imports)] | ||
#![allow(unused_variables)] | ||
#![allow(dead_code)] | ||
#![allow(unreachable_code)] | ||
#![allow(non_snake_case)] | ||
#![allow(clippy::clone_on_copy)] | ||
#![allow(unused_mut)] | ||
#[cfg(test)] mod tests; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use tracing::Level; | ||
use tracing_subscriber::FmtSubscriber; | ||
|
||
static INIT: std::sync::Once = std::sync::Once::new(); | ||
fn setup_test_tracing() { | ||
use tracing::Level; | ||
use tracing_subscriber::FmtSubscriber; | ||
|
||
INIT.call_once(|| { | ||
let subscriber = | ||
FmtSubscriber::builder().with_max_level(Level::INFO).with_test_writer().finish(); | ||
tracing::subscriber::set_global_default(subscriber) | ||
.expect("setting default subscriber failed"); | ||
}); | ||
} | ||
use rstest::{fixture, rstest}; | ||
|
||
// rstest provides features to take common context into tests, and set up small cases testing | ||
#[derive(Clone, Debug, Eq, PartialEq)] | ||
struct Wb { | ||
count: usize, | ||
} | ||
|
||
// context setup function to be implicitly called by `wb` | ||
#[fixture] | ||
fn count() -> usize { return 0usize; } | ||
|
||
// context setup function to be implicitly called by `test_wb` | ||
#[fixture] | ||
fn wb(count: usize) -> Wb { | ||
setup_test_tracing(); | ||
Wb { count } | ||
} | ||
|
||
#[rstest] | ||
fn test_wb(wb: Wb) { | ||
tracing::info!("wb: {wb:?}"); | ||
let Wb { count } = wb; | ||
} |