Skip to content
Snippets Groups Projects
Commit 0dc3fe4b authored by poka's avatar poka
Browse files

enh: replace loose equality with strict equality in TypeScript

parent 1cd1d0d9
No related branches found
No related tags found
No related merge requests found
...@@ -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
......
...@@ -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);
} }
......
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment