From ad8748b66f71b68b807104b93d77cf636cd8ef0a Mon Sep 17 00:00:00 2001 From: Herr Seppia Date: Sun, 22 Dec 2024 15:06:28 +0100 Subject: [PATCH] rusk-recovery: support stake owner in genesis --- rusk-recovery/src/state/snapshot/stake.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rusk-recovery/src/state/snapshot/stake.rs b/rusk-recovery/src/state/snapshot/stake.rs index bfad413ad..198422047 100644 --- a/rusk-recovery/src/state/snapshot/stake.rs +++ b/rusk-recovery/src/state/snapshot/stake.rs @@ -14,7 +14,8 @@ use super::wrapper::Wrapper; #[derive(Serialize, Deserialize, PartialEq, Eq)] pub struct GenesisStake { - pub(crate) address: Wrapper, + address: Wrapper, + owner: Option>, pub amount: Dusk, pub eligibility: Option, pub reward: Option, @@ -26,6 +27,7 @@ impl GenesisStake { } pub fn to_stake_keys(&self) -> StakeKeys { - StakeKeys::single_key(*self.address()) + let owner: &BlsPublicKey = self.owner.as_ref().unwrap_or(&self.address); + StakeKeys::new(*self.address(), *owner) } }