@@ -535,7 +535,7 @@ where
535535 amount,
536536 ) = result?;
537537 if epoch >= withdrawable {
538- total = checked ! ( total + amount) ?;
538+ checked ! ( total += amount) ?;
539539 }
540540 }
541541 Ok ( total)
@@ -733,32 +733,27 @@ fn enrich_bonds_and_unbonds(
733733
734734 for bond in & detail. bonds {
735735 let slashed_bond = bond. slashed_amount . unwrap_or_default ( ) ;
736- bond_total = checked ! ( bond_total + bond. amount) ?;
737- bond_total_slashed =
738- checked ! ( bond_total_slashed + slashed_bond) ?;
736+ checked ! ( bond_total += bond. amount) ?;
737+ checked ! ( bond_total_slashed += slashed_bond) ?;
739738 }
740739 for unbond in & detail. unbonds {
741740 let slashed_unbond =
742741 unbond. slashed_amount . unwrap_or_default ( ) ;
743- unbond_total = checked ! ( unbond_total + unbond. amount) ?;
744- unbond_total_slashed =
745- checked ! ( unbond_total_slashed + slashed_unbond) ?;
742+ checked ! ( unbond_total += unbond. amount) ?;
743+ checked ! ( unbond_total_slashed += slashed_unbond) ?;
746744
747745 if current_epoch >= unbond. withdraw {
748- withdrawable = checked ! (
749- withdrawable + unbond. amount - slashed_unbond
746+ checked ! (
747+ withdrawable += unbond. amount - slashed_unbond
750748 ) ?;
751749 }
752750 }
753751
754- bonds_total = checked ! ( bonds_total + bond_total) ?;
755- bonds_total_slashed =
756- checked ! ( bonds_total_slashed + bond_total_slashed) ?;
757- unbonds_total = checked ! ( unbonds_total + unbond_total) ?;
758- unbonds_total_slashed =
759- checked ! ( unbonds_total_slashed + unbond_total_slashed) ?;
760- total_withdrawable =
761- checked ! ( total_withdrawable + withdrawable) ?;
752+ checked ! ( bonds_total += bond_total) ?;
753+ checked ! ( bonds_total_slashed += bond_total_slashed) ?;
754+ checked ! ( unbonds_total += unbond_total) ?;
755+ checked ! ( unbonds_total_slashed += unbond_total_slashed) ?;
756+ checked ! ( total_withdrawable += withdrawable) ?;
762757
763758 let enriched_detail = EnrichedBondsAndUnbondsDetail {
764759 data : detail,
0 commit comments