Skip to content

Commit

Permalink
fix(analytics): account for outputs with amount less than min deposit…
Browse files Browse the repository at this point in the history
… in ledger size analytics
  • Loading branch information
Alex Coats committed Feb 12, 2024
1 parent 8668d4f commit 918ad8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/analytics/ledger/ledger_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ impl LedgerSize for Output {
iota_sdk::types::block::output::Output::try_from_with_context(&protocol_params, self.clone()).unwrap();
let rent_bytes = RentStructureBytes::compute(&output);
LedgerSizeMeasurement {
total_storage_deposit_amount: Rent::rent_cost(&output, protocol_params.rent_structure()).into(),
total_storage_deposit_amount: Rent::rent_cost(&output, protocol_params.rent_structure())
.min(output.amount())
.into(),
total_key_bytes: rent_bytes.num_key_bytes,
total_data_bytes: rent_bytes.num_data_bytes,
}
Expand Down

0 comments on commit 918ad8a

Please sign in to comment.