From 082eef46c2aa5f039f227245ea39d36265bbb392 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Fri, 14 Apr 2023 15:06:14 -0700 Subject: [PATCH] Add getters for new block attributes --- synthesizer/src/block/header/mod.rs | 10 ++++++++++ synthesizer/src/block/mod.rs | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/synthesizer/src/block/header/mod.rs b/synthesizer/src/block/header/mod.rs index 5a1c8092ff..19f9bff488 100644 --- a/synthesizer/src/block/header/mod.rs +++ b/synthesizer/src/block/header/mod.rs @@ -110,6 +110,16 @@ impl Header { self.metadata.height() } + /// Returns the total supply of microcredits at this block. + pub const fn total_supply(&self) -> u64 { + self.metadata.total_supply() + } + + /// Returns the cumulative proof target for this block. + pub const fn cumulative_proof_target(&self) -> u128 { + self.metadata.cumulative_proof_target() + } + /// Returns the coinbase target for this block. pub const fn coinbase_target(&self) -> u64 { self.metadata.coinbase_target() diff --git a/synthesizer/src/block/mod.rs b/synthesizer/src/block/mod.rs index 48e58ac1e3..18264b8154 100644 --- a/synthesizer/src/block/mod.rs +++ b/synthesizer/src/block/mod.rs @@ -174,6 +174,16 @@ impl Block { self.height() / N::NUM_BLOCKS_PER_EPOCH } + /// Returns the total supply of microcredits at this block. + pub const fn total_supply(&self) -> u64 { + self.header.total_supply() + } + + /// Returns the cumulative proof target for this block. + pub const fn cumulative_proof_target(&self) -> u128 { + self.header.cumulative_proof_target() + } + /// Returns the coinbase target for this block. pub const fn coinbase_target(&self) -> u64 { self.header.coinbase_target()