Skip to content

Commit cd78ec3

Browse files
committed
fix: lintfixed and removed console logs
1 parent a216541 commit cd78ec3

File tree

2 files changed

+14
-22
lines changed

2 files changed

+14
-22
lines changed

src/nodes/NodeManager.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,10 +1259,9 @@ class NodeManager {
12591259
const client = connection.getClient();
12601260
let claimIdEncoded: ClaimIdEncoded | undefined;
12611261

1262-
if(claimId != null){
1263-
claimIdEncoded = claimsUtils.encodeClaimId(claimId);
1264-
}else
1265-
{
1262+
if (claimId != null) {
1263+
claimIdEncoded = claimsUtils.encodeClaimId(claimId);
1264+
} else {
12661265
claimIdEncoded = undefined;
12671266
}
12681267

@@ -1271,9 +1270,7 @@ class NodeManager {
12711270
seek: claimIdEncoded,
12721271
},
12731272
ctx,
1274-
12751273
)) {
1276-
console.log("Processing claim id:", agentClaim.claimIdEncoded);
12771274
ctx.signal.throwIfAborted();
12781275
// Need to re-construct each claim
12791276
const claimId: ClaimId = claimsUtils.decodeClaimId(

tests/nodes/agent/handlers/nodesClaimsGet.test.ts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { IdentityId, ProviderId } from '@/identities/types';
2+
import type { ClaimIdEncoded } from '@/ids';
23
import fs from 'fs';
34
import path from 'path';
45
import os from 'os';
@@ -16,7 +17,6 @@ import * as keysUtils from '@/keys/utils';
1617
import * as networkUtils from '@/network/utils';
1718
import * as tlsTestsUtils from '../../../utils/tls';
1819
import * as testNodesUtils from '../../../nodes/utils';
19-
import { ClaimIdEncoded } from '@/ids';
2020

2121
describe('nodesClaimsGet', () => {
2222
const logger = new Logger('nodesClaimsGet test', LogLevel.WARN, [
@@ -316,10 +316,9 @@ describe('nodesClaimsGet', () => {
316316
expect(claimIds).toHaveLength(0);
317317
});
318318

319-
320319
test('Should get chain data with valid seek parameter and all chain data if invalid seek', async () => {
321320
const srcNodeIdEncoded = nodesUtils.encodeNodeId(keyRing.getNodeId());
322-
321+
323322
// Add 10 claims
324323
for (let i = 1; i <= 5; i++) {
325324
const node2 = nodesUtils.encodeNodeId(
@@ -343,7 +342,7 @@ describe('nodesClaimsGet', () => {
343342
};
344343
await sigchain.addClaim(identityLink);
345344
}
346-
345+
347346
// First, if we provide an invalid seek value, we should get all claims.
348347
let response = await rpcClient.methods.nodesClaimsGet({ seek: undefined });
349348
const allClaimIds: ClaimIdEncoded[] = [];
@@ -352,26 +351,22 @@ describe('nodesClaimsGet', () => {
352351
allClaimIds.push(claim.claimIdEncoded!);
353352
}
354353
expect(allClaimIds).toHaveLength(10);
355-
354+
356355
// Now choose a seek claim.
357356
const seekClaimId = allClaimIds[3];
358-
357+
359358
// Now retrieve claims starting from the seek value.
360-
response = await rpcClient.methods.nodesClaimsGet({ order: 'asc', seek: seekClaimId });
359+
response = await rpcClient.methods.nodesClaimsGet({
360+
order: 'asc',
361+
seek: seekClaimId,
362+
});
361363
const subsetClaimIds: string[] = [];
362364
for await (const claim of response) {
363365
subsetClaimIds.push(claim.claimIdEncoded!);
364366
}
365-
367+
366368
// Our expectation is that the claim with the seek value is excluded
367369
// and that the remaining claims match the tail of allClaimIds.
368-
console.log("subsetClaimIds",subsetClaimIds);
369-
console.log("allClaimIds",allClaimIds);
370-
console.log("allClaimIds.slice(4)",allClaimIds.slice(3));
371-
console.log("seekClaimId", seekClaimId);
372370
expect(subsetClaimIds).toEqual(allClaimIds.slice(3));
373-
});
374-
375-
376-
371+
});
377372
});

0 commit comments

Comments
 (0)