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

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nagdahimanshu committed Oct 31, 2023
1 parent 79c696a commit 79386df
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@ describe('Test validatorComparator method', () => {
expect(result).toBeGreaterThan(0);
});

it('should return -1 when validator weight is same but first address is smaller', async () => {
it('should return 1 when validator weight is same but first address is smaller', async () => {
const { validatorComparator } = require(posValidatorsPath);
const result = validatorComparator(
{ validatorWeight: BigInt(1e20), hexAddress: '002e84247fd3876baca6698d98f0ace199af96ed' },
{ validatorWeight: BigInt(1e20), hexAddress: '0282ed03925a5c31271fa3b70bb94ce12fd83ea9' },
);
expect(result).toBe(-1);
expect(result).toBe(1);
});

it('should return 1 when validator weight is same but first address is greater', async () => {
it('should return -1 when validator weight is same but first address is greater', async () => {
const { validatorComparator } = require(posValidatorsPath);
const result = validatorComparator(
{ validatorWeight: BigInt(1e20), hexAddress: '0282ed03925a5c31271fa3b70bb94ce12fd83ea9' },
{ validatorWeight: BigInt(1e20), hexAddress: '002e84247fd3876baca6698d98f0ace199af96ed' },
);
expect(result).toBe(1);
expect(result).toBe(-1);
});

it('should return 0 when both validator weight and address are equal', async () => {
Expand Down

0 comments on commit 79386df

Please sign in to comment.