Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Hungry Warrior committed Aug 8, 2024
1 parent 09cc073 commit c3ca4ab
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions x/vesting/keeper/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,39 +244,39 @@ func validateVestingAccountBalances(

lockedX := app.BankKeeper.LockedCoins(ctx, address)
if lockedX == nil {
Expect(expLocked).To(Equal(sdk.NewCoins()))
Expect(sdk.NewCoins()).To(Equal(expLocked))
} else {
Expect(lockedX).To(Equal(expLocked))
}

spendableX := app.BankKeeper.SpendableCoins(ctx, address)
if spendableX == nil {
Expect(expSpendable).To(Equal(sdk.NewCoins()))
Expect(sdk.NewCoins()).To(Equal(expSpendable))
} else {
Expect(spendableX).To(Equal(expSpendable))
}

now := ctx.BlockTime()
vestedX := mva.GetVestedCoins(now)
if vestedX == nil {
Expect(expVested).To(Equal(sdk.NewCoins()))
Expect(sdk.NewCoins()).To(Equal(expVested))
} else {
Expect(vestedX).To(Equal(expVested))
}
unvestedX := mva.GetVestingCoins(now)
if unvestedX == nil {
Expect(expUnvested).To(Equal(sdk.NewCoins()))
Expect(sdk.NewCoins()).To(Equal(expUnvested))
} else {
Expect(unvestedX).To(Equal(expUnvested))
}

if mva.DelegatedFree == nil {
Expect(expDelegatedFree).To(Equal(sdk.NewCoins()))
Expect(sdk.NewCoins()).To(Equal(expDelegatedFree))
} else {
Expect(mva.DelegatedFree).To(Equal(expDelegatedFree))
}
if mva.DelegatedVesting == nil {
Expect(expDelegatedVesting).To(Equal(sdk.NewCoins()))
Expect(sdk.NewCoins()).To(Equal(expDelegatedVesting))
} else {
Expect(mva.DelegatedVesting).To(Equal(expDelegatedVesting))
}
Expand All @@ -294,26 +294,26 @@ func validateVestingAccountBalancesWithValues(
now := ctx.BlockTime()

if mva.DelegatedVesting == nil {
Expect(expDelegatedVesting).To(Equal(sdk.NewCoins()))
Expect(sdk.NewCoins()).To(Equal(expDelegatedVesting))
} else {
Expect(mva.DelegatedVesting).To(Equal(expDelegatedVesting))
}
if mva.DelegatedFree == nil {
Expect(expDelegatedFree).To(Equal(sdk.NewCoins()))
Expect(sdk.NewCoins()).To(Equal(expDelegatedFree))
} else {
Expect(mva.DelegatedFree).To(Equal(expDelegatedFree))
}
locked := app.BankKeeper.LockedCoins(ctx, mva.GetAddress())
Expect(locked).To(Equal(expLocked))
vested := mva.GetVestedCoins(now)
if vested == nil {
Expect(expVested).To(Equal(sdk.NewCoins()))
Expect(sdk.NewCoins()).To(Equal(expVested))
} else {
Expect(vested).To(Equal(expVested))
}
unvested := mva.GetVestingCoins(now)
if unvested == nil {
Expect(expUnvested).To(Equal(sdk.NewCoins()))
Expect(sdk.NewCoins()).To(Equal(expUnvested))
} else {
Expect(unvested).To(Equal(expUnvested))
}
Expand Down Expand Up @@ -1527,7 +1527,6 @@ var _ = Describe("Additional tests for Monthly Vesting Account", Ordered, func()
It("receive coins", func() {
mva, _ := s.querier.GetMonthlyVestingAccount(s.ctx, va)

// Fund 300 coins to funder to create monthly vesting
coins := sdk.NewCoins(sdk.NewCoin(utils.BaseDenom, math.NewIntWithDecimal(300, 18)))
err = testutil.FundAccount(s.ctx, s.app.BankKeeper, mva.GetAddress(), coins)
Expect(err).To(BeNil())
Expand Down Expand Up @@ -1751,7 +1750,6 @@ var _ = Describe("Additional tests for Monthly Vesting Account", Ordered, func()
It("receive coins", func() {
mva, _ := s.querier.GetMonthlyVestingAccount(s.ctx, va)

// Fund 300 coins to funder to create monthly vesting
coins := sdk.NewCoins(sdk.NewCoin(utils.BaseDenom, math.NewIntWithDecimal(300, 18)))
err = testutil.FundAccount(s.ctx, s.app.BankKeeper, mva.GetAddress(), coins)
Expect(err).To(BeNil())
Expand Down

0 comments on commit c3ca4ab

Please sign in to comment.