@xyo-network/diviner-boundwitness-indexeddb 5.1.22 → 5.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +23 -20
- package/dist/browser/spec/Diviner.Error.spec.d.ts +0 -2
- package/dist/browser/spec/Diviner.Error.spec.d.ts.map +0 -1
- package/dist/browser/spec/Diviner.spec.d.ts +0 -2
- package/dist/browser/spec/Diviner.spec.d.ts.map +0 -1
- package/src/spec/Diviner.Error.spec.ts +0 -118
- package/src/spec/Diviner.spec.ts +0 -213
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/diviner-boundwitness-indexeddb",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.23",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -30,34 +30,37 @@
|
|
|
30
30
|
"types": "dist/browser/index.d.ts",
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
33
|
-
"src"
|
|
33
|
+
"src",
|
|
34
|
+
"!**/*.bench.*",
|
|
35
|
+
"!**/*.spec.*",
|
|
36
|
+
"!**/*.test.*"
|
|
34
37
|
],
|
|
35
38
|
"dependencies": {
|
|
36
|
-
"@xylabs/array": "~5.0.
|
|
37
|
-
"@xylabs/assert": "~5.0.
|
|
38
|
-
"@xylabs/exists": "~5.0.
|
|
39
|
-
"@xyo-network/archivist-indexeddb": "~5.1.
|
|
40
|
-
"@xyo-network/archivist-model": "~5.1.
|
|
41
|
-
"@xyo-network/boundwitness-model": "~5.1.
|
|
42
|
-
"@xyo-network/diviner-boundwitness-abstract": "~5.1.
|
|
43
|
-
"@xyo-network/diviner-boundwitness-model": "~5.1.
|
|
44
|
-
"@xyo-network/diviner-model": "~5.1.
|
|
45
|
-
"@xyo-network/module-model": "~5.1.
|
|
46
|
-
"@xyo-network/payload-model": "~5.1.
|
|
39
|
+
"@xylabs/array": "~5.0.33",
|
|
40
|
+
"@xylabs/assert": "~5.0.33",
|
|
41
|
+
"@xylabs/exists": "~5.0.33",
|
|
42
|
+
"@xyo-network/archivist-indexeddb": "~5.1.23",
|
|
43
|
+
"@xyo-network/archivist-model": "~5.1.23",
|
|
44
|
+
"@xyo-network/boundwitness-model": "~5.1.23",
|
|
45
|
+
"@xyo-network/diviner-boundwitness-abstract": "~5.1.23",
|
|
46
|
+
"@xyo-network/diviner-boundwitness-model": "~5.1.23",
|
|
47
|
+
"@xyo-network/diviner-model": "~5.1.23",
|
|
48
|
+
"@xyo-network/module-model": "~5.1.23",
|
|
49
|
+
"@xyo-network/payload-model": "~5.1.23",
|
|
47
50
|
"idb": "~8.0.3"
|
|
48
51
|
},
|
|
49
52
|
"devDependencies": {
|
|
50
|
-
"@xylabs/delay": "~5.0.
|
|
53
|
+
"@xylabs/delay": "~5.0.33",
|
|
51
54
|
"@xylabs/ts-scripts-yarn3": "~7.2.8",
|
|
52
55
|
"@xylabs/tsconfig": "~7.2.8",
|
|
53
|
-
"@xylabs/vitest-extended": "~5.0.
|
|
54
|
-
"@xyo-network/archivist-indexeddb": "~5.1.
|
|
55
|
-
"@xyo-network/boundwitness-builder": "~5.1.
|
|
56
|
-
"@xyo-network/node-memory": "~5.1.
|
|
57
|
-
"@xyo-network/payload-builder": "~5.1.
|
|
56
|
+
"@xylabs/vitest-extended": "~5.0.33",
|
|
57
|
+
"@xyo-network/archivist-indexeddb": "~5.1.23",
|
|
58
|
+
"@xyo-network/boundwitness-builder": "~5.1.23",
|
|
59
|
+
"@xyo-network/node-memory": "~5.1.23",
|
|
60
|
+
"@xyo-network/payload-builder": "~5.1.23",
|
|
58
61
|
"fake-indexeddb": "~6.2.5",
|
|
59
62
|
"typescript": "~5.9.3",
|
|
60
|
-
"vitest": "~4.0.
|
|
63
|
+
"vitest": "~4.0.9"
|
|
61
64
|
},
|
|
62
65
|
"publishConfig": {
|
|
63
66
|
"access": "public"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Diviner.Error.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Diviner.Error.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Diviner.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Diviner.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { IndexedDbArchivist } from '@xyo-network/archivist-indexeddb'
|
|
2
|
-
import { BoundWitnessBuilder } from '@xyo-network/boundwitness-builder'
|
|
3
|
-
import type { BoundWitness } from '@xyo-network/boundwitness-model'
|
|
4
|
-
import { BoundWitnessDivinerQuerySchema } from '@xyo-network/diviner-boundwitness-model'
|
|
5
|
-
import { MemoryNode } from '@xyo-network/node-memory'
|
|
6
|
-
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
7
|
-
import {
|
|
8
|
-
IDBCursor,
|
|
9
|
-
IDBCursorWithValue,
|
|
10
|
-
IDBDatabase,
|
|
11
|
-
IDBFactory,
|
|
12
|
-
IDBIndex,
|
|
13
|
-
IDBKeyRange,
|
|
14
|
-
IDBObjectStore,
|
|
15
|
-
IDBOpenDBRequest,
|
|
16
|
-
IDBRequest,
|
|
17
|
-
IDBTransaction,
|
|
18
|
-
IDBVersionChangeEvent,
|
|
19
|
-
indexedDB,
|
|
20
|
-
} from 'fake-indexeddb'
|
|
21
|
-
import {
|
|
22
|
-
beforeAll, describe, expect, it,
|
|
23
|
-
} from 'vitest'
|
|
24
|
-
|
|
25
|
-
import { IndexedDbBoundWitnessDiviner } from '../Diviner.ts'
|
|
26
|
-
|
|
27
|
-
// Augment window with prototypes to ensure instance of comparisons work
|
|
28
|
-
globalThis.IDBCursor = IDBCursor
|
|
29
|
-
globalThis.IDBCursorWithValue = IDBCursorWithValue
|
|
30
|
-
globalThis.IDBDatabase = IDBDatabase
|
|
31
|
-
globalThis.IDBFactory = IDBFactory
|
|
32
|
-
globalThis.IDBIndex = IDBIndex
|
|
33
|
-
globalThis.IDBKeyRange = IDBKeyRange
|
|
34
|
-
globalThis.IDBObjectStore = IDBObjectStore
|
|
35
|
-
globalThis.IDBOpenDBRequest = IDBOpenDBRequest
|
|
36
|
-
globalThis.IDBRequest = IDBRequest
|
|
37
|
-
globalThis.IDBTransaction = IDBTransaction
|
|
38
|
-
globalThis.IDBVersionChangeEvent = IDBVersionChangeEvent
|
|
39
|
-
globalThis.indexedDB = indexedDB
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @group module
|
|
43
|
-
* @group diviner
|
|
44
|
-
*/
|
|
45
|
-
describe('IndexedDbBoundWitnessDiviner.Errors', () => {
|
|
46
|
-
const dbName = 'testDb'
|
|
47
|
-
const storeName = 'testStore'
|
|
48
|
-
const values: BoundWitness[] = []
|
|
49
|
-
let archivist: IndexedDbArchivist
|
|
50
|
-
describe('divine', () => {
|
|
51
|
-
const createTestNode = async (testDbName = 'INCORRECT-DB-NAME', testStoreName = 'INCORRECT-STORE-NAME') => {
|
|
52
|
-
const sut = await IndexedDbBoundWitnessDiviner.create({
|
|
53
|
-
account: 'random',
|
|
54
|
-
config: {
|
|
55
|
-
archivist: archivist.address,
|
|
56
|
-
dbName: testDbName,
|
|
57
|
-
schema: IndexedDbBoundWitnessDiviner.defaultConfigSchema,
|
|
58
|
-
storeName: testStoreName,
|
|
59
|
-
},
|
|
60
|
-
})
|
|
61
|
-
const node = await MemoryNode.create({
|
|
62
|
-
account: 'random',
|
|
63
|
-
config: { schema: MemoryNode.defaultConfigSchema },
|
|
64
|
-
})
|
|
65
|
-
const modules = [archivist, sut]
|
|
66
|
-
await node.start()
|
|
67
|
-
await Promise.all(
|
|
68
|
-
modules.map(async (mod) => {
|
|
69
|
-
await node.register(mod)
|
|
70
|
-
await node.attach(mod.address, true)
|
|
71
|
-
}),
|
|
72
|
-
)
|
|
73
|
-
return sut
|
|
74
|
-
}
|
|
75
|
-
beforeAll(async () => {
|
|
76
|
-
archivist = await IndexedDbArchivist.create({
|
|
77
|
-
account: 'random',
|
|
78
|
-
config: {
|
|
79
|
-
dbName, schema: IndexedDbArchivist.defaultConfigSchema, storeName,
|
|
80
|
-
},
|
|
81
|
-
})
|
|
82
|
-
const [bw] = await new BoundWitnessBuilder().build()
|
|
83
|
-
values.push(bw)
|
|
84
|
-
await archivist.insert(values)
|
|
85
|
-
})
|
|
86
|
-
describe('when DB and store do not exist', () => {
|
|
87
|
-
let sut: IndexedDbBoundWitnessDiviner
|
|
88
|
-
beforeAll(async () => {
|
|
89
|
-
sut = await createTestNode('INCORRECT-DB-NAME', 'INCORRECT-STORE-NAME')
|
|
90
|
-
})
|
|
91
|
-
it('returns empty array', async () => {
|
|
92
|
-
const result = await sut.divine([{ schema: BoundWitnessDivinerQuerySchema }])
|
|
93
|
-
expect(result).toEqual([])
|
|
94
|
-
})
|
|
95
|
-
})
|
|
96
|
-
describe('when DB exists but store does not exist', () => {
|
|
97
|
-
let sut: IndexedDbBoundWitnessDiviner
|
|
98
|
-
beforeAll(async () => {
|
|
99
|
-
sut = await createTestNode(dbName, 'INCORRECT-STORE-NAME')
|
|
100
|
-
})
|
|
101
|
-
it('returns empty array', async () => {
|
|
102
|
-
const result = await sut.divine([{ schema: BoundWitnessDivinerQuerySchema }])
|
|
103
|
-
expect(result).toEqual([])
|
|
104
|
-
})
|
|
105
|
-
})
|
|
106
|
-
describe('when DB and store exist', () => {
|
|
107
|
-
let sut: IndexedDbBoundWitnessDiviner
|
|
108
|
-
beforeAll(async () => {
|
|
109
|
-
sut = await createTestNode(dbName, storeName)
|
|
110
|
-
})
|
|
111
|
-
it('returns values', async () => {
|
|
112
|
-
const result = await sut.divine([{ schema: BoundWitnessDivinerQuerySchema }])
|
|
113
|
-
const filtered = PayloadBuilder.omitStorageMeta(result)
|
|
114
|
-
expect(filtered).toEqual(values)
|
|
115
|
-
})
|
|
116
|
-
})
|
|
117
|
-
})
|
|
118
|
-
})
|
package/src/spec/Diviner.spec.ts
DELETED
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import '@xylabs/vitest-extended'
|
|
2
|
-
|
|
3
|
-
import { filterAs } from '@xylabs/array'
|
|
4
|
-
import { delay } from '@xylabs/delay'
|
|
5
|
-
import { IndexedDbArchivist } from '@xyo-network/archivist-indexeddb'
|
|
6
|
-
import { BoundWitnessBuilder } from '@xyo-network/boundwitness-builder'
|
|
7
|
-
import type { BoundWitness } from '@xyo-network/boundwitness-model'
|
|
8
|
-
import { asOptionalBoundWitnessWithStorageMeta, isBoundWitness } from '@xyo-network/boundwitness-model'
|
|
9
|
-
import type { BoundWitnessDivinerQueryPayload } from '@xyo-network/diviner-boundwitness-model'
|
|
10
|
-
import { BoundWitnessDivinerQuerySchema } from '@xyo-network/diviner-boundwitness-model'
|
|
11
|
-
import { MemoryNode } from '@xyo-network/node-memory'
|
|
12
|
-
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
13
|
-
import type { WithStorageMeta } from '@xyo-network/payload-model'
|
|
14
|
-
import {
|
|
15
|
-
IDBCursor,
|
|
16
|
-
IDBCursorWithValue,
|
|
17
|
-
IDBDatabase,
|
|
18
|
-
IDBFactory,
|
|
19
|
-
IDBIndex,
|
|
20
|
-
IDBKeyRange,
|
|
21
|
-
IDBObjectStore,
|
|
22
|
-
IDBOpenDBRequest,
|
|
23
|
-
IDBRequest,
|
|
24
|
-
IDBTransaction,
|
|
25
|
-
IDBVersionChangeEvent,
|
|
26
|
-
indexedDB,
|
|
27
|
-
} from 'fake-indexeddb'
|
|
28
|
-
import {
|
|
29
|
-
beforeAll, describe, expect,
|
|
30
|
-
it,
|
|
31
|
-
} from 'vitest'
|
|
32
|
-
|
|
33
|
-
import { IndexedDbBoundWitnessDiviner } from '../Diviner.ts'
|
|
34
|
-
|
|
35
|
-
// Augment window with prototypes to ensure instance of comparisons work
|
|
36
|
-
globalThis.IDBCursor = IDBCursor
|
|
37
|
-
globalThis.IDBCursorWithValue = IDBCursorWithValue
|
|
38
|
-
globalThis.IDBDatabase = IDBDatabase
|
|
39
|
-
globalThis.IDBFactory = IDBFactory
|
|
40
|
-
globalThis.IDBIndex = IDBIndex
|
|
41
|
-
globalThis.IDBKeyRange = IDBKeyRange
|
|
42
|
-
globalThis.IDBObjectStore = IDBObjectStore
|
|
43
|
-
globalThis.IDBOpenDBRequest = IDBOpenDBRequest
|
|
44
|
-
globalThis.IDBRequest = IDBRequest
|
|
45
|
-
globalThis.IDBTransaction = IDBTransaction
|
|
46
|
-
globalThis.IDBVersionChangeEvent = IDBVersionChangeEvent
|
|
47
|
-
globalThis.indexedDB = indexedDB
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* @group module
|
|
51
|
-
* @group diviner
|
|
52
|
-
*/
|
|
53
|
-
describe('IndexedDbBoundWitnessDiviner', () => {
|
|
54
|
-
const dbName = 'testDb'
|
|
55
|
-
const storeName = 'testStore'
|
|
56
|
-
let archivist: IndexedDbArchivist
|
|
57
|
-
let sut: IndexedDbBoundWitnessDiviner
|
|
58
|
-
let node: MemoryNode
|
|
59
|
-
const payloadA = {
|
|
60
|
-
schema: 'network.xyo.test',
|
|
61
|
-
url: 'https://xyo.network',
|
|
62
|
-
}
|
|
63
|
-
const payloadB = {
|
|
64
|
-
foo: ['bar', 'baz'],
|
|
65
|
-
schema: 'network.xyo.debug',
|
|
66
|
-
}
|
|
67
|
-
const boundWitnesses: WithStorageMeta<BoundWitness>[] = []
|
|
68
|
-
beforeAll(async () => {
|
|
69
|
-
const [boundWitnessA] = await (new BoundWitnessBuilder().payloads([payloadA])).build()
|
|
70
|
-
const [boundWitnessB] = await (new BoundWitnessBuilder().payloads([payloadB])).build()
|
|
71
|
-
const [boundWitnessC] = await (new BoundWitnessBuilder().payloads([payloadA, payloadB])).build()
|
|
72
|
-
archivist = await IndexedDbArchivist.create({
|
|
73
|
-
account: 'random',
|
|
74
|
-
config: {
|
|
75
|
-
dbName, schema: IndexedDbArchivist.defaultConfigSchema, storeName,
|
|
76
|
-
},
|
|
77
|
-
})
|
|
78
|
-
for (const [bw, payloads] of [
|
|
79
|
-
[boundWitnessA, [payloadA]],
|
|
80
|
-
[boundWitnessB, [payloadB]],
|
|
81
|
-
[boundWitnessC, [payloadA, payloadB]],
|
|
82
|
-
] as const) {
|
|
83
|
-
await delay(2)
|
|
84
|
-
const inserted = await archivist.insert([bw, ...payloads])
|
|
85
|
-
const bwWithStorageMeta = filterAs(inserted, asOptionalBoundWitnessWithStorageMeta)
|
|
86
|
-
boundWitnesses.push(...bwWithStorageMeta)
|
|
87
|
-
}
|
|
88
|
-
sut = await IndexedDbBoundWitnessDiviner.create({
|
|
89
|
-
account: 'random',
|
|
90
|
-
config: {
|
|
91
|
-
archivist: archivist.address,
|
|
92
|
-
dbName,
|
|
93
|
-
schema: IndexedDbBoundWitnessDiviner.defaultConfigSchema,
|
|
94
|
-
storeName,
|
|
95
|
-
},
|
|
96
|
-
})
|
|
97
|
-
node = await MemoryNode.create({
|
|
98
|
-
account: 'random',
|
|
99
|
-
config: { schema: MemoryNode.defaultConfigSchema },
|
|
100
|
-
})
|
|
101
|
-
const modules = [archivist, sut]
|
|
102
|
-
await node.start()
|
|
103
|
-
await Promise.all(
|
|
104
|
-
modules.map(async (mod) => {
|
|
105
|
-
await node.register(mod)
|
|
106
|
-
await node.attach(mod.address, true)
|
|
107
|
-
}),
|
|
108
|
-
)
|
|
109
|
-
})
|
|
110
|
-
describe('with filter for', () => {
|
|
111
|
-
describe('payload_schemas', () => {
|
|
112
|
-
describe('single', () => {
|
|
113
|
-
it.each(['network.xyo.test', 'network.xyo.debug'])(
|
|
114
|
-
'returns only bound witnesses with payload_schemas that contain the schema',
|
|
115
|
-
async (schema) => {
|
|
116
|
-
const payload_schemas = [schema]
|
|
117
|
-
const query = new PayloadBuilder<BoundWitnessDivinerQueryPayload>({ schema: BoundWitnessDivinerQuerySchema })
|
|
118
|
-
.fields({ payload_schemas })
|
|
119
|
-
.build()
|
|
120
|
-
const results = await sut.divine([query])
|
|
121
|
-
expect(results.length).toBeGreaterThan(0)
|
|
122
|
-
const bws = results.filter(isBoundWitness)
|
|
123
|
-
expect(bws.length).toBeGreaterThan(0)
|
|
124
|
-
for (const bw of bws) {
|
|
125
|
-
expect(bw.payload_schemas).toIncludeAllMembers(payload_schemas)
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
)
|
|
129
|
-
})
|
|
130
|
-
describe('multiple', () => {
|
|
131
|
-
it.each([
|
|
132
|
-
['network.xyo.test', 'network.xyo.debug'],
|
|
133
|
-
['network.xyo.test', 'network.xyo.debug'],
|
|
134
|
-
])('returns only bound witnesses with payload_schemas that contain the all the schemas', async (...payload_schemas) => {
|
|
135
|
-
const query = new PayloadBuilder<BoundWitnessDivinerQueryPayload>({ schema: BoundWitnessDivinerQuerySchema })
|
|
136
|
-
.fields({ payload_schemas })
|
|
137
|
-
.build()
|
|
138
|
-
const results = await sut.divine([query])
|
|
139
|
-
expect(results.length).toBeGreaterThan(0)
|
|
140
|
-
const bws = results.filter(isBoundWitness)
|
|
141
|
-
expect(bws.length).toBeGreaterThan(0)
|
|
142
|
-
for (const bw of bws) {
|
|
143
|
-
expect(bw.payload_schemas).toIncludeAllMembers(payload_schemas)
|
|
144
|
-
}
|
|
145
|
-
})
|
|
146
|
-
})
|
|
147
|
-
})
|
|
148
|
-
})
|
|
149
|
-
describe('with order', () => {
|
|
150
|
-
describe('not set', () => {
|
|
151
|
-
it('returns payloads in ascending order', async () => {
|
|
152
|
-
const query = new PayloadBuilder<BoundWitnessDivinerQueryPayload>({ schema: BoundWitnessDivinerQuerySchema }).build()
|
|
153
|
-
const results = await sut.divine([query])
|
|
154
|
-
expect(results).toEqual(boundWitnesses)
|
|
155
|
-
})
|
|
156
|
-
})
|
|
157
|
-
describe('asc', () => {
|
|
158
|
-
it('returns payloads in ascending order', async () => {
|
|
159
|
-
const query = new PayloadBuilder<BoundWitnessDivinerQueryPayload>({ schema: BoundWitnessDivinerQuerySchema })
|
|
160
|
-
.fields({ order: 'asc' })
|
|
161
|
-
.build()
|
|
162
|
-
const results = await sut.divine([query])
|
|
163
|
-
expect(results).toEqual(boundWitnesses)
|
|
164
|
-
})
|
|
165
|
-
})
|
|
166
|
-
describe('desc', () => {
|
|
167
|
-
it('returns payloads in descending order', async () => {
|
|
168
|
-
const query = new PayloadBuilder<BoundWitnessDivinerQueryPayload>({ schema: BoundWitnessDivinerQuerySchema })
|
|
169
|
-
.fields({ order: 'desc' })
|
|
170
|
-
.build()
|
|
171
|
-
const results = await sut.divine([query])
|
|
172
|
-
expect(results).toEqual([...boundWitnesses].toReversed())
|
|
173
|
-
})
|
|
174
|
-
})
|
|
175
|
-
})
|
|
176
|
-
describe('with cursor', () => {
|
|
177
|
-
describe('when ascending order', () => {
|
|
178
|
-
it('returns payloads from the beginning', async () => {
|
|
179
|
-
const iterator = boundWitnesses.entries()
|
|
180
|
-
iterator.next()
|
|
181
|
-
for (const [i, boundWitness] of iterator) {
|
|
182
|
-
const query = new PayloadBuilder<BoundWitnessDivinerQueryPayload>({ schema: BoundWitnessDivinerQuerySchema })
|
|
183
|
-
.fields({
|
|
184
|
-
limit: 1, cursor: boundWitnesses[i - 1]._sequence, order: 'asc',
|
|
185
|
-
})
|
|
186
|
-
.build()
|
|
187
|
-
const results = await sut.divine([query])
|
|
188
|
-
expect(results).toBeArrayOfSize(1)
|
|
189
|
-
const [result] = results
|
|
190
|
-
expect(PayloadBuilder.omitMeta(result)).toEqual(PayloadBuilder.omitMeta(boundWitness))
|
|
191
|
-
}
|
|
192
|
-
})
|
|
193
|
-
})
|
|
194
|
-
describe('when descending order', () => {
|
|
195
|
-
it('returns payloads from the end', async () => {
|
|
196
|
-
const descendingBoundWitnesses = [...boundWitnesses].toReversed()
|
|
197
|
-
const iterator = [...descendingBoundWitnesses.entries()][Symbol.iterator]()
|
|
198
|
-
iterator.next()
|
|
199
|
-
for (const [i, boundWitness] of iterator) {
|
|
200
|
-
const query = new PayloadBuilder<BoundWitnessDivinerQueryPayload>({ schema: BoundWitnessDivinerQuerySchema })
|
|
201
|
-
.fields({
|
|
202
|
-
limit: 1, cursor: descendingBoundWitnesses[i - 1]._sequence, order: 'desc',
|
|
203
|
-
})
|
|
204
|
-
.build()
|
|
205
|
-
const results = await sut.divine([query])
|
|
206
|
-
expect(results).toBeArrayOfSize(1)
|
|
207
|
-
const [result] = results
|
|
208
|
-
expect(PayloadBuilder.omitMeta(result)).toEqual(PayloadBuilder.omitMeta(boundWitness))
|
|
209
|
-
}
|
|
210
|
-
})
|
|
211
|
-
})
|
|
212
|
-
})
|
|
213
|
-
})
|