Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yarom Swisa authored and Yarom Swisa committed Jun 25, 2023
1 parent 7a9570e commit 4dbf00a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x/pairing/keeper/provider_payment_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (k Keeper) AddProviderPaymentInEpoch(ctx sdk.Context, chainID string, epoch
}

// Function to get the total serviced CU by a provider in this epoch for a specific consumer
func (k Keeper) GetTotalUsedCUForConsumerPerEpoch(ctx sdk.Context, consumerAddress string, uniquePaymentStorageKeys []string, providerAddress string) (uint64, error) {
func (k Keeper) GetTotalUsedCUForConsumerPerEpoch(ctx sdk.Context, projectID string, uniquePaymentStorageKeys []string, providerAddress string) (uint64, error) {
usedCUProviderTotal := uint64(0)

// go over the uniquePaymentStorageKeys
Expand All @@ -113,12 +113,12 @@ func (k Keeper) GetTotalUsedCUForConsumerPerEpoch(ctx sdk.Context, consumerAddre
if !found {
return 0, utils.LavaFormatError("could not find uniquePaymentStorageClientProvider object", fmt.Errorf("unique payment object not found"),
utils.Attribute{Key: "providerAddress", Value: providerAddress},
utils.Attribute{Key: "consumerAddress", Value: consumerAddress},
utils.Attribute{Key: "projectID", Value: projectID},
)
}

// if the uniquePaymentStorageClientProvider object is between the provider and the specific consumer, add the serviced CU
if k.GetConsumerFromUniquePayment(&uniquePayment) == consumerAddress {
if k.GetConsumerFromUniquePayment(&uniquePayment) == projectID {
usedCUProviderTotal += uniquePayment.UsedCU
}
}
Expand Down

0 comments on commit 4dbf00a

Please sign in to comment.