-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from blockscout/bragov4ik/bump-deps
Upgrade dependencies to their newest versions
- Loading branch information
Showing
23 changed files
with
1,346 additions
and
763 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
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,19 +1,19 @@ | ||
[package] | ||
name = "actix-prost-build" | ||
version = "0.1.0" | ||
version = "2.0.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
convert-trait = { path = "../convert-trait", optional = true} | ||
thiserror = "1.0" | ||
convert-trait = { path = "../convert-trait", optional = true } | ||
thiserror = "2.0" | ||
proc-macro2 = "1.0" | ||
prost-build = "0.11" | ||
prost-build = "0.13" | ||
prettyplease = "0.2" | ||
prost-reflect = "0.12.0" | ||
prost-reflect = "0.14.4" | ||
quote = "1.0" | ||
syn = { version = "2.0", features = ["full"] } | ||
serde = { version = "1", features = ["derive"] } | ||
syn = { version = "2.0", features = [ "full" ] } | ||
serde = { version = "1", features = [ "derive" ] } | ||
serde_yaml = "0.9" | ||
|
||
[features] | ||
conversions = ["dep:convert-trait"] | ||
conversions = [ "dep:convert-trait" ] |
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
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,12 +1,12 @@ | ||
[package] | ||
name = "actix-prost-macros" | ||
version = "0.1.1" | ||
version = "2.0.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
proc-macro = true | ||
|
||
[dependencies] | ||
proc-macro2 = "1.0" | ||
syn = { version = "1.0", features = ["extra-traits", "full"] } | ||
syn = { version = "1.0", features = [ "extra-traits", "full" ] } | ||
quote = "1.0" |
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
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
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,14 +1,14 @@ | ||
[package] | ||
name = "actix-prost" | ||
version = "0.1.0" | ||
version = "2.0.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
http = "0.2" | ||
tonic = "0.8" | ||
http = "1.2" | ||
tonic = "0.12" | ||
actix-web = "4" | ||
actix-http = "3" | ||
serde = { version = "1", features = ["derive"] } | ||
serde_with = { version = "2.0", features = ["base64"] } | ||
prost = "0.11" | ||
serde = { version = "1", features = [ "derive" ] } | ||
serde_with = { version = "3.12", features = [ "base64" ] } | ||
prost = "0.13" | ||
serde_json = "1.0" |
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
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
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,118 @@ | ||
use std::str::FromStr; | ||
|
||
pub fn to_actix_status(status: http::StatusCode) -> actix_web::http::StatusCode { | ||
actix_web::http::StatusCode::from_u16(status.as_u16()).expect("status codes are always valid") | ||
} | ||
|
||
pub fn from_actix_header( | ||
header: ( | ||
actix_http::header::HeaderName, | ||
actix_http::header::HeaderValue, | ||
), | ||
) -> (http::HeaderName, http::HeaderValue) { | ||
( | ||
http::HeaderName::from_str(header.0.as_str()).expect("was a valid header name"), | ||
http::HeaderValue::from_bytes(header.1.as_bytes()).expect("was a valid header value"), | ||
) | ||
} | ||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
use actix_http::header::{HeaderName, HeaderValue}; | ||
use std::str::FromStr; | ||
|
||
#[test] | ||
fn test_header_names() { | ||
let a_1 = "a".repeat(1); | ||
let a_8192 = "a".repeat(8192); | ||
let a_8193 = "a".repeat(8193); | ||
let a_16384 = "a".repeat(16384); | ||
let a_16385 = "a".repeat(16385); | ||
|
||
let test_cases = vec![ | ||
// Empty | ||
"", | ||
// Single characters | ||
"a", | ||
"A", | ||
"-", | ||
// Common headers | ||
"content-type", | ||
"x-custom-header", | ||
"CONTENT-TYPE", | ||
"X-CUSTOM-HEADER", | ||
// Various lengths | ||
&a_1, | ||
&a_8192, | ||
&a_8193, | ||
&a_16384, | ||
&a_16385, | ||
// Special characters | ||
"header\0name", | ||
"header\tname", | ||
"header name", | ||
"headerñame", | ||
"header\r\name", | ||
"header\n\name", | ||
"header:name", | ||
// Mixed case | ||
"Content-Type", | ||
"X-Mixed-Case", | ||
]; | ||
|
||
for input in test_cases { | ||
if let Ok(name) = HeaderName::from_str(input) { | ||
let dummy_value = HeaderValue::from_static(""); | ||
let _ = from_actix_header((name, dummy_value)); | ||
} | ||
} | ||
} | ||
|
||
#[test] | ||
fn test_header_values() { | ||
let valid_name = HeaderName::from_static("x-test"); | ||
|
||
let nul = '\u{0}'.to_string(); | ||
let us = '\u{1f}'.to_string(); | ||
let del = '\u{7f}'.to_string(); | ||
let a_8192 = "a".repeat(8192); | ||
let a_16384 = "a".repeat(16384); | ||
|
||
let test_cases = vec![ | ||
// Empty | ||
"", | ||
// ASCII range | ||
&nul, // NUL | ||
"\t", // TAB | ||
&us, // US | ||
" ", // space | ||
"~", // tilde | ||
&del, // DEL | ||
// ASCII printable | ||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", | ||
"!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", | ||
// Control characters | ||
"\n", | ||
"\r", | ||
"\x0B", // VT | ||
"\x0C", // FF | ||
// UTF-8 sequences | ||
"Hello™", | ||
"Hello🌍", | ||
"Привет", | ||
// Mixed content | ||
"Hello\nWorld", | ||
"Hello\0World", | ||
"Hello\tWorld", | ||
// Long values | ||
&a_8192, | ||
&a_16384, | ||
]; | ||
|
||
for input in test_cases { | ||
if let Ok(value) = HeaderValue::from_str(input) { | ||
let _ = from_actix_header((valid_name.clone(), value)); | ||
} | ||
} | ||
} | ||
} |
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,5 +1,6 @@ | ||
pub mod error; | ||
pub mod header; | ||
pub mod http_compatibility; | ||
pub mod request; | ||
pub mod serde; | ||
|
||
|
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,17 +1,17 @@ | ||
[package] | ||
name = "convert-trait" | ||
version = "0.1.0" | ||
version = "2.0.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
ethers-core = { version = "2.0.0", optional = true } | ||
bytes = { version = "1.3", optional = true } | ||
hex = { version = "0.4", optional = true} | ||
ethers-core = { version = "2.0.14", optional = true } | ||
bytes = { version = "1.9", optional = true } | ||
hex = { version = "0.4", optional = true } | ||
url = { version = "2", optional = true } | ||
|
||
[features] | ||
default = ["conv-full"] | ||
conv-full = ["conv-bytes", "conv-address", "conv-url"] | ||
conv-bytes = ["dep:bytes", "dep:hex"] | ||
conv-address = ["dep:ethers-core"] | ||
conv-url = ["dep:url"] | ||
default = [ "conv-full" ] | ||
conv-full = [ "conv-bytes", "conv-address", "conv-url" ] | ||
conv-bytes = [ "dep:bytes", "dep:hex" ] | ||
conv-address = [ "dep:ethers-core" ] | ||
conv-url = [ "dep:url" ] |
Oops, something went wrong.