Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
prep for v0.1.0-alpha.1 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
sinui0 authored Sep 19, 2023
1 parent b5600da commit 225de1b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "notary-server"
version = "0.1.0"
version = "0.1.0-alpha.1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -27,8 +27,8 @@ serde_yaml = "0.9.21"
sha1 = "0.10"
structopt = "0.3.26"
thiserror = "1"
tlsn-notary = { git = "https://github.com/tlsnotary/tlsn", rev = "832d1ba" }
tlsn-tls-core = { git = "https://github.com/tlsnotary/tlsn", rev = "832d1ba" }
tlsn-notary = { git = "https://github.com/tlsnotary/tlsn", tag = "v0.1.0-alpha.1" }
tlsn-tls-core = { git = "https://github.com/tlsnotary/tlsn", tag = "v0.1.0-alpha.1" }
tokio = { version = "1", features = ["full"] }
tokio-rustls = { version = "0.24.1" }
tokio-util = { version = "0.7", features = ["compat"] }
Expand All @@ -42,6 +42,6 @@ ws_stream_tungstenite = { version = "0.10.0", features = ["tokio_io"] }
[dev-dependencies]
# specify vendored feature to use statically linked copy of OpenSSL
hyper-tls = { version = "0.5.0", features = ["vendored"] }
tls-server-fixture = { git = "https://github.com/tlsnotary/tlsn", rev = "832d1ba" }
tlsn-prover = { git = "https://github.com/tlsnotary/tlsn", rev = "832d1ba" }
tls-server-fixture = { git = "https://github.com/tlsnotary/tlsn", tag = "v0.1.0-alpha.1" }
tlsn-prover = { git = "https://github.com/tlsnotary/tlsn", tag = "v0.1.0-alpha.1" }
tokio-native-tls = { version = "0.3.1", features = ["vendored"] }
43 changes: 22 additions & 21 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::{
time::Duration,
};
use tls_server_fixture::{bind_test_server_hyper, CA_CERT_DER, SERVER_DOMAIN};
use tlsn_prover::{bind_prover, ProverConfig};
use tlsn_prover::{Prover, ProverConfig};
use tokio_rustls::TlsConnector;
use tokio_util::compat::{FuturesAsyncReadCompatExt, TokioAsyncReadCompatExt};
use tracing::debug;
Expand Down Expand Up @@ -196,16 +196,13 @@ async fn test_tcp_prover() {
.unwrap();

// Bind the Prover to the sockets
let (tls_connection, prover_fut, mux_fut) = bind_prover(
prover_config,
client_socket.compat(),
notary_tls_socket.compat(),
)
.await
.unwrap();
let prover = Prover::new(prover_config)
.setup(notary_tls_socket.compat())
.await
.unwrap();
let (tls_connection, prover_fut) = prover.connect(client_socket.compat()).await.unwrap();

// Spawn the Prover and Mux tasks to be run concurrently
tokio::spawn(mux_fut);
// Spawn the Prover task to be run concurrently
let prover_task = tokio::spawn(prover_fut);

let (mut request_sender, connection) = hyper::client::conn::handshake(tls_connection.compat())
Expand Down Expand Up @@ -242,13 +239,15 @@ async fn test_tcp_prover() {

client_socket.close().await.unwrap();

let mut prover = prover_task.await.unwrap().unwrap();
let mut prover = prover_task.await.unwrap().unwrap().start_notarize();

let sent_len = prover.sent_transcript().data().len();
let recv_len = prover.recv_transcript().data().len();

prover.add_commitment_sent(0..sent_len as u32).unwrap();
prover.add_commitment_recv(0..recv_len as u32).unwrap();
let builder = prover.commitment_builder();

builder.commit_sent(0..sent_len).unwrap();
builder.commit_recv(0..recv_len).unwrap();

_ = prover.finalize().await.unwrap();

Expand Down Expand Up @@ -365,13 +364,13 @@ async fn test_websocket_prover() {
.unwrap();

// Bind the Prover to the sockets
let (tls_connection, prover_fut, mux_fut) =
bind_prover(prover_config, client_socket.compat(), notary_ws_socket)
.await
.unwrap();
let prover = Prover::new(prover_config)
.setup(notary_ws_socket)
.await
.unwrap();
let (tls_connection, prover_fut) = prover.connect(client_socket.compat()).await.unwrap();

// Spawn the Prover and Mux tasks to be run concurrently
tokio::spawn(mux_fut);
let prover_task = tokio::spawn(prover_fut);

let (mut request_sender, connection) = hyper::client::conn::handshake(tls_connection.compat())
Expand Down Expand Up @@ -408,13 +407,15 @@ async fn test_websocket_prover() {

client_socket.close().await.unwrap();

let mut prover = prover_task.await.unwrap().unwrap();
let mut prover = prover_task.await.unwrap().unwrap().start_notarize();

let sent_len = prover.sent_transcript().data().len();
let recv_len = prover.recv_transcript().data().len();

prover.add_commitment_sent(0..sent_len as u32).unwrap();
prover.add_commitment_recv(0..recv_len as u32).unwrap();
let builder = prover.commitment_builder();

builder.commit_sent(0..sent_len).unwrap();
builder.commit_recv(0..recv_len).unwrap();

_ = prover.finalize().await.unwrap();

Expand Down

0 comments on commit 225de1b

Please sign in to comment.