Skip to content

Commit

Permalink
Merge branch 'main' into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Coats committed Feb 22, 2024
2 parents 6352a19 + d7ad6dd commit 09f68e9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/analytics/ledger/active_addresses.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 IOTA Stiftung
// Copyright 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use std::collections::HashSet;
Expand Down Expand Up @@ -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()));
}
}

Expand Down
7 changes: 2 additions & 5 deletions src/analytics/ledger/address_balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/bin/inx-chronicle/cli/analytics.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 IOTA Stiftung
// Copyright 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use std::collections::HashSet;
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/model/ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 09f68e9

Please sign in to comment.