diff --git a/Cargo.lock b/Cargo.lock index 13ea968..aba8563 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -398,7 +398,7 @@ dependencies = [ [[package]] name = "comline-codegen-rust" version = "0.1.0" -source = "git+https://github.com/ComlineProject/comline-rust?rev=1191e76068eca75ea7c4148d58ab127bb005e81a#1191e76068eca75ea7c4148d58ab127bb005e81a" +source = "git+https://github.com/ComlineProject/comline-rust?rev=a0ade3bceeb51876be7565601b3b9c9c3d807196#a0ade3bceeb51876be7565601b3b9c9c3d807196" dependencies = [ "comline-codegen", "comline-core", diff --git a/Cargo.toml b/Cargo.toml index f933aaf..1f96fd4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ comline-core = { git = "https://github.com/ComlineProject/core", rev = "47ac5f10 # `generation` tip (only `conformance/`, which this crate never touches, # differs), so matching it here keeps one `comline-codegen` in the tree. comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "1f8c5e290eba72a578860ebb6dc33453a2f0726b" } -comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "1191e76068eca75ea7c4148d58ab127bb005e81a", optional = true } +comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "a0ade3bceeb51876be7565601b3b9c9c3d807196", optional = true } comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "86fc4eb586529ef92041f8dd3c46ff9340103411", optional = true } [features] diff --git a/tests/cli/end_to_end.rs b/tests/cli/end_to_end.rs index ca82226..84a6eef 100644 --- a/tests/cli/end_to_end.rs +++ b/tests/cli/end_to_end.rs @@ -18,10 +18,8 @@ use std::sync::{Arc, Mutex}; use std::thread; use chat_e2e::chat::{Chat, ChatClient, ChatDispatcher, ChatSendError, Message, Rejected}; -use comline_runtime::client::Client; use comline_runtime::contract::CallError; use comline_runtime::format::MsgPack; -use comline_runtime::serve::Server; use comline_runtime::transport::duplex; struct Svc { @@ -46,14 +44,17 @@ fn client_and_provider_over_duplex() { let notes = Arc::new(Mutex::new(Vec::new())); let notes_for_svc = notes.clone(); + // Provider: the generated `serve` helper runs the connection handshake + // (IR_HASH + format name) before serving. let provider = thread::spawn(move || { let mut provider_side = provider_side; - Server::new(ChatDispatcher(Svc { notes: notes_for_svc }), MsgPack) - .serve(&mut provider_side) + ChatDispatcher(Svc { notes: notes_for_svc }) + .serve(&mut provider_side, MsgPack) .unwrap(); }); - let mut client = ChatClient::new(Client::new(client_side, MsgPack)); + // Client: the generated `connect` helper does the matching handshake. + let mut client = ChatClient::connect(client_side, MsgPack).expect("handshake"); assert_eq!(client.send("hi").unwrap().body, "echo: hi");