Skip to content

Commit

Permalink
chore: bump to 0.5.0-alpha.1 (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
driftluo authored May 6, 2023
1 parent 9f322db commit c0f8514
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 39 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## yamux 0.3.8 secio 0.6.0 tentacle 0.5.0-alpha.1

### Features
- Yamux `StreamHandle` support peek(#367)
- Secio support custom `KeyProvider`(#366)

## 0.4.2

### Features
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Tentacle

[![Build Status](https://travis-ci.com/nervosnetwork/tentacle.svg?branch=master)](https://travis-ci.com/nervosnetwork/tentacle)
![image](https://img.shields.io/badge/rustc-1.56.1-blue.svg)
[![Build Status](https://github.com/nervosnetwork/tentacle/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/nervosnetwork/tentacle/actions/workflows/ci.yaml/badge.svg?branch=master)
![image](https://img.shields.io/badge/rustc-1.68.2-blue.svg)

## Overview

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.61.0
1.68.2
2 changes: 1 addition & 1 deletion secio/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tentacle-secio"
version = "0.5.7"
version = "0.6.0"
license = "MIT"
description = "Secio encryption protocol for p2p"
authors = ["piaoliu <[email protected]>", "Nervos Core Dev <[email protected]>"]
Expand Down
4 changes: 2 additions & 2 deletions secio/src/codec/secure_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ mod tests {
let hmac_key: [u8; 16] = rand::random();
let _hmac_key_clone = hmac_key;
let data = b"hello world";
let data_clone = &*data;
let data_clone = data;
let nonce = vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
let nonce2 = nonce.clone();

Expand Down Expand Up @@ -311,7 +311,7 @@ mod tests {
// if not send nonce to remote, handshake will unable to complete the final confirmation
// it will return error and shutdown this session
if send_nonce {
let _ = handle.write_all(&nonce).await;
let _ignore = handle.write_all(&nonce).await;
}

let _res = handle.write_all(&data_clone[..]).await;
Expand Down
2 changes: 1 addition & 1 deletion secio/src/handshake/procedure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ where

if !<K as KeyProvider>::verify_ecdsa(
ephemeral_context.state.remote.public_key.inner_ref(),
&data_to_verify,
data_to_verify,
&remote_exchanges.signature,
) {
debug!("failed to verify the remote's signature");
Expand Down
4 changes: 2 additions & 2 deletions tentacle/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tentacle"
version = "0.4.2"
version = "0.5.0-alpha.1"
license = "MIT"
description = "Minimal implementation for a multiplexed p2p network framework."
authors = ["piaoliu <[email protected]>", "Nervos Core Dev <[email protected]>"]
Expand All @@ -18,7 +18,7 @@ rustc-args = ["--cfg", "docsrs"]

[dependencies]
yamux = { path = "../yamux", version = "0.3.0", default-features = false, package = "tokio-yamux"}
secio = { path = "../secio", version = "0.5.0", package = "tentacle-secio" }
secio = { path = "../secio", version = "0.6.0", package = "tentacle-secio" }

futures = { version = "0.3.0" }
tokio = { version = "1.0.0", features = ["macros"] }
Expand Down
4 changes: 2 additions & 2 deletions tentacle/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Tentacle

[![Build Status](https://travis-ci.com/nervosnetwork/tentacle.svg?branch=master)](https://travis-ci.com/nervosnetwork/tentacle)
![image](https://img.shields.io/badge/rustc-1.56.1-blue.svg)
![image](https://img.shields.io/badge/rustc-1.68.2-blue.svg)

## Overview

Expand Down Expand Up @@ -38,7 +38,7 @@ The codes in the `protocols/` directory are no longer maintained and only used a

```toml
[dependencies]
tentacle = { version = "0.4.0-beta.1" }
tentacle = { version = "0.4.0" }
```

### Example
Expand Down
52 changes: 26 additions & 26 deletions tentacle/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,23 @@ pub trait SessionProtocol: Send {
#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]
impl ServiceHandle for Box<dyn ServiceHandle + Send + 'static> {
async fn handle_error(&mut self, control: &mut ServiceContext, error: ServiceError) {
(&mut **self).handle_error(control, error).await
(**self).handle_error(control, error).await
}

async fn handle_event(&mut self, control: &mut ServiceContext, event: ServiceEvent) {
(&mut **self).handle_event(control, event).await
(**self).handle_event(control, event).await
}
}

#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]
impl ServiceHandle for Box<dyn ServiceHandle + Send + Sync + 'static> {
async fn handle_error(&mut self, control: &mut ServiceContext, error: ServiceError) {
(&mut **self).handle_error(control, error).await
(**self).handle_error(control, error).await
}

async fn handle_event(&mut self, control: &mut ServiceContext, event: ServiceEvent) {
(&mut **self).handle_event(control, event).await
(**self).handle_event(control, event).await
}
}

Expand All @@ -129,107 +129,107 @@ impl ServiceHandle for () {}
#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]
impl ServiceProtocol for Box<dyn ServiceProtocol + Send + 'static + Unpin> {
async fn init(&mut self, context: &mut ProtocolContext) {
(&mut **self).init(context).await
(**self).init(context).await
}

async fn connected(&mut self, context: ProtocolContextMutRef<'_>, version: &str) {
(&mut **self).connected(context, version).await
(**self).connected(context, version).await
}

async fn disconnected(&mut self, context: ProtocolContextMutRef<'_>) {
(&mut **self).disconnected(context).await
(**self).disconnected(context).await
}

async fn received(&mut self, context: ProtocolContextMutRef<'_>, data: bytes::Bytes) {
(&mut **self).received(context, data).await
(**self).received(context, data).await
}

async fn notify(&mut self, context: &mut ProtocolContext, token: u64) {
(&mut **self).notify(context, token).await
(**self).notify(context, token).await
}

#[inline]
async fn poll(&mut self, context: &mut ProtocolContext) -> Option<()> {
(&mut **self).poll(context).await
(**self).poll(context).await
}
}

#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]
impl ServiceProtocol for Box<dyn ServiceProtocol + Send + Sync + 'static + Unpin> {
async fn init(&mut self, context: &mut ProtocolContext) {
(&mut **self).init(context).await
(**self).init(context).await
}

async fn connected(&mut self, context: ProtocolContextMutRef<'_>, version: &str) {
(&mut **self).connected(context, version).await
(**self).connected(context, version).await
}

async fn disconnected(&mut self, context: ProtocolContextMutRef<'_>) {
(&mut **self).disconnected(context).await
(**self).disconnected(context).await
}

async fn received(&mut self, context: ProtocolContextMutRef<'_>, data: bytes::Bytes) {
(&mut **self).received(context, data).await
(**self).received(context, data).await
}

async fn notify(&mut self, context: &mut ProtocolContext, token: u64) {
(&mut **self).notify(context, token).await
(**self).notify(context, token).await
}

#[inline]
async fn poll(&mut self, context: &mut ProtocolContext) -> Option<()> {
(&mut **self).poll(context).await
(**self).poll(context).await
}
}

#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]
impl SessionProtocol for Box<dyn SessionProtocol + Send + 'static + Unpin> {
async fn connected(&mut self, context: ProtocolContextMutRef<'_>, version: &str) {
(&mut **self).connected(context, version).await
(**self).connected(context, version).await
}

async fn disconnected(&mut self, context: ProtocolContextMutRef<'_>) {
(&mut **self).disconnected(context).await
(**self).disconnected(context).await
}

async fn received(&mut self, context: ProtocolContextMutRef<'_>, data: bytes::Bytes) {
(&mut **self).received(context, data).await
(**self).received(context, data).await
}

async fn notify(&mut self, context: ProtocolContextMutRef<'_>, token: u64) {
(&mut **self).notify(context, token).await
(**self).notify(context, token).await
}

#[inline]
async fn poll(&mut self, context: ProtocolContextMutRef<'_>) -> Option<()> {
(&mut **self).poll(context).await
(**self).poll(context).await
}
}

#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]
impl SessionProtocol for Box<dyn SessionProtocol + Send + Sync + 'static + Unpin> {
async fn connected(&mut self, context: ProtocolContextMutRef<'_>, version: &str) {
(&mut **self).connected(context, version).await
(**self).connected(context, version).await
}

async fn disconnected(&mut self, context: ProtocolContextMutRef<'_>) {
(&mut **self).disconnected(context).await
(**self).disconnected(context).await
}

async fn received(&mut self, context: ProtocolContextMutRef<'_>, data: bytes::Bytes) {
(&mut **self).received(context, data).await
(**self).received(context, data).await
}

async fn notify(&mut self, context: ProtocolContextMutRef<'_>, token: u64) {
(&mut **self).notify(context, token).await
(**self).notify(context, token).await
}

#[inline]
async fn poll(&mut self, context: ProtocolContextMutRef<'_>) -> Option<()> {
(&mut **self).poll(context).await
(**self).poll(context).await
}
}

Expand Down
2 changes: 1 addition & 1 deletion tentacle/tests/test_tls_reconnect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ fn clint_node_connect(path: String, dial_address: Multiaddr) {
let handle = thread::spawn(move || {
let rt = tokio::runtime::Runtime::new().unwrap();
rt.block_on(async move {
let _ = service.dial(dial_address, TargetProtocol::All).await;
let _ignore = service.dial(dial_address, TargetProtocol::All).await;
service.run().await
});
});
Expand Down
2 changes: 1 addition & 1 deletion yamux/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tokio-yamux"
version = "0.3.7"
version = "0.3.8"
license = "MIT"
repository = "https://github.com/nervosnetwork/tentacle"
description = "Rust implementation of Yamux"
Expand Down

0 comments on commit c0f8514

Please sign in to comment.