Skip to content

Commit

Permalink
CNS-262: added improve TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
oren-lava committed Feb 1, 2023
1 parent 88c3a3b commit 4679d69
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions x/pairing/keeper/epoch_payments.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func (k Keeper) AddEpochPayment(ctx sdk.Context, chainID string, epoch uint64, u
epochPayments = types.EpochPayments{Index: key, ProviderPaymentStorageKeys: []string{userPaymentProviderStorage.GetIndex()}}
} else {
// this epoch has a epochPayments object -> make sure this payment is not already in this object
// TODO: improve - have it sorted and binary search, store indexes map for the current epoch providers stake and just lookup at the provider index (and turn it on) - assumes most providers will have payments
providerPaymentStorageKeyFound := false
for _, providerPaymentStorageKey := range epochPayments.GetProviderPaymentStorageKeys() {
if providerPaymentStorageKey == userPaymentProviderStorage.GetIndex() {
Expand Down

0 comments on commit 4679d69

Please sign in to comment.