From a0433189380f3824d7989ef1cab3204bc6fbc57e Mon Sep 17 00:00:00 2001 From: hopeyen Date: Sat, 10 Feb 2024 12:24:54 -0600 Subject: [PATCH 1/2] refactor: info returns an object --- common/src/indexer_service/http/indexer_service.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/src/indexer_service/http/indexer_service.rs b/common/src/indexer_service/http/indexer_service.rs index 3f1571e3..b68f521e 100644 --- a/common/src/indexer_service/http/indexer_service.rs +++ b/common/src/indexer_service/http/indexer_service.rs @@ -313,12 +313,14 @@ impl IndexerService { )), }; - let operator_address = public_key(&options.config.indexer.operator_mnemonic)?; + let operator_address = Json( + serde_json::json!({ "operator": public_key(&options.config.indexer.operator_mnemonic)?}), + ); let mut misc_routes = Router::new() .route("/", get("Service is up and running")) .route("/version", get(Json(options.release))) - .route("/info", get(Json(operator_address))) + .route("/info", get(operator_address)) .layer( ServiceBuilder::new() .layer(HandleErrorLayer::new(|e: BoxError| async move { From 8b8e1080beb18e86cb04d16fe51a2835d7de65e9 Mon Sep 17 00:00:00 2001 From: hopeyen Date: Mon, 12 Feb 2024 08:05:56 -0600 Subject: [PATCH 2/2] fix: use public key as the field name --- common/src/indexer_service/http/indexer_service.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/indexer_service/http/indexer_service.rs b/common/src/indexer_service/http/indexer_service.rs index b68f521e..9ea8f92c 100644 --- a/common/src/indexer_service/http/indexer_service.rs +++ b/common/src/indexer_service/http/indexer_service.rs @@ -314,7 +314,7 @@ impl IndexerService { }; let operator_address = Json( - serde_json::json!({ "operator": public_key(&options.config.indexer.operator_mnemonic)?}), + serde_json::json!({ "publicKey": public_key(&options.config.indexer.operator_mnemonic)?}), ); let mut misc_routes = Router::new()