Skip to content

Commit

Permalink
fix: update log message
Browse files Browse the repository at this point in the history
  • Loading branch information
eddort committed Dec 24, 2023
1 parent 39a42a1 commit c60467e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/jobs/keys-update/keys-update.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class KeysUpdateService {
}

if (prevElMeta?.blockHash && prevElMeta.blockHash === currElMeta.hash) {
this.logger.log('Same blockHash, indexing is not required', { prevElMeta, currElMeta });
this.logger.log('Same blockHash, updating is not required', { prevElMeta, currElMeta });
return;
}

Expand Down
10 changes: 5 additions & 5 deletions src/jobs/keys-update/staking-module-updater.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class StakingModuleUpdaterService {
this.logger.log(`Nonce previous value: ${prevNonce}, nonce current value: ${currNonce}`);

if (!prevBlockHash) {
this.logger.log('No past state found, start indexing', { stakingModuleAddress, currentBlockHash });
this.logger.log('No past state found, start updating', { stakingModuleAddress, currentBlockHash });

await this.updateStakingModule(
updaterState,
Expand All @@ -56,7 +56,7 @@ export class StakingModuleUpdaterService {
}

if (prevNonce !== currNonce) {
this.logger.log('Nonce has been changed, start indexing', {
this.logger.log('Nonce has been changed, start updating', {
stakingModuleAddress,
currentBlockHash,
prevNonce,
Expand All @@ -75,7 +75,7 @@ export class StakingModuleUpdaterService {
}

if (this.isTooMuchDiffBetweenBlocks(prevElMeta.blockNumber, currElMeta.number)) {
this.logger.log('Too much difference between the blocks, start indexing', {
this.logger.log('Too much difference between the blocks, start updating', {
stakingModuleAddress,
currentBlockHash,
});
Expand All @@ -92,7 +92,7 @@ export class StakingModuleUpdaterService {
}

if (await this.isReorgDetected(updaterState, prevBlockHash, currentBlockHash)) {
this.logger.log('Reorg detected, start indexing', { stakingModuleAddress, currentBlockHash });
this.logger.log('Reorg detected, start updating', { stakingModuleAddress, currentBlockHash });

await this.updateStakingModule(
updaterState,
Expand Down Expand Up @@ -129,7 +129,7 @@ export class StakingModuleUpdaterService {
continue;
}

this.logger.log('No changes have been detected in the module, indexing is not required', {
this.logger.log('No changes have been detected in the module, updating is not required', {
stakingModuleAddress,
currentBlockHash,
});
Expand Down
8 changes: 4 additions & 4 deletions src/jobs/keys-update/test/update-cases.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('update cases', () => {
});

expect(mockUpdate).toBeCalledTimes(1);
expect(loggerService.log.mock.calls[1][0]).toBe('No past state found, start indexing');
expect(loggerService.log.mock.calls[1][0]).toBe('No past state found, start updating');
});

it('More than 1 module processed', async () => {
Expand Down Expand Up @@ -116,7 +116,7 @@ describe('update cases', () => {
});

expect(mockUpdate).toBeCalledTimes(2);
expect(loggerService.log.mock.calls[1][0]).toBe('Nonce has been changed, start indexing');
expect(loggerService.log.mock.calls[1][0]).toBe('Nonce has been changed, start updating');
});

it('Too much difference between the blocks', async () => {
Expand All @@ -136,7 +136,7 @@ describe('update cases', () => {
});

expect(mockUpdate).toBeCalledTimes(2);
expect(loggerService.log.mock.calls[1][0]).toBe('Too much difference between the blocks, start indexing');
expect(loggerService.log.mock.calls[1][0]).toBe('Too much difference between the blocks, start updating');
});

it('Reorg detected', async () => {
Expand All @@ -163,6 +163,6 @@ describe('update cases', () => {
});

expect(mockUpdate).toBeCalledTimes(2);
expect(loggerService.log.mock.calls[1][0]).toBe('Reorg detected, start indexing');
expect(loggerService.log.mock.calls[1][0]).toBe('Reorg detected, start updating');
});
});

0 comments on commit c60467e

Please sign in to comment.