Skip to content

Commit

Permalink
add pending tokens to RR calc (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
asalzmann authored Oct 25, 2022
1 parent ff1d2f9 commit c5ea19b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x/stakeibc/keeper/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func (k Keeper) UpdateRedemptionRates(ctx sdk.Context, depositRecords []recordst
func (k Keeper) GetUndelegatedBalance(hostZone types.HostZone, depositRecords []recordstypes.DepositRecord) (int64, error) {
// filter to only the deposit records for the host zone with status DELEGATION_QUEUE
UndelegatedDepositRecords := utils.FilterDepositRecords(depositRecords, func(record recordstypes.DepositRecord) (condition bool) {
return record.Status == recordstypes.DepositRecord_DELEGATION_QUEUE && record.HostZoneId == hostZone.ChainId
return ((record.Status == recordstypes.DepositRecord_DELEGATION_QUEUE || record.Status == recordstypes.DepositRecord_DELEGATION_IN_PROGRESS) && record.HostZoneId == hostZone.ChainId)
})

// sum the amounts of the deposit records
Expand All @@ -269,7 +269,7 @@ func (k Keeper) GetUndelegatedBalance(hostZone types.HostZone, depositRecords []
func (k Keeper) GetModuleAccountBalance(hostZone types.HostZone, depositRecords []recordstypes.DepositRecord) (int64, error) {
// filter to only the deposit records for the host zone with status DELEGATION
ModuleAccountRecords := utils.FilterDepositRecords(depositRecords, func(record recordstypes.DepositRecord) (condition bool) {
return record.Status == recordstypes.DepositRecord_TRANSFER_QUEUE && record.HostZoneId == hostZone.ChainId
return (record.Status == recordstypes.DepositRecord_TRANSFER_QUEUE || record.Status == recordstypes.DepositRecord_TRANSFER_IN_PROGRESS) && record.HostZoneId == hostZone.ChainId
})

// sum the amounts of the deposit records
Expand Down

0 comments on commit c5ea19b

Please sign in to comment.