@xyo-network/sentinel 2.44.1 → 2.45.0-rc.1
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/dist/docs.json +1747 -1843
- package/package.json +15 -14
- package/src/spec/Sentinel.spec.ts +10 -10
- package/src/spec/SentinelRunner.spec.ts +2 -2
package/package.json
CHANGED
|
@@ -11,24 +11,24 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@xylabs/assert": "^2.7.1",
|
|
14
|
-
"@xyo-network/account": "^2.
|
|
15
|
-
"@xyo-network/archivist": "^2.
|
|
16
|
-
"@xyo-network/archivist-wrapper": "^2.
|
|
17
|
-
"@xyo-network/boundwitness-model": "^2.
|
|
18
|
-
"@xyo-network/core": "^2.
|
|
19
|
-
"@xyo-network/module": "^2.
|
|
20
|
-
"@xyo-network/module-model": "^2.
|
|
21
|
-
"@xyo-network/payload-model": "^2.
|
|
22
|
-
"@xyo-network/payload-wrapper": "^2.
|
|
23
|
-
"@xyo-network/promise": "^2.
|
|
24
|
-
"@xyo-network/witness": "^2.
|
|
14
|
+
"@xyo-network/account": "^2.45.0-rc.1",
|
|
15
|
+
"@xyo-network/archivist": "^2.45.0-rc.1",
|
|
16
|
+
"@xyo-network/archivist-wrapper": "^2.45.0-rc.1",
|
|
17
|
+
"@xyo-network/boundwitness-model": "^2.45.0-rc.1",
|
|
18
|
+
"@xyo-network/core": "^2.45.0-rc.1",
|
|
19
|
+
"@xyo-network/module": "^2.45.0-rc.1",
|
|
20
|
+
"@xyo-network/module-model": "^2.45.0-rc.1",
|
|
21
|
+
"@xyo-network/payload-model": "^2.45.0-rc.1",
|
|
22
|
+
"@xyo-network/payload-wrapper": "^2.45.0-rc.1",
|
|
23
|
+
"@xyo-network/promise": "^2.45.0-rc.1",
|
|
24
|
+
"@xyo-network/witness": "^2.45.0-rc.1",
|
|
25
25
|
"lodash": "^4.17.21"
|
|
26
26
|
},
|
|
27
27
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/lodash": "^4.14.191",
|
|
30
|
-
"@xylabs/ts-scripts-yarn3": "^2.14.
|
|
31
|
-
"@xylabs/tsconfig": "^2.14.
|
|
30
|
+
"@xylabs/ts-scripts-yarn3": "^2.14.15",
|
|
31
|
+
"@xylabs/tsconfig": "^2.14.15",
|
|
32
32
|
"typescript": "^4.9.5"
|
|
33
33
|
},
|
|
34
34
|
"browser": "dist/esm/index.js",
|
|
@@ -63,5 +63,6 @@
|
|
|
63
63
|
},
|
|
64
64
|
"sideEffects": false,
|
|
65
65
|
"types": "dist/types/index.d.ts",
|
|
66
|
-
"version": "2.
|
|
66
|
+
"version": "2.45.0-rc.1",
|
|
67
|
+
"stableVersion": "2.44.1"
|
|
67
68
|
}
|
|
@@ -4,7 +4,7 @@ import { BoundWitnessValidator } from '@xyo-network/boundwitness-validator'
|
|
|
4
4
|
import { BoundWitnessWrapper } from '@xyo-network/boundwitness-wrapper'
|
|
5
5
|
import { Hasher } from '@xyo-network/core'
|
|
6
6
|
import { IdWitness, IdWitnessConfigSchema } from '@xyo-network/id-plugin'
|
|
7
|
-
import {
|
|
7
|
+
import { CompositeModuleResolver, ModuleParams } from '@xyo-network/module'
|
|
8
8
|
import { XyoNodeSystemInfoWitness, XyoNodeSystemInfoWitnessConfigSchema } from '@xyo-network/node-system-info-plugin'
|
|
9
9
|
import { XyoPayload, XyoPayloadSchema } from '@xyo-network/payload-model'
|
|
10
10
|
import { PayloadWrapper } from '@xyo-network/payload-wrapper'
|
|
@@ -35,7 +35,7 @@ describe('Sentinel', () => {
|
|
|
35
35
|
witnesses: witnesses.map((witness) => witness.address),
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
const resolver = new
|
|
38
|
+
const resolver = new CompositeModuleResolver()
|
|
39
39
|
resolver.add(archivist)
|
|
40
40
|
witnesses.forEach((witness) => resolver.add(witness))
|
|
41
41
|
|
|
@@ -120,7 +120,7 @@ describe('Sentinel', () => {
|
|
|
120
120
|
archivistB = await MemoryArchivist.create()
|
|
121
121
|
})
|
|
122
122
|
it('config', async () => {
|
|
123
|
-
const resolver = new
|
|
123
|
+
const resolver = new CompositeModuleResolver()
|
|
124
124
|
resolver.add([witnessA, witnessB, archivistA, archivistB])
|
|
125
125
|
const params: ModuleParams<SentinelConfig> = {
|
|
126
126
|
config: {
|
|
@@ -136,7 +136,7 @@ describe('Sentinel', () => {
|
|
|
136
136
|
await assertArchivistStateMatchesSentinelReport(result, [archivistA, archivistB])
|
|
137
137
|
})
|
|
138
138
|
it('config & inline', async () => {
|
|
139
|
-
const resolver = new
|
|
139
|
+
const resolver = new CompositeModuleResolver()
|
|
140
140
|
resolver.add([witnessA, archivistA, archivistB])
|
|
141
141
|
const params: ModuleParams<SentinelConfig> = {
|
|
142
142
|
config: {
|
|
@@ -154,7 +154,7 @@ describe('Sentinel', () => {
|
|
|
154
154
|
await assertArchivistStateMatchesSentinelReport(result, [archivistA, archivistB])
|
|
155
155
|
})
|
|
156
156
|
it('inline', async () => {
|
|
157
|
-
const resolver = new
|
|
157
|
+
const resolver = new CompositeModuleResolver()
|
|
158
158
|
resolver.add([archivistA, archivistB])
|
|
159
159
|
const params: ModuleParams<SentinelConfig> = {
|
|
160
160
|
config: {
|
|
@@ -171,10 +171,10 @@ describe('Sentinel', () => {
|
|
|
171
171
|
expect(observedB).toBeArrayOfSize(1)
|
|
172
172
|
const result = await sentinel.report([...observedA, ...observedB])
|
|
173
173
|
assertSentinelReport(result)
|
|
174
|
-
expect((await archivistA.get([Hasher.hash(observedA)])).length).toBe(1)
|
|
175
|
-
expect((await archivistA.get([Hasher.hash(observedB)])).length).toBe(1)
|
|
176
|
-
expect((await archivistB.get([Hasher.hash(observedA)])).length).toBe(1)
|
|
177
|
-
expect((await archivistB.get([Hasher.hash(observedB)])).length).toBe(1)
|
|
174
|
+
expect((await archivistA.get([Hasher.hash(observedA[0])])).length).toBe(1)
|
|
175
|
+
expect((await archivistA.get([Hasher.hash(observedB[0])])).length).toBe(1)
|
|
176
|
+
expect((await archivistB.get([Hasher.hash(observedA[0])])).length).toBe(1)
|
|
177
|
+
expect((await archivistB.get([Hasher.hash(observedB[0])])).length).toBe(1)
|
|
178
178
|
await assertArchivistStateMatchesSentinelReport(result, [archivistA, archivistB])
|
|
179
179
|
})
|
|
180
180
|
it('reports errors', async () => {
|
|
@@ -192,7 +192,7 @@ describe('Sentinel', () => {
|
|
|
192
192
|
}
|
|
193
193
|
const witnessA = await FailingWitness.create(paramsA)
|
|
194
194
|
|
|
195
|
-
const resolver = new
|
|
195
|
+
const resolver = new CompositeModuleResolver()
|
|
196
196
|
resolver.add([witnessA, witnessB, archivistA, archivistB])
|
|
197
197
|
const params: ModuleParams<SentinelConfig> = {
|
|
198
198
|
config: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { XyoBoundWitnessSchema } from '@xyo-network/boundwitness-model'
|
|
2
|
-
import {
|
|
2
|
+
import { CompositeModuleResolver } from '@xyo-network/module'
|
|
3
3
|
import { IdSchema, IdWitness, IdWitnessConfigSchema } from '@xyo-network/plugins'
|
|
4
4
|
import { AbstractWitness } from '@xyo-network/witness'
|
|
5
5
|
|
|
@@ -13,7 +13,7 @@ describe('SentinelRunner', () => {
|
|
|
13
13
|
|
|
14
14
|
beforeEach(async () => {
|
|
15
15
|
const witnesses: AbstractWitness[] = [await IdWitness.create({ config: { salt: 'test', schema: IdWitnessConfigSchema } })]
|
|
16
|
-
const resolver = new
|
|
16
|
+
const resolver = new CompositeModuleResolver()
|
|
17
17
|
witnesses.forEach((witness) => resolver.add(witness))
|
|
18
18
|
|
|
19
19
|
config = {
|