From 5b0eb0459c7d29a25339c22a289153d27d57388e Mon Sep 17 00:00:00 2001 From: Hansie Odendaal <39146854+hansieodendaal@users.noreply.github.com> Date: Tue, 25 Oct 2022 11:45:22 +0200 Subject: [PATCH] feat: add static lifetime to emission amounts calculation (#4851) 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 --- base_layer/core/src/consensus/consensus_constants.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_layer/core/src/consensus/consensus_constants.rs b/base_layer/core/src/consensus/consensus_constants.rs index 471dfb44f8..09a7ab1ef3 100644 --- a/base_layer/core/src/consensus/consensus_constants.rs +++ b/base_layer/core/src/consensus/consensus_constants.rs @@ -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) }