Skip to content

Commit 8590f30

Browse files
committed
improve farming reward estimation
1 parent 6240f1a commit 8590f30

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

x/farming/keeper/reward.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,14 @@ func (k Keeper) GetEstimatedReward(ctx sdk.Context, address string, amount sdk.C
6565

6666
types.UpdateEpochTotalStakings(nextEpoch, staking)
6767

68-
totalStakings := []types.TotalStaking{}
68+
totalStakings := []types.TotalStaking{
69+
types.TotalStaking{
70+
Denom: staking.Amount.Denom,
71+
Amount: staking.Amount,
72+
EffectiveAmount: staking.EffectiveAmount,
73+
},
74+
}
75+
6976
for _, staking := range k.GetStakingsByAddress(ctx, address) {
7077
if !staking.StartTime.Add(staking.LockDuration).Before(nextEpoch.StartTime) {
7178
totalStakings = types.UpdateAccountTotalStakings(totalStakings, staking)

0 commit comments

Comments
 (0)