Skip to content

Commit

Permalink
rusk-recovery: support stake owner in genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
herr-seppia committed Dec 22, 2024
1 parent 3b60ac2 commit ad8748b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rusk-recovery/src/state/snapshot/stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ use super::wrapper::Wrapper;

#[derive(Serialize, Deserialize, PartialEq, Eq)]
pub struct GenesisStake {
pub(crate) address: Wrapper<BlsPublicKey, { BlsPublicKey::SIZE }>,
address: Wrapper<BlsPublicKey, { BlsPublicKey::SIZE }>,
owner: Option<Wrapper<BlsPublicKey, { BlsPublicKey::SIZE }>>,
pub amount: Dusk,
pub eligibility: Option<u64>,
pub reward: Option<Dusk>,
Expand All @@ -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)
}
}

0 comments on commit ad8748b

Please sign in to comment.