From ec6d99e9d0248a94c6627cc02864c915b9a52b58 Mon Sep 17 00:00:00 2001 From: sword-smith Date: Fri, 3 Oct 2025 00:13:08 +0200 Subject: [PATCH] refactor: Change supply return type from f64 to i32 On the request of some aggregator that allegedly wanted the number in total number of coins, not in the atomic units. --- src/rpc/circulating_supply.rs | 10 +++++----- src/rpc/total_supply.rs | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/rpc/circulating_supply.rs b/src/rpc/circulating_supply.rs index 954f100..1f9d286 100644 --- a/src/rpc/circulating_supply.rs +++ b/src/rpc/circulating_supply.rs @@ -10,11 +10,11 @@ use crate::http_util::rpc_method_err; use crate::model::app_state::AppState; use crate::shared::monetary_supplies; -/// Return the monetary amount that is liquid, assuming all redemptions on the -/// old chain have successfully been made. Returned unit is nau, Neptune Atomic -/// Units. To convert to number of coins, divide by $4*10^{30}$. +/// Return the current monetary amount that is liquid, assuming all redemptions +/// on the old chain have successfully been made. Returned unit is in number of +/// coins. To convert to number of nau, multiply by $4*10^{30}$/ #[axum::debug_handler] -pub async fn circulating_supply(State(state): State>) -> Result, Response> { +pub async fn circulating_supply(State(state): State>) -> Result, Response> { let s = state.load(); let block_height = s @@ -26,5 +26,5 @@ pub async fn circulating_supply(State(state): State>) -> Result>) -> Result, Response> { +pub async fn total_supply(State(state): State>) -> Result, Response> { let s = state.load(); let block_height = s @@ -27,5 +27,5 @@ pub async fn total_supply(State(state): State>) -> Result