Skip to content

Commit

Permalink
why
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Feb 22, 2024
1 parent 26c2814 commit ae1d552
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
21 changes: 0 additions & 21 deletions keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,27 +173,6 @@ func (k Keeper) UpdateBondedPoolPower(ctx context.Context) error {
if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, stakingtypes.BondedPoolName, coins); err != nil {
return err
}
} else {

other := k.bankKeeper.GetBalance(ctx, authtypes.NewModuleAddress(stakingtypes.NotBondedPoolName), bondDenom).Amount
fmt.Println("other", other)

// diff := prevBal.Sub(newTotal)
// fmt.Println("prevBal", prevBal, "newTotal", newTotal, "diff", diff)
// coins := sdk.NewCoins(sdk.NewCoin(bondDenom, diff))
// fmt.Println("Burning coins from the bonded pool", coins)

// if err := k.bankKeeper.BurnCoins(ctx, stakingtypes.BondedPoolName, coins); err != nil {
// return err
// }

// if err := k.bankKeeper.MintCoins(ctx, minttypes.ModuleName, coins); err != nil {
// return err
// }

// if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, stakingtypes.BondedPoolName, coins); err != nil {
// return err
// }
}

return nil
Expand Down
4 changes: 4 additions & 0 deletions keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ func (f *testFixture) IncreaseBlock(amt int64, debug ...bool) ([]abci.ValidatorU
if err := f.appModule.BeginBlock(f.ctx); err != nil {
return nil, err
}

if err := f.appModule.EndBlock(f.ctx); err != nil {
return nil, err
}
}

return allUpdates, nil
Expand Down
2 changes: 1 addition & 1 deletion keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,8 @@ func TestRemoveValidator(t *testing.T) {
bondRatio, err := f.stakingKeeper.BondedRatio(f.ctx)
require.NoError(err)
fmt.Println("bonded ratio", bondRatio)
// require.EqualValues(sdkmath.LegacyOneDec(), bondRatio)
require.True(bondRatio.GTE(sdkmath.LegacyNewDecWithPrec(6666, 18)))
// This will be handled in the next endblock
})
}
}
Expand Down

0 comments on commit ae1d552

Please sign in to comment.