Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter-squid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
duniter-squid
Commits
0dc3fe4b
Commit
0dc3fe4b
authored
1 year ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
enh: replace loose equality with strict equality in TypeScript
parent
1cd1d0d9
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/data_handler.ts
+1
-1
1 addition, 1 deletion
src/data_handler.ts
src/giant-squid.ts
+2
-2
2 additions, 2 deletions
src/giant-squid.ts
src/main.ts
+1
-1
1 addition, 1 deletion
src/main.ts
with
4 additions
and
4 deletions
src/data_handler.ts
+
1
−
1
View file @
0dc3fe4b
...
@@ -477,7 +477,7 @@ export class DataHandler {
...
@@ -477,7 +477,7 @@ export class DataHandler {
this
.
data
.
identities
.
delete
(
i
.
index
);
// prevent from trying to add twice
this
.
data
.
identities
.
delete
(
i
.
index
);
// prevent from trying to add twice
identities
.
push
(
idty
);
identities
.
push
(
idty
);
}
}
if
(
identities
.
length
==
0
)
{
if
(
identities
.
length
==
=
0
)
{
return
;
return
;
}
}
// we are sure that all created identities actually do not already exist in database
// we are sure that all created identities actually do not already exist in database
...
...
This diff is collapsed.
Click to expand it.
src/giant-squid.ts
+
2
−
2
View file @
0dc3fe4b
...
@@ -48,7 +48,7 @@ export async function saveBlock(ctx: ProcessorContext<StoreWithCache>, block: Bl
...
@@ -48,7 +48,7 @@ export async function saveBlock(ctx: ProcessorContext<StoreWithCache>, block: Bl
});
});
// We set the genesis timestamp based of first block timestamp
// We set the genesis timestamp based of first block timestamp
if
(
block
.
height
==
1
)
{
if
(
block
.
height
==
=
1
)
{
const
blockGenesis
=
await
ctx
.
store
.
findOneByOrFail
(
model
.
Block
,
{
height
:
0
});
const
blockGenesis
=
await
ctx
.
store
.
findOneByOrFail
(
model
.
Block
,
{
height
:
0
});
blockGenesis
.
timestamp
=
new
Date
(
block
.
timestamp
!
-
6000
);
blockGenesis
.
timestamp
=
new
Date
(
block
.
timestamp
!
-
6000
);
await
ctx
.
store
.
upsert
(
blockGenesis
);
await
ctx
.
store
.
upsert
(
blockGenesis
);
...
@@ -103,7 +103,7 @@ export async function saveCall(ctx: ProcessorContext<StoreWithCache>, call: Call
...
@@ -103,7 +103,7 @@ export async function saveCall(ctx: ProcessorContext<StoreWithCache>, call: Call
block
.
callsCount
+=
1
;
block
.
callsCount
+=
1
;
await
ctx
.
store
.
upsert
(
block
);
await
ctx
.
store
.
upsert
(
block
);
if
(
call
.
address
.
length
==
0
)
{
if
(
call
.
address
.
length
==
=
0
)
{
extrinsic
.
call
=
entity
;
extrinsic
.
call
=
entity
;
await
ctx
.
store
.
upsert
(
extrinsic
);
await
ctx
.
store
.
upsert
(
extrinsic
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main.ts
+
1
−
1
View file @
0dc3fe4b
...
@@ -19,7 +19,7 @@ processor.run(new TypeormDatabaseWithCache(), async (ctx) => {
...
@@ -19,7 +19,7 @@ processor.run(new TypeormDatabaseWithCache(), async (ctx) => {
// save the block header
// save the block header
const
genesisBlock
=
await
saveBlock
(
ctx
,
header
);
const
genesisBlock
=
await
saveBlock
(
ctx
,
header
);
// manage genesis state
// manage genesis state
if
(
header
.
height
==
0
)
{
if
(
header
.
height
==
=
0
)
{
await
saveGenesis
(
ctx
,
genesisBlock
);
await
saveGenesis
(
ctx
,
genesisBlock
);
}
}
// save all extrinsics of the block
// save all extrinsics of the block
...
...
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