From 79386df926c351093826398c7e7f47b5166124dd Mon Sep 17 00:00:00 2001 From: nagdahimanshu Date: Tue, 31 Oct 2023 14:53:58 +0100 Subject: [PATCH] Update unit tests --- .../tests/unit/shared/dataservice/pos/validators.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/blockchain-indexer/tests/unit/shared/dataservice/pos/validators.test.js b/services/blockchain-indexer/tests/unit/shared/dataservice/pos/validators.test.js index fba1aea41a..a0e5a224d0 100644 --- a/services/blockchain-indexer/tests/unit/shared/dataservice/pos/validators.test.js +++ b/services/blockchain-indexer/tests/unit/shared/dataservice/pos/validators.test.js @@ -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 () => {