From 9e81298320e8369a50db7fd6933fffbfb70fd94c Mon Sep 17 00:00:00 2001 From: chinyuchan Date: Tue, 25 Jun 2024 11:22:45 +0800 Subject: [PATCH 1/2] fix: api. --- explorer/src/main.rs | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/explorer/src/main.rs b/explorer/src/main.rs index a988696..25ebd3b 100644 --- a/explorer/src/main.rs +++ b/explorer/src/main.rs @@ -63,28 +63,28 @@ async fn main() -> Result<()> { .route("/api/address/count", get(get_address_count)) .route("/api/chain/statistics", get(get_statistics)) .route("/api/txs/distribute", get(get_tx_distribute)) - .route("/api/v2/txs/distribute", get(get_tx_distribute)) - .route("/api/v2/address/count", get(get_address_count)) - .route("/api/v2/chain/statistic", get(get_statistics)) - .route("/api/v2/number/block", get(get_block_by_num)) - .route("/api/v2/hash/block", get(get_block_by_hash)) - .route("/api/v2/blocks", get(get_blocks)) - .route("/api/v2/hash/tx", get(get_tx_by_hash)) - .route("/api/v2/txs", get(get_txs)) - .route("/api/v2/assets", get(get_assets)) - .route("/api/v2/hash/claim", get(get_claim_by_tx_hash)) - .route("/api/v2/claims", get(get_claims)) - .route("/api/v2/hash/delegation", get(get_delegation_by_tx_hash)) - .route("/api/v2/delegations", get(get_delegations)) + .route("/api/txs/distribute", get(get_tx_distribute)) + .route("/api/address/count", get(get_address_count)) + .route("/api/chain/statistic", get(get_statistics)) + .route("/api/number/block", get(get_block_by_num)) + .route("/api/hash/block", get(get_block_by_hash)) + .route("/api/blocks", get(get_blocks)) + .route("/api/hash/tx", get(get_tx_by_hash)) + .route("/api/txs", get(get_txs)) + .route("/api/assets", get(get_assets)) + .route("/api/hash/claim", get(get_claim_by_tx_hash)) + .route("/api/claims", get(get_claims)) + .route("/api/hash/delegation", get(get_delegation_by_tx_hash)) + .route("/api/delegations", get(get_delegations)) .route( - "/api/v2/hash/undelegation", + "/api/hash/undelegation", get(get_undelegation_by_tx_hash), ) - .route("/api/v2/undelegations", get(get_undelegations)) - .route("/api/v2/hash/n2e", get(get_n2e_by_tx_hash)) - .route("/api/v2/n2es", get(get_n2e_txs)) - .route("/api/v2/hash/e2n", get(get_e2n_by_tx_hash)) - .route("/api/v2/e2ns", get(get_e2n_txs)) + .route("/api/undelegations", get(get_undelegations)) + .route("/api/hash/n2e", get(get_n2e_by_tx_hash)) + .route("/api/n2es", get(get_n2e_txs)) + .route("/api/hash/e2n", get(get_e2n_by_tx_hash)) + .route("/api/e2ns", get(get_e2n_txs)) .layer(cors) .with_state(app_state); let listener = tokio::net::TcpListener::bind(&addr).await.unwrap(); From 33662175d539e41a7d1f047a61c3938d2517b24a Mon Sep 17 00:00:00 2001 From: chinyuchan Date: Tue, 25 Jun 2024 11:24:50 +0800 Subject: [PATCH 2/2] fix lint. --- explorer/src/main.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/explorer/src/main.rs b/explorer/src/main.rs index 25ebd3b..5fec37e 100644 --- a/explorer/src/main.rs +++ b/explorer/src/main.rs @@ -76,10 +76,7 @@ async fn main() -> Result<()> { .route("/api/claims", get(get_claims)) .route("/api/hash/delegation", get(get_delegation_by_tx_hash)) .route("/api/delegations", get(get_delegations)) - .route( - "/api/hash/undelegation", - get(get_undelegation_by_tx_hash), - ) + .route("/api/hash/undelegation", get(get_undelegation_by_tx_hash)) .route("/api/undelegations", get(get_undelegations)) .route("/api/hash/n2e", get(get_n2e_by_tx_hash)) .route("/api/n2es", get(get_n2e_txs))