From 94f97caab02d0442a4ae5cc42c40cfbeb22738b5 Mon Sep 17 00:00:00 2001 From: David Rusu Date: Thu, 25 Jan 2024 15:26:54 +0400 Subject: [PATCH] rename EpochState.stake_distribution() to EpochState.total_stake() --- cryptarchia/cryptarchia.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cryptarchia/cryptarchia.py b/cryptarchia/cryptarchia.py index da16c7d..5d94d05 100644 --- a/cryptarchia/cryptarchia.py +++ b/cryptarchia/cryptarchia.py @@ -159,7 +159,7 @@ class EpochState: # The nonce snapshot is taken 7k/f slots into the previous epoch nonce_snapshot: LedgerState - def stake_distribution(self) -> int: + def total_stake(self) -> int: """Returns the total stake that will be used to reletivize leadership proofs during this epoch""" return self.stake_distribution_snapshot.total_stake @@ -208,8 +208,7 @@ class Leader: def is_slot_leader(self, epoch: EpochState, slot: Slot) -> bool: f = self.config.active_slot_coeff - total_stake = epoch.stake_distribution() - relative_stake = self.coin.value / total_stake + relative_stake = self.coin.value / epoch.total_stake() r = MOCK_LEADER_VRF.vrf(self.coin.pk, epoch.nonce(), slot)