Skip to content

Commit

Permalink
feat: add static lifetime to emission amounts calculation (#4851)
Browse files Browse the repository at this point in the history
Description
---
Added a static lifetime to `emission_amounts` calculation. This is needed if the `pub fn emission_amounts` will be called from an external client.

Motivation and Context
---
The `&'[u64]` return value was at odds with the `emission_decay: &'static [u64]` definition.

How Has This Been Tested?
---
Unit tests
External client
  • Loading branch information
hansieodendaal authored Oct 25, 2022
1 parent 0efb164 commit 5b0eb04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base_layer/core/src/consensus/consensus_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl ConsensusConstants {
}

/// This gets the emission curve values as (initial, decay, tail)
pub fn emission_amounts(&self) -> (MicroTari, &[u64], MicroTari) {
pub fn emission_amounts(&self) -> (MicroTari, &'static [u64], MicroTari) {
(self.emission_initial, self.emission_decay, self.emission_tail)
}

Expand Down

0 comments on commit 5b0eb04

Please sign in to comment.