Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
test(chore): improve assert
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 committed Jan 18, 2024
1 parent b0de89a commit 112dcc6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cosmos/precompile/staking/staking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ var _ = Describe("Staking", func() {
It("all validator not active", func() {
vals, err := contract.GetBondedValidatorsByPower(ctx)
Expect(err).ToNot(HaveOccurred())
Expect(vals).To(HaveLen(0))
Expect(vals).To(BeEmpty())
})
It("one validator active", func() {
// Set the validator to be bonded.
Expand Down Expand Up @@ -654,7 +654,7 @@ var _ = Describe("Staking", func() {
}
vals, _, err := contract.GetValidators(ctx, pagination)
Expect(err).ToNot(HaveOccurred())
Expect(len(vals)).To(Equal(2))
Expect(vals).To(HaveLen(2))
})
})

Expand All @@ -674,12 +674,12 @@ var _ = Describe("Staking", func() {
It("should success", func() {
vals, _, err := contract.GetDelegatorValidators(ctx, caller, nil)
Expect(err).ToNot(HaveOccurred())
Expect(len(vals)).To(Equal(1))
Expect(vals).To(HaveLen(1))
})
It("should error when invalid delegator", func() {
vals, _, err := contract.GetDelegatorValidators(ctx, common.Address{}, nil)
Expect(err).ToNot(HaveOccurred())
Expect(len(vals)).To(Equal(0))
Expect(vals).To(BeEmpty())
})
})
})
Expand Down

0 comments on commit 112dcc6

Please sign in to comment.