Skip to content

Commit

Permalink
refactor(core-state): log milestone change (#3797)
Browse files Browse the repository at this point in the history
  • Loading branch information
rainydio authored Jun 13, 2020
1 parent 4b68d5f commit cecf892
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core-state/src/stores/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export class StateStore implements Contracts.State.StateStore {
@Container.tagged("plugin", "@arkecosystem/core-state")
private readonly configuration!: Providers.PluginConfiguration;

@Container.inject(Container.Identifiers.LogService)
private readonly logger!: Contracts.Kernel.Logger;

// @todo: make all properties private and expose them one-by-one through a getter if used outside of this class
public blockchain: any = {};
public genesisBlock: Interfaces.IBlock | undefined = undefined;
Expand Down Expand Up @@ -109,6 +112,7 @@ export class StateStore implements Contracts.State.StateStore {
Managers.configManager.setHeight(block.data.height);

if (Managers.configManager.isNewMilestone()) {
this.logger.notice("Milestone change");
this.app
.get<Contracts.Kernel.EventDispatcher>(Container.Identifiers.EventDispatcherService)
.dispatch(Enums.CryptoEvent.MilestoneChanged);
Expand Down

0 comments on commit cecf892

Please sign in to comment.