Skip to content

Commit

Permalink
LNO-148, update record logic
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxiaff committed Sep 14, 2018
1 parent 269976c commit c21f3f9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/post/donation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ func TestNormalDonation(t *testing.T) {
test.CheckBalance(t, newPostUser, lb, types.NewCoinFromInt64(9900000+4750000))
test.SignCheckDeliver(
t, lb, claimMsg, 2, true, newPostUserTransactionPriv, baseTime+test.ConsumptionFreezingPeriodSec+1)
test.CheckBalance(t, newPostUser, lb, types.NewCoinFromInt64(1228089028362))
test.CheckBalance(t, newPostUser, lb, types.NewCoinFromInt64(614051839181))
}
2 changes: 2 additions & 0 deletions x/global/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1633,6 +1633,8 @@ func TestRecordConsumptionAndLinoStake(t *testing.T) {
for _, tc := range testCases {
err := gm.storage.SetLinoStakeStat(ctx, tc.atDay-1, &tc.previousStat)
assert.Nil(t, err)
err = gm.SetPastMinutes(ctx, tc.atDay*24*60)
assert.Nil(t, err)
ctx = ctx.WithBlockHeader(abci.Header{Time: time.Unix(tc.atDay*3600*24, 0)})
err = gm.RecordConsumptionAndLinoStake(ctx)
assert.Nil(t, err)
Expand Down
3 changes: 0 additions & 3 deletions x/post/event.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package post

import (
"fmt"

"github.com/cosmos/cosmos-sdk/wire"

"github.com/lino-network/lino/types"
Expand Down Expand Up @@ -67,7 +65,6 @@ func (event RewardEvent) Execute(
return err
}
// add half reward to user
fmt.Println(reward)
addToReward := types.RatToCoin(reward.ToRat().Mul(sdk.NewRat(1, 2)))
addToStake := reward.Minus(addToReward)
if err := am.AddIncomeAndReward(
Expand Down

0 comments on commit c21f3f9

Please sign in to comment.