Skip to content

Add individual contract metrics

Luke Champine requested to merge contract-metrics into master

The contractor (and by extension, the renter) now returns per-contract metrics, defined by modules.RenterContractMetrics.

Unresolved questions:

  • How do we group per-contract metrics according to their allowance period?
  • How should these metrics be reported in the API?
  • What should be done with the existing RenterFinancialMetrics type?

re: grouping: The easiest approach right now would be to use contract.EndHeight(). Using the start height makes more intuitive sense for the user (since it's the height at which their funds were locked away), but currently the contractor doesn't store any info about when the allowance period began. I suppose you could just subtract the period from the end height, but then what if the allowance period is changed?

Merge request reports