Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update axum to v0.8 #80

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 14 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ assert-json-diff = '2'
async-channel = '1'
async-trait = '0.1'
asynchronous-codec = '0.7'
axum = { version = '0.7' }
axum-extra = { version = '0.9', features = ['typed-header', 'query'] }
axum = { version = '0.8' }
axum-extra = { version = '0.10', features = ['typed-header', 'query'] }
base64 = '0.22'
bincode = '1'
bit_field = '0.10'
Expand Down Expand Up @@ -414,7 +414,10 @@ semver = '1'
serde = { version = '1', features = ['derive', 'rc'] }
serde-aux = '4'
serde_json = { version = '1', features = ['preserve_order'] }
serde_qs = { version = '0.13', features = ['axum'] }
# TODO: check if serde_qs has merged axum v0.8 support
# https://github.com/samscott89/serde_qs/pull/118
# serde_qs = { version = '0.13', features = ['axum'] }
serde_qs = { git = 'https://github.com/Atrox/serde_qs', rev = '2cfa3ee0af44ad8e78ed6bd6d0e7ac913f51f382', features = ['axum'] }
serde_repr = '0.1'
serde_with = '3'
# TODO: replace serde_yaml with alternative, since it is deprecated:
Expand Down
16 changes: 1 addition & 15 deletions http_api/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ struct EthErrorResponse<'error> {
)]
#[cfg(test)]
mod tests {
use axum::{extract::rejection::MissingJsonContentType, Error as AxumError};
use axum::extract::rejection::MissingJsonContentType;
use itertools::Itertools as _;
use serde_json::{json, Result, Value};
use test_case::test_case;
Expand Down Expand Up @@ -331,18 +331,4 @@ mod tests {
],
);
}

// `axum_extra::extract::QueryRejection` and `axum::Error` duplicate error sources.
// `axum::Error` has not been fixed in any version yet.
// `axum::extract::rejection::QueryRejection` is even worse and harder to work around.
#[test]
fn error_sources_does_not_yield_triplicates_from_query_rejection() {
let axum_error = AxumError::new("error");
let error = Error::InvalidQuery(QueryRejection::FailedToDeserializeQueryString(axum_error));

assert_eq!(
error.sources().map(ToString::to_string).collect_vec(),
["invalid query string", "error"],
);
}
}
Loading
Loading