Skip to content

Commit

Permalink
do not count validation blocks as no payload
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Coats committed Mar 7, 2024
1 parent c5ef64e commit a302ebe
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/analytics/tangle/block_activity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,17 @@ impl Analytics for BlockActivityMeasurement {
_ctx: &dyn AnalyticsContext,
) -> eyre::Result<()> {
match block.body() {
BlockBody::Basic(_) => self.basic_count += 1,
BlockBody::Basic(basic_body) => {
self.basic_count += 1;
match basic_body.payload() {
Some(Payload::TaggedData(_)) => self.tagged_data_count += 1,
Some(Payload::SignedTransaction(_)) => self.transaction_count += 1,
Some(Payload::CandidacyAnnouncement(_)) => self.candidacy_announcement_count += 1,
None => self.no_payload_count += 1,
}
}
BlockBody::Validation(_) => self.validation_count += 1,
}
match block.body().as_basic_opt().and_then(|b| b.payload()) {
Some(Payload::TaggedData(_)) => self.tagged_data_count += 1,
Some(Payload::SignedTransaction(_)) => self.transaction_count += 1,
Some(Payload::CandidacyAnnouncement(_)) => self.candidacy_announcement_count += 1,
None => self.no_payload_count += 1,
}
match &metadata.block_state {
BlockState::Pending => self.block_pending_count += 1,
BlockState::Accepted => self.block_accepted_count += 1,
Expand Down

0 comments on commit a302ebe

Please sign in to comment.