Skip to content

Commit

Permalink
chore: add TODOs & update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite committed Oct 1, 2024
1 parent 090ca9a commit c14ad46
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tests/integration/application/min_stake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (s *applicationMinStakeTestSuite) stakeApp() {

// stakeSupplier stakes a supplier for service 1.
func (s *applicationMinStakeTestSuite) stakeSupplier() {
// TODO_NEXT(@bryanchriswhite, #612): Replace supplierStake with suppleirtypes.DefaultMinStake.
// TODO_UPNEXT(@bryanchriswhite, #612): Replace supplierStake with suppleirtypes.DefaultMinStake.
supplierStake := cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 1000000) // 1 POKT.
s.keepers.SupplierKeeper.SetSupplier(s.ctx, sharedtypes.Supplier{
OwnerAddress: s.supplierBech32,
Expand Down Expand Up @@ -236,7 +236,7 @@ func (s *applicationMinStakeTestSuite) getClaim(
}
}

// TODO_IN_THIS_COMMIT: godoc...
// getAppBalance returns the bank module balance for the application.
func (s *applicationMinStakeTestSuite) getAppBalance() *cosmostypes.Coin {
appBalRes, err := s.keepers.BankKeeper.Balance(s.ctx, &banktypes.QueryBalanceRequest{
Address: s.appBech32, Denom: volatile.DenomuPOKT,
Expand Down
2 changes: 1 addition & 1 deletion x/application/keeper/msg_server_stake_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (k msgServer) StakeApplication(ctx context.Context, msg *types.MsgStakeAppl
logger.Info(fmt.Sprintf("Application is going to escrow an additional %+v coins", coinsToEscrow))

// If the application has initiated an unstake action, cancel it since it is staking again.
// TODO_NEXT:(@bryanchriswhite): assert on EventApplicationUnbondingCanceled
// TODO_UPNEXT:(@bryanchriswhite): assert that an EventApplicationUnbondingCanceled event was emitted.
foundApp.UnstakeSessionEndHeight = types.ApplicationNotUnstaking
}

Expand Down
2 changes: 1 addition & 1 deletion x/application/keeper/msg_server_unstake_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (k msgServer) UnstakeApplication(
foundApp.UnstakeSessionEndHeight = uint64(shared.GetSessionEndHeight(&sharedParams, currentHeight))
k.SetApplication(ctx, foundApp)

// TODO_NEXT:(@bryanchriswhite): emit a new EventApplicationUnbondingBegin
// TODO_UPNEXT:(@bryanchriswhite): emit a new EventApplicationUnbondingBegin event.

isSuccessful = true
return &types.MsgUnstakeApplicationResponse{}, nil
Expand Down
8 changes: 4 additions & 4 deletions x/application/keeper/msg_server_unstake_application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func TestMsgServer_UnstakeApplication_Success(t *testing.T) {
_, err = srv.UnstakeApplication(ctx, unstakeMsg)
require.NoError(t, err)

// TODO_NEXT:(@bryanchriswhite): assert on EventApplicationUnbondingBegin
// TODO_UPNEXT:(@bryanchriswhite): assert that an EventApplicationUnbondingBegin event was emitted.

// Make sure the application entered the unbonding period
foundApp, isAppFound = applicationModuleKeepers.GetApplication(ctx, unstakingAppAddr)
Expand All @@ -72,7 +72,7 @@ func TestMsgServer_UnstakeApplication_Success(t *testing.T) {
err = applicationModuleKeepers.EndBlockerUnbondApplications(ctx)
require.NoError(t, err)

// TODO_NEXT:(@bryanchriswhite): assert on EventApplicationUnbondingEnd
// TODO_UPNEXT:(@bryanchriswhite): assert that an EventApplicationUnbondingEnd event was emitted.

// Make sure the unstaking application is removed from the applications list when
// the unbonding period is over.
Expand Down Expand Up @@ -109,7 +109,7 @@ func TestMsgServer_UnstakeApplication_CancelUnbondingIfRestaked(t *testing.T) {
_, err = srv.UnstakeApplication(ctx, unstakeMsg)
require.NoError(t, err)

// TODO_NEXT:(@bryanchriswhite): assert on EventApplicationUnbondingBegin
// TODO_UPNEXT:(@bryanchriswhite): assert that an EventApplicationUnbondingBegin event was emitted.

// Make sure the application entered the unbonding period
foundApp, isAppFound = applicationModuleKeepers.GetApplication(ctx, appAddr)
Expand All @@ -123,7 +123,7 @@ func TestMsgServer_UnstakeApplication_CancelUnbondingIfRestaked(t *testing.T) {
_, err = srv.StakeApplication(ctx, stakeMsg)
require.NoError(t, err)

// TODO_NEXT:(@bryanchriswhite): assert on EventApplicationUnbondingCancelled
// TODO_UPNEXT:(@bryanchriswhite): assert that an EventApplicationUnbondingCanceled event was emitted.

// Make sure the application is no longer in the unbonding period
foundApp, isAppFound = applicationModuleKeepers.GetApplication(ctx, appAddr)
Expand Down
2 changes: 1 addition & 1 deletion x/application/keeper/unbond_applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (k Keeper) EndBlockerUnbondApplications(ctx context.Context) error {
return err
}

// TODO_NEXT(@bryanchriswhite): emit a new EventApplicationUnbondingEnd.
// TODO_UPNEXT(@bryanchriswhite): emit a new EventApplicationUnbondingEnd event.
}

return nil
Expand Down
2 changes: 2 additions & 0 deletions x/tokenomics/keeper/token_logic_modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ func (k Keeper) ProcessTokenLogicModules(
if err := k.applicationKeeper.UnbondApplication(ctx, &application); err != nil {
return err
}

// TODO_UPNEXT:(@bryanchriswhite): emit a new EventApplicationUnbondedBelowMinStake event.
} else {
// State mutation: update the application's on-chain record.
k.applicationKeeper.SetApplication(ctx, application)
Expand Down

0 comments on commit c14ad46

Please sign in to comment.