Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
typescript
duniter
Commits
c30fcd64
Commit
c30fcd64
authored
7 years ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
[enh] refactoring: logs on document receiving
parent
268aba57
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/lib/common-libs/parsers/GenericParser.ts
+4
-1
4 additions, 1 deletion
app/lib/common-libs/parsers/GenericParser.ts
server.ts
+7
-7
7 additions, 7 deletions
server.ts
with
11 additions
and
8 deletions
app/lib/common-libs/parsers/GenericParser.ts
+
4
−
1
View file @
c30fcd64
import
{
CommonConstants
}
from
"
../../../lib/common-libs/constants
"
import
{
CommonConstants
}
from
"
../../../lib/common-libs/constants
"
import
*
as
stream
from
"
stream
"
import
*
as
stream
from
"
stream
"
import
{
hashf
}
from
"
../../../lib/common
"
import
{
hashf
}
from
"
../../../lib/common
"
import
{
NewLogger
}
from
"
../../logger
"
const
logger
=
NewLogger
()
export
abstract
class
GenericParser
extends
stream
.
Transform
{
export
abstract
class
GenericParser
extends
stream
.
Transform
{
...
@@ -21,7 +24,7 @@ export abstract class GenericParser extends stream.Transform {
...
@@ -21,7 +24,7 @@ export abstract class GenericParser extends stream.Transform {
return
;
return
;
}
}
syncWrite
(
str
:
string
,
logger
:
any
=
null
):
any
{
syncWrite
(
str
:
string
):
any
{
let
error
=
""
let
error
=
""
const
obj
=
{};
const
obj
=
{};
this
.
_parse
(
str
,
obj
);
this
.
_parse
(
str
,
obj
);
...
...
This diff is collapsed.
Click to expand it.
server.ts
+
7
−
7
View file @
c30fcd64
...
@@ -211,7 +211,7 @@ export class Server extends stream.Duplex implements HookableServer {
...
@@ -211,7 +211,7 @@ export class Server extends stream.Duplex implements HookableServer {
}
}
async
writeRawBlock
(
raw
:
string
):
Promise
<
BlockDTO
>
{
async
writeRawBlock
(
raw
:
string
):
Promise
<
BlockDTO
>
{
const
obj
=
parsers
.
parseBlock
.
syncWrite
(
raw
,
logger
)
const
obj
=
parsers
.
parseBlock
.
syncWrite
(
raw
)
return
await
this
.
writeBlock
(
obj
)
return
await
this
.
writeBlock
(
obj
)
}
}
...
@@ -224,7 +224,7 @@ export class Server extends stream.Duplex implements HookableServer {
...
@@ -224,7 +224,7 @@ export class Server extends stream.Duplex implements HookableServer {
}
}
async
writeRawIdentity
(
raw
:
string
):
Promise
<
DBIdentity
>
{
async
writeRawIdentity
(
raw
:
string
):
Promise
<
DBIdentity
>
{
const
obj
=
parsers
.
parseIdentity
.
syncWrite
(
raw
,
logger
)
const
obj
=
parsers
.
parseIdentity
.
syncWrite
(
raw
)
return
await
this
.
writeIdentity
(
obj
)
return
await
this
.
writeIdentity
(
obj
)
}
}
...
@@ -237,7 +237,7 @@ export class Server extends stream.Duplex implements HookableServer {
...
@@ -237,7 +237,7 @@ export class Server extends stream.Duplex implements HookableServer {
}
}
async
writeRawCertification
(
raw
:
string
):
Promise
<
CertificationDTO
>
{
async
writeRawCertification
(
raw
:
string
):
Promise
<
CertificationDTO
>
{
const
obj
=
parsers
.
parseCertification
.
syncWrite
(
raw
,
logger
)
const
obj
=
parsers
.
parseCertification
.
syncWrite
(
raw
)
return
await
this
.
writeCertification
(
obj
)
return
await
this
.
writeCertification
(
obj
)
}
}
...
@@ -250,7 +250,7 @@ export class Server extends stream.Duplex implements HookableServer {
...
@@ -250,7 +250,7 @@ export class Server extends stream.Duplex implements HookableServer {
}
}
async
writeRawMembership
(
raw
:
string
):
Promise
<
MembershipDTO
>
{
async
writeRawMembership
(
raw
:
string
):
Promise
<
MembershipDTO
>
{
const
obj
=
parsers
.
parseMembership
.
syncWrite
(
raw
,
logger
)
const
obj
=
parsers
.
parseMembership
.
syncWrite
(
raw
)
return
await
this
.
writeMembership
(
obj
)
return
await
this
.
writeMembership
(
obj
)
}
}
...
@@ -263,7 +263,7 @@ export class Server extends stream.Duplex implements HookableServer {
...
@@ -263,7 +263,7 @@ export class Server extends stream.Duplex implements HookableServer {
}
}
async
writeRawRevocation
(
raw
:
string
):
Promise
<
RevocationDTO
>
{
async
writeRawRevocation
(
raw
:
string
):
Promise
<
RevocationDTO
>
{
const
obj
=
parsers
.
parseRevocation
.
syncWrite
(
raw
,
logger
)
const
obj
=
parsers
.
parseRevocation
.
syncWrite
(
raw
)
return
await
this
.
writeRevocation
(
obj
)
return
await
this
.
writeRevocation
(
obj
)
}
}
...
@@ -276,7 +276,7 @@ export class Server extends stream.Duplex implements HookableServer {
...
@@ -276,7 +276,7 @@ export class Server extends stream.Duplex implements HookableServer {
}
}
async
writeRawTransaction
(
raw
:
string
):
Promise
<
TransactionDTO
>
{
async
writeRawTransaction
(
raw
:
string
):
Promise
<
TransactionDTO
>
{
const
obj
=
parsers
.
parseTransaction
.
syncWrite
(
raw
,
logger
)
const
obj
=
parsers
.
parseTransaction
.
syncWrite
(
raw
)
return
await
this
.
writeTransaction
(
obj
)
return
await
this
.
writeTransaction
(
obj
)
}
}
...
@@ -289,7 +289,7 @@ export class Server extends stream.Duplex implements HookableServer {
...
@@ -289,7 +289,7 @@ export class Server extends stream.Duplex implements HookableServer {
}
}
async
writeRawPeer
(
raw
:
string
):
Promise
<
PeerDTO
>
{
async
writeRawPeer
(
raw
:
string
):
Promise
<
PeerDTO
>
{
const
obj
=
parsers
.
parsePeer
.
syncWrite
(
raw
,
logger
)
const
obj
=
parsers
.
parsePeer
.
syncWrite
(
raw
)
return
await
this
.
writePeer
(
obj
)
return
await
this
.
writePeer
(
obj
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment