Skip to content

Commit

Permalink
feat: upgrade legacy Synchronizer to SingleDaemon
Browse files Browse the repository at this point in the history
  • Loading branch information
Jblew committed Dec 6, 2018
1 parent ce2d889 commit 5cf9bea
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/actions/DaemonAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as path from "path";
import * as program from "commander";

import { ConfigLoader, ConfigLoadedFromFile } from "../config/Config";
import { Wise, DirectBlockchainApi, SteemOperationNumber, Synchronizer } from "steem-wise-core";
import { Wise, DirectBlockchainApi, SteemOperationNumber, SingleDaemon } from "steem-wise-core";
import { StaticConfig } from "../config/StaticConfig";


Expand Down Expand Up @@ -40,12 +40,12 @@ export class DaemonAction {
.then((since: SteemOperationNumber) => {
console.log("Synchronization starting at: " + since);

delegatorWise.startDaemon(since, (error: Error | undefined, event: Synchronizer.Event) => {
delegatorWise.startDaemon(since, (error: Error | undefined, event: SingleDaemon.Event) => {
if (error) {
console.error(error);
}

if (event.type === Synchronizer.EventType.EndBlockProcessing) {
if (event.type === SingleDaemon.EventType.EndBlockProcessing) {
try {
fs.writeFileSync(lastBlockFile, "" + event.blockNum, { flag: "w+" });
console.log("Processed block " + event.blockNum);
Expand All @@ -54,17 +54,17 @@ export class DaemonAction {
console.error(error);
}
}
else if (event.type === Synchronizer.EventType.StartBlockProcessing) {
else if (event.type === SingleDaemon.EventType.StartBlockProcessing) {

}
else if (event.type === Synchronizer.EventType.SynchronizationStop) {
else if (event.type === SingleDaemon.EventType.SynchronizationStop) {

}
else if (event.type === Synchronizer.EventType.VoteorderPassed) {
else if (event.type === SingleDaemon.EventType.VoteorderPassed) {
console.log("[Synchronization] (voter=" + event.voter + ") " + event.message);
console.log(JSON.stringify(event.voteorder, undefined, 2));
}
else if (event.type === Synchronizer.EventType.VoteorderRejected) {
else if (event.type === SingleDaemon.EventType.VoteorderRejected) {
console.log("[Synchronization] (voter=" + event.voter + ") " + event.message);
console.log(JSON.stringify(event.voteorder, undefined, 2));
}
Expand Down

0 comments on commit 5cf9bea

Please sign in to comment.