From d74e93b433746b4370a20a99216ce017fd91a52b Mon Sep 17 00:00:00 2001 From: vishnukumavat Date: Wed, 20 Mar 2024 02:49:01 +0530 Subject: [PATCH] bug fix --- x/gasless/keeper/fee_helper.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/x/gasless/keeper/fee_helper.go b/x/gasless/keeper/fee_helper.go index 19e0d310a..56179d058 100644 --- a/x/gasless/keeper/fee_helper.go +++ b/x/gasless/keeper/fee_helper.go @@ -191,10 +191,11 @@ func (k Keeper) GetFeeSource(ctx sdk.Context, sdkTx sdk.Tx, originalFeePayer sdk if !found { usage.Contracts = append(usage.Contracts, &types.UsageDetails{ UsageIdentifier: contractAddress, - Details: []*types.UsageDetail{}, + Details: []*types.UsageDetail{&usageDetail}, }) + } else { + usage.Contracts[contractUsageIdentifierIndex].Details = append(usage.Contracts[contractUsageIdentifierIndex].Details, &usageDetail) } - usage.Contracts[contractUsageIdentifierIndex].Details = append(usage.Contracts[contractUsageIdentifierIndex].Details, &usageDetail) } else { found := false messageTypeURLUsageIdentifierIndex := 0 @@ -215,10 +216,11 @@ func (k Keeper) GetFeeSource(ctx sdk.Context, sdkTx sdk.Tx, originalFeePayer sdk if !found { usage.Txs = append(usage.Txs, &types.UsageDetails{ UsageIdentifier: msgTypeURL, - Details: []*types.UsageDetail{}, + Details: []*types.UsageDetail{&usageDetail}, }) + } else { + usage.Txs[messageTypeURLUsageIdentifierIndex].Details = append(usage.Txs[messageTypeURLUsageIdentifierIndex].Details, &usageDetail) } - usage.Txs[messageTypeURLUsageIdentifierIndex].Details = append(usage.Txs[messageTypeURLUsageIdentifierIndex].Details, &usageDetail) } // assign the updated usage and set it to the store gasConsumer.Consumption[consumptionIndex].Usage = usage