Skip to content

Commit

Permalink
refactor(core-forger): join duplicated logs (#4372)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastijankuzner committed Apr 11, 2021
1 parent bed6bef commit 9a3d9ee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
2 changes: 1 addition & 1 deletion __tests__/unit/core-transaction-pool/service.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Container, Contracts, Enums } from "@arkecosystem/core-kernel";
import { Identities, Managers, Transactions } from "@arkecosystem/crypto";

import { Service } from "../../../packages/core-transaction-pool/src/service";
import { Service } from "@packages/core-transaction-pool/src/service";

const configuration = {
getRequired: jest.fn(),
Expand Down
5 changes: 5 additions & 0 deletions packages/core-kernel/src/enums/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ export enum DelegateEvent {
Resigned = "delegate.resigned",
}

export enum VoteEvent {
Vote = "wallet.vote",
Unvote = "wallet.unvote",
}

/**
* @export
* @enum {number}
Expand Down
26 changes: 5 additions & 21 deletions packages/core-transaction-pool/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,35 +171,19 @@ export class Service implements Contracts.TransactionPool.Service {
}
}

if (previouslyForgedSuccesses === 1) {
this.logger.info(`${previouslyForgedSuccesses} previously forged transaction re-added`);
}
if (previouslyForgedSuccesses > 1) {
if (previouslyForgedSuccesses >= 1) {
this.logger.info(`${previouslyForgedSuccesses} previously forged transactions re-added`);
}
if (previouslyForgedFailures === 1) {
this.logger.warning(`${previouslyForgedFailures} previously forged transaction failed re-adding`);
}
if (previouslyForgedFailures > 1) {
if (previouslyForgedFailures >= 1) {
this.logger.warning(`${previouslyForgedFailures} previously forged transactions failed re-adding`);
}

if (previouslyStoredSuccesses === 1) {
this.logger.info(`${previouslyStoredSuccesses} previously stored transaction re-added`);
}
if (previouslyStoredSuccesses > 1) {
if (previouslyStoredSuccesses >= 1) {
this.logger.info(`${previouslyStoredSuccesses} previously stored transactions re-added`);
}
if (previouslyStoredExpirations === 1) {
this.logger.info(`${previouslyStoredExpirations} previously stored transaction expired`);
}
if (previouslyStoredExpirations > 1) {
if (previouslyStoredExpirations >= 1) {
this.logger.info(`${previouslyStoredExpirations} previously stored transactions expired`);
}
if (previouslyStoredFailures === 1) {
this.logger.warning(`${previouslyStoredFailures} previously stored transaction failed re-adding`);
}
if (previouslyStoredFailures > 1) {
if (previouslyStoredFailures >= 1) {
this.logger.warning(`${previouslyStoredFailures} previously stored transactions failed re-adding`);
}
});
Expand Down

0 comments on commit 9a3d9ee

Please sign in to comment.