Skip to content
Snippets Groups Projects
Commit c30fcd64 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[enh] refactoring: logs on document receiving

parent 268aba57
No related branches found
No related tags found
No related merge requests found
import {CommonConstants} from "../../../lib/common-libs/constants"
import * as stream from "stream"
import {hashf} from "../../../lib/common"
import {NewLogger} from "../../logger"
const logger = NewLogger()
export abstract class GenericParser extends stream.Transform {
......@@ -21,7 +24,7 @@ export abstract class GenericParser extends stream.Transform {
return;
}
syncWrite(str:string, logger:any = null): any {
syncWrite(str:string): any {
let error = ""
const obj = {};
this._parse(str, obj);
......
......@@ -211,7 +211,7 @@ export class Server extends stream.Duplex implements HookableServer {
}
async writeRawBlock(raw:string): Promise<BlockDTO> {
const obj = parsers.parseBlock.syncWrite(raw, logger)
const obj = parsers.parseBlock.syncWrite(raw)
return await this.writeBlock(obj)
}
......@@ -224,7 +224,7 @@ export class Server extends stream.Duplex implements HookableServer {
}
async writeRawIdentity(raw:string): Promise<DBIdentity> {
const obj = parsers.parseIdentity.syncWrite(raw, logger)
const obj = parsers.parseIdentity.syncWrite(raw)
return await this.writeIdentity(obj)
}
......@@ -237,7 +237,7 @@ export class Server extends stream.Duplex implements HookableServer {
}
async writeRawCertification(raw:string): Promise<CertificationDTO> {
const obj = parsers.parseCertification.syncWrite(raw, logger)
const obj = parsers.parseCertification.syncWrite(raw)
return await this.writeCertification(obj)
}
......@@ -250,7 +250,7 @@ export class Server extends stream.Duplex implements HookableServer {
}
async writeRawMembership(raw:string): Promise<MembershipDTO> {
const obj = parsers.parseMembership.syncWrite(raw, logger)
const obj = parsers.parseMembership.syncWrite(raw)
return await this.writeMembership(obj)
}
......@@ -263,7 +263,7 @@ export class Server extends stream.Duplex implements HookableServer {
}
async writeRawRevocation(raw:string): Promise<RevocationDTO> {
const obj = parsers.parseRevocation.syncWrite(raw, logger)
const obj = parsers.parseRevocation.syncWrite(raw)
return await this.writeRevocation(obj)
}
......@@ -276,7 +276,7 @@ export class Server extends stream.Duplex implements HookableServer {
}
async writeRawTransaction(raw:string): Promise<TransactionDTO> {
const obj = parsers.parseTransaction.syncWrite(raw, logger)
const obj = parsers.parseTransaction.syncWrite(raw)
return await this.writeTransaction(obj)
}
......@@ -289,7 +289,7 @@ export class Server extends stream.Duplex implements HookableServer {
}
async writeRawPeer(raw:string): Promise<PeerDTO> {
const obj = parsers.parsePeer.syncWrite(raw, logger)
const obj = parsers.parsePeer.syncWrite(raw)
return await this.writePeer(obj)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment