chore: Upgrade to neptune-core v0.3.0
This commit is contained in:
parent
df61019183
commit
67962a5d12
1916
Cargo.lock
generated
1916
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -13,8 +13,7 @@ tokio = { version = "1.37.0", features = ["full", "tracing"] }
|
|||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-subscriber = "0.3"
|
tracing-subscriber = "0.3"
|
||||||
|
|
||||||
# 9d4901028784d5c083fb72029c52da4953b0f0c3 is tip of master on 2025-03-24
|
neptune-cash = "0.3.0"
|
||||||
neptune-cash = {git = "https://github.com/Neptune-Crypto/neptune-core.git", rev = "9d4901028784d5c083fb72029c52da4953b0f0c3"}
|
|
||||||
tarpc = { version = "^0.34", features = [
|
tarpc = { version = "^0.34", features = [
|
||||||
"tokio1",
|
"tokio1",
|
||||||
"serde-transport",
|
"serde-transport",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# neptune-explorer
|
# neptune-explorer
|
||||||
|
|
||||||
A web-based block explorer for the [Neptune blockchain](https://neptune.cash). neptune-explorer provides a basic HTML view and a REST RPC API.
|
A web-based block explorer for the [Neptune Cash blockchain](https://neptune.cash). neptune-explorer provides a basic HTML view and a REST RPC API.
|
||||||
|
|
||||||
As of 2024-05-22 this code is running at https://explorer.neptune.cash.
|
As of 2024-05-22 this code is running at https://explorer.neptune.cash.
|
||||||
|
|
||||||
|
|||||||
@ -83,7 +83,7 @@ pub async fn redirect_query_string_to_path(
|
|||||||
let raw_query = raw_query_option.ok_or_else(not_found)?;
|
let raw_query = raw_query_option.ok_or_else(not_found)?;
|
||||||
|
|
||||||
// note: we construct a fake-url so we can use Url::query_pairs().
|
// note: we construct a fake-url so we can use Url::query_pairs().
|
||||||
let fake_url = format!("http://127.0.0.1/?{}", raw_query);
|
let fake_url = format!("http://127.0.0.1/?{raw_query}");
|
||||||
let url = url::Url::parse(&fake_url).map_err(|_| not_found())?;
|
let url = url::Url::parse(&fake_url).map_err(|_| not_found())?;
|
||||||
let query_vars: Vec<(String, _)> = url.query_pairs().into_owned().collect();
|
let query_vars: Vec<(String, _)> = url.query_pairs().into_owned().collect();
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ pub fn not_found_html_handler(html: Html<String>) -> (StatusCode, Html<String>)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn rpc_err(e: TarpcError) -> Response {
|
pub fn rpc_err(e: TarpcError) -> Response {
|
||||||
(StatusCode::INTERNAL_SERVER_ERROR, format!("{:?}", e)).into_response()
|
(StatusCode::INTERNAL_SERVER_ERROR, format!("{e:?}")).into_response()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn rpc_method_err(e: RpcError) -> Response {
|
pub fn rpc_method_err(e: RpcError) -> Response {
|
||||||
@ -29,5 +29,5 @@ pub fn rpc_method_err(e: RpcError) -> Response {
|
|||||||
RpcError::Auth(_) => StatusCode::UNAUTHORIZED,
|
RpcError::Auth(_) => StatusCode::UNAUTHORIZED,
|
||||||
_ => StatusCode::BAD_REQUEST,
|
_ => StatusCode::BAD_REQUEST,
|
||||||
};
|
};
|
||||||
(status_code, format!("{:?}", e)).into_response()
|
(status_code, format!("{e:?}")).into_response()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@ use arc_swap::ArcSwap;
|
|||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use neptune_cash::config_models::network::Network;
|
use neptune_cash::config_models::network::Network;
|
||||||
use neptune_cash::models::blockchain::block::block_selector::BlockSelector;
|
use neptune_cash::models::blockchain::block::block_selector::BlockSelector;
|
||||||
use neptune_cash::prelude::twenty_first::math::digest::Digest;
|
use neptune_cash::prelude::twenty_first::tip5::Digest;
|
||||||
use neptune_cash::rpc_auth;
|
use neptune_cash::rpc_auth;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
|||||||
@ -17,8 +17,8 @@ pub enum HeightOrDigest {
|
|||||||
impl std::fmt::Display for HeightOrDigest {
|
impl std::fmt::Display for HeightOrDigest {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Self::Digest(d) => write!(f, "{}", d),
|
Self::Digest(d) => write!(f, "{d}"),
|
||||||
Self::Height(h) => write!(f, "{}", h),
|
Self::Height(h) => write!(f, "{h}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ use axum::extract::Path;
|
|||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use axum::response::IntoResponse;
|
use axum::response::IntoResponse;
|
||||||
use axum::response::Json;
|
use axum::response::Json;
|
||||||
use neptune_cash::prelude::twenty_first::math::digest::Digest;
|
use neptune_cash::prelude::twenty_first::tip5::Digest;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tarpc::context;
|
use tarpc::context;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ use axum::extract::Path;
|
|||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use axum::response::IntoResponse;
|
use axum::response::IntoResponse;
|
||||||
use axum::response::Json;
|
use axum::response::Json;
|
||||||
use neptune_cash::prelude::twenty_first::math::digest::Digest;
|
use neptune_cash::prelude::twenty_first::tip5::Digest;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tarpc::context;
|
use tarpc::context;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user