diff --git a/src/analytics/ledger/active_addresses.rs b/src/analytics/ledger/active_addresses.rs index a57e11d4f..9c6d1ce2c 100644 --- a/src/analytics/ledger/active_addresses.rs +++ b/src/analytics/ledger/active_addresses.rs @@ -1,4 +1,4 @@ -// Copyright 2023 IOTA Stiftung +// Copyright 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 use std::collections::HashSet; @@ -69,11 +69,11 @@ impl Analytics for AddressActivityAnalytics { ctx: &dyn AnalyticsContext, ) { for output in consumed { - self.add_address(output.locked_address_at(ctx.slot_index(), ctx.protocol_parameters())); + self.add_address(output.output.locked_address(ctx.protocol_parameters())); } for output in created { - self.add_address(output.locked_address_at(ctx.slot_index(), ctx.protocol_parameters())); + self.add_address(output.locked_address(ctx.protocol_parameters())); } } diff --git a/src/analytics/ledger/address_balance.rs b/src/analytics/ledger/address_balance.rs index c100a2e29..5b38595fb 100644 --- a/src/analytics/ledger/address_balance.rs +++ b/src/analytics/ledger/address_balance.rs @@ -135,16 +135,13 @@ impl Analytics for AddressBalancesAnalytics { ) { for output in consumed { self.remove_amount( - &output.locked_address_at(ctx.slot_index(), ctx.protocol_parameters()), + &output.output.locked_address(ctx.protocol_parameters()), output.amount(), ); } for output in created { - self.add_address( - output.locked_address_at(ctx.slot_index(), ctx.protocol_parameters()), - output.amount(), - ) + self.add_address(output.locked_address(ctx.protocol_parameters()), output.amount()) } } diff --git a/src/bin/inx-chronicle/cli/analytics.rs b/src/bin/inx-chronicle/cli/analytics.rs index 99f1c77f4..09b804883 100644 --- a/src/bin/inx-chronicle/cli/analytics.rs +++ b/src/bin/inx-chronicle/cli/analytics.rs @@ -1,4 +1,4 @@ -// Copyright 2023 IOTA Stiftung +// Copyright 2024 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 use std::collections::HashSet; @@ -24,7 +24,9 @@ use tracing::{debug, info}; use crate::config::ChronicleConfig; -/// This command accepts both slot index and date ranges. The following rules apply: +/// This command accepts both slot index and date ranges. +/// +/// The following rules apply: /// /// - If both slot and date are specified, the date will be used for interval analytics /// while the slot will be used for per-slot analytics. diff --git a/src/model/ledger.rs b/src/model/ledger.rs index af2a0643e..95a04508e 100644 --- a/src/model/ledger.rs +++ b/src/model/ledger.rs @@ -73,7 +73,7 @@ impl LedgerOutput { .unwrap_or(owning_address) } - /// Returns the [`Address`] that is in control of the output at the spent slot. + /// Returns the [`Address`] that is in control of the output at the booked slot. pub fn locked_address(&self, protocol_parameters: &ProtocolParameters) -> Address { self.locked_address_at(self.slot_booked, protocol_parameters) } @@ -127,7 +127,7 @@ impl LedgerSpent { self.output.locked_address_at(slot, protocol_parameters) } - /// Returns the [`Address`] that is in control of the output at the booked slot. + /// Returns the [`Address`] that is in control of the output at the spent slot. pub fn locked_address(&self, protocol_parameters: &ProtocolParameters) -> Address { self.locked_address_at(self.slot_spent, protocol_parameters) }