11import type { IdentityId , ProviderId } from '@/identities/types' ;
2+ import type { ClaimIdEncoded } from '@/ids' ;
23import fs from 'fs' ;
34import path from 'path' ;
45import os from 'os' ;
@@ -16,7 +17,6 @@ import * as keysUtils from '@/keys/utils';
1617import * as networkUtils from '@/network/utils' ;
1718import * as tlsTestsUtils from '../../../utils/tls' ;
1819import * as testNodesUtils from '../../../nodes/utils' ;
19- import { ClaimIdEncoded } from '@/ids' ;
2020
2121describe ( '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