Skip to content

Commit

Permalink
only account/delegation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Coats committed Feb 6, 2024
1 parent 8e2ae29 commit 6ce7cb2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions sdk/src/wallet/operations/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ where
output_id.transaction_id().slot_index(),
slot_index,
)?;
// Add mana rewards
if let Ok(response) = self.client().get_output_mana_rewards(output_id, slot_index).await {
balance.mana.rewards += response.rewards;
}
Expand Down Expand Up @@ -101,6 +102,10 @@ where
Output::Delegation(delegation) => {
// Add amount
balance.base_coin.total += delegation.amount();
// Add mana rewards
if let Ok(response) = self.client().get_output_mana_rewards(output_id, slot_index).await {
balance.mana.rewards += response.rewards;
}
// Add storage deposit
balance.required_storage_deposit.delegation += storage_cost;
if !wallet_data.locked_outputs.contains(output_id) {
Expand Down Expand Up @@ -132,9 +137,6 @@ where
output_id.transaction_id().slot_index(),
slot_index,
)?;
if let Ok(response) = self.client().get_output_mana_rewards(output_id, slot_index).await {
balance.mana.rewards += response.rewards;
}

// Add storage deposit
if output.is_basic() {
Expand Down Expand Up @@ -210,10 +212,6 @@ where
output_id.transaction_id().slot_index(),
slot_index,
)?;
if let Ok(response) = self.client().get_output_mana_rewards(output_id, slot_index).await
{
balance.mana.rewards += response.rewards;
}

// Add storage deposit
if output.is_basic() {
Expand Down

0 comments on commit 6ce7cb2

Please sign in to comment.