@@ -5,7 +5,6 @@ import assert from 'assert-plus';
5
5
import { generateLocalId } from './helpers.js' ;
6
6
import { IndexAllocationCache } from './IndexAllocationCache.js' ;
7
7
import { ListSource } from './ListSource.js' ;
8
- import { v4 as uuid } from 'uuid' ;
9
8
10
9
/* Notes: The following notes explain the scaling design for assigning
11
10
status list (SL) indexes to VCs in a parallel fashion. This design
@@ -590,47 +589,6 @@ export class ListManager {
590
589
}
591
590
}
592
591
593
- async _getIndexAssignmentDoc ( {
594
- blockAssignmentDocId, blockIndex, slSequence
595
- } ) {
596
- // get `edvClient` directly; do not use cache in `documentStore` to ensure
597
- // latest docs are used
598
- const { documentStore : { edvClient} } = this ;
599
-
600
- // try to find existing index assignment doc
601
- const equals = {
602
- 'meta.blockAssignmentDocId' : blockAssignmentDocId ,
603
- 'meta.blockIndex' : blockIndex
604
- } ;
605
-
606
- // Note: This implementation is notably different from the
607
- // `_getListManagementDoc` because when duplicate or conflict errors arise,
608
- // we want to throw them, not ignore and read.
609
- const { documents} = await edvClient . find ( { equals, limit : 1 } ) ;
610
- if ( documents . length === 0 ) {
611
- const type = 'StatusListIndexAssignmentDocument' ;
612
- let indexAssignmentDoc = {
613
- id : await edvClient . generateId ( ) ,
614
- content : {
615
- id : `urn:uuid:${ uuid ( ) } ` ,
616
- type,
617
- slSequence,
618
- nextLocalIndex : 0
619
- } ,
620
- meta : {
621
- type,
622
- blockAssignmentDocId,
623
- blockIndex
624
- }
625
- } ;
626
- indexAssignmentDoc = await edvClient . update ( { doc : indexAssignmentDoc } ) ;
627
- return { indexAssignmentDoc} ;
628
- } else {
629
- const [ indexAssignmentDoc ] = documents ;
630
- return { indexAssignmentDoc} ;
631
- }
632
- }
633
-
634
592
async _init ( ) {
635
593
const { documentStore : { edvClient} } = this ;
636
594
edvClient . ensureIndex ( {
0 commit comments