diff --git a/rusk/src/lib/http/rusk.rs b/rusk/src/lib/http/rusk.rs index fc3fd4cfd..f3ee5370e 100644 --- a/rusk/src/lib/http/rusk.rs +++ b/rusk/src/lib/http/rusk.rs @@ -96,14 +96,15 @@ impl Rusk { let prov: Vec<_> = self .provisioners(None) .expect("Cannot query state for provisioners") - .filter_map(|(key, stake)| { + .map(|(key, stake)| { let key = bs58::encode(key.to_bytes()).into_string(); let (amount, eligibility) = stake.amount.unwrap_or_default(); - (amount > 0).then_some(Provisioner { + Provisioner { amount, eligibility, key, - }) + reward, + } }) .collect(); @@ -121,4 +122,5 @@ struct Provisioner { key: String, amount: u64, eligibility: u64, + reward: u64, } diff --git a/rusk/tests/common/wallet.rs b/rusk/tests/common/wallet.rs index ff19413c5..4ba610544 100644 --- a/rusk/tests/common/wallet.rs +++ b/rusk/tests/common/wallet.rs @@ -113,12 +113,11 @@ impl wallet::StateClient for TestStateClient { .ok_or(Error::OpeningPositionNotFound(*note.pos())) } - fn fetch_stake(&self, _pk: &PublicKey) -> Result { + fn fetch_stake(&self, pk: &PublicKey) -> Result { let stake = self .rusk - .provisioners(None)? - .find(|(pk, _)| pk == _pk) - .map(|(_, stake)| StakeInfo { + .provisioner(pk)? + .map(|stake| StakeInfo { amount: stake.amount, counter: stake.counter, reward: stake.reward,