Skip to content

Commit

Permalink
fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
puneet2019 committed Apr 30, 2024
1 parent d6af09f commit 4ca32d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
8 changes: 4 additions & 4 deletions x/liquidstake/keeper/rebalancing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,17 @@ func (s *KeeperTestSuite) TestRebalancingCase1() {
reds = s.keeper.UpdateLiquidValidatorSet(s.ctx)
s.Require().Len(reds, 1)

// all redelegated, no delShares
// all redelegated, no delShares ( exception, dust )
proxyAccDel2, found = s.app.StakingKeeper.GetDelegation(s.ctx, types.LiquidStakeProxyAcc, valOpers[1])
s.Require().False(found)
s.Require().True(proxyAccDel2.Shares.LT(sdk.OneDec()))

// liquid validator removed, invalid after tombstoned
lvState, found = s.keeper.GetLiquidValidatorState(s.ctx, valOpers[1])
s.Require().True(found)
s.Require().Equal(lvState.OperatorAddress, valOpers[1].String())
s.Require().Equal(lvState.Status, types.ValidatorStatusInactive)
s.Require().EqualValues(lvState.DelShares, sdk.ZeroDec())
s.Require().EqualValues(lvState.LiquidTokens, sdk.ZeroInt())
s.Require().True(proxyAccDel2.Shares.LT(sdk.OneDec()))
s.Require().True(lvState.LiquidTokens.Equal(sdk.ZeroInt()))

// jail last liquid validator, undelegate all liquid tokens to proxy acc
nasBefore := s.keeper.GetNetAmountState(s.ctx)
Expand Down
16 changes: 0 additions & 16 deletions x/liquidstake/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,21 @@ type StakingKeeper interface {
delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation stakingtypes.Delegation, found bool)
IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress,
fn func(index int64, delegation stakingtypes.DelegationI) (stop bool))
Delegate(
ctx sdk.Context, delAddr sdk.AccAddress, bondAmt math.Int, tokenSrc stakingtypes.BondStatus,
validator stakingtypes.Validator, subtractAccount bool,
) (newShares math.LegacyDec, err error)

BondDenom(ctx sdk.Context) (res string)
Unbond(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, shares math.LegacyDec) (amount math.Int, err error)
UnbondingTime(ctx sdk.Context) (res time.Duration)
SetUnbondingDelegationEntry(
ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress,
creationHeight int64, minTime time.Time, balance math.Int,
) stakingtypes.UnbondingDelegation
InsertUBDQueue(ctx sdk.Context, ubd stakingtypes.UnbondingDelegation,
completionTime time.Time)
ValidateUnbondAmount(
ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt math.Int,
) (shares math.LegacyDec, err error)
GetUnbondingDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (stakingtypes.UnbondingDelegation, bool)
GetAllUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress) []stakingtypes.UnbondingDelegation
BeginRedelegation(
ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, sharesAmount math.LegacyDec,
) (completionTime time.Time, err error)
GetAllRedelegations(
ctx sdk.Context, delegator sdk.AccAddress, srcValAddress, dstValAddress sdk.ValAddress,
) []stakingtypes.Redelegation
HasReceivingRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valDstAddr sdk.ValAddress) bool
BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate
HasMaxUnbondingDelegationEntries(ctx sdk.Context,
delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) bool
SafelyIncreaseTotalLiquidStakedTokens(ctx sdk.Context, amount math.Int, sharesAlreadyBonded bool) error
DecreaseTotalLiquidStakedTokens(ctx sdk.Context, amount math.Int) error
GetBondedPool(ctx sdk.Context) (bondedPool authtypes.ModuleAccountI)
}

Expand Down

0 comments on commit 4ca32d8

Please sign in to comment.