@xyo-network/modules 5.1.22 → 5.1.24
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 +32 -29
- package/dist/neutral/spec/MultiSegmentResolve.spec.d.ts +0 -2
- package/dist/neutral/spec/MultiSegmentResolve.spec.d.ts.map +0 -1
- package/dist/neutral/spec/ParentsPrivates.spec.d.ts +0 -2
- package/dist/neutral/spec/ParentsPrivates.spec.d.ts.map +0 -1
- package/dist/neutral/spec/Sentinel.Interval.spec.d.ts +0 -2
- package/dist/neutral/spec/Sentinel.Interval.spec.d.ts.map +0 -1
- package/dist/neutral/spec/UpDown.spec.d.ts +0 -2
- package/dist/neutral/spec/UpDown.spec.d.ts.map +0 -1
- package/dist/neutral/spec/VariousNodeConfigurations.spec.d.ts +0 -2
- package/dist/neutral/spec/VariousNodeConfigurations.spec.d.ts.map +0 -1
- package/dist/neutral/spec/XyoModuleResolver.spec.d.ts +0 -2
- package/dist/neutral/spec/XyoModuleResolver.spec.d.ts.map +0 -1
- package/src/spec/MultiSegmentResolve.spec.ts +0 -65
- package/src/spec/ParentsPrivates.spec.ts +0 -50
- package/src/spec/Sentinel.Interval.spec.json +0 -138
- package/src/spec/Sentinel.Interval.spec.ts +0 -117
- package/src/spec/UpDown.spec.ts +0 -50
- package/src/spec/VariousNodeConfigurations.spec.ts +0 -197
- package/src/spec/XyoModuleResolver.spec.ts +0 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/modules",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.24",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -30,41 +30,44 @@
|
|
|
30
30
|
"types": "dist/neutral/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
|
-
"@xyo-network/archivist": "~5.1.
|
|
37
|
-
"@xyo-network/bridge": "~5.1.
|
|
38
|
-
"@xyo-network/diviner": "~5.1.
|
|
39
|
-
"@xyo-network/module": "~5.1.
|
|
40
|
-
"@xyo-network/node": "~5.1.
|
|
41
|
-
"@xyo-network/sentinel": "~5.1.
|
|
42
|
-
"@xyo-network/witness": "~5.1.
|
|
39
|
+
"@xyo-network/archivist": "~5.1.24",
|
|
40
|
+
"@xyo-network/bridge": "~5.1.24",
|
|
41
|
+
"@xyo-network/diviner": "~5.1.24",
|
|
42
|
+
"@xyo-network/module": "~5.1.24",
|
|
43
|
+
"@xyo-network/node": "~5.1.24",
|
|
44
|
+
"@xyo-network/sentinel": "~5.1.24",
|
|
45
|
+
"@xyo-network/witness": "~5.1.24"
|
|
43
46
|
},
|
|
44
47
|
"devDependencies": {
|
|
45
|
-
"@xylabs/delay": "~5.0.
|
|
46
|
-
"@xylabs/hex": "~5.0.
|
|
48
|
+
"@xylabs/delay": "~5.0.37",
|
|
49
|
+
"@xylabs/hex": "~5.0.37",
|
|
47
50
|
"@xylabs/ts-scripts-yarn3": "~7.2.8",
|
|
48
51
|
"@xylabs/tsconfig": "~7.2.8",
|
|
49
|
-
"@xylabs/vitest-extended": "~5.0.
|
|
50
|
-
"@xyo-network/archivist-memory": "~5.1.
|
|
51
|
-
"@xyo-network/archivist-model": "~5.1.
|
|
52
|
-
"@xyo-network/diviner-address-history": "~5.1.
|
|
53
|
-
"@xyo-network/diviner-jsonpatch-memory": "~5.1.
|
|
54
|
-
"@xyo-network/diviner-jsonpath-aggregate-memory": "~5.1.
|
|
55
|
-
"@xyo-network/diviner-jsonpath-memory": "~5.1.
|
|
56
|
-
"@xyo-network/diviner-model": "~5.1.
|
|
57
|
-
"@xyo-network/manifest": "~5.1.
|
|
58
|
-
"@xyo-network/module-factory-locator": "~5.1.
|
|
59
|
-
"@xyo-network/module-resolver": "~5.1.
|
|
60
|
-
"@xyo-network/node-memory": "~5.1.
|
|
61
|
-
"@xyo-network/node-model": "~5.1.
|
|
62
|
-
"@xyo-network/payload-model": "~5.1.
|
|
63
|
-
"@xyo-network/wallet": "~5.1.
|
|
64
|
-
"@xyo-network/witness-adhoc": "~5.1.
|
|
65
|
-
"@xyo-network/witness-model": "~5.1.
|
|
52
|
+
"@xylabs/vitest-extended": "~5.0.37",
|
|
53
|
+
"@xyo-network/archivist-memory": "~5.1.24",
|
|
54
|
+
"@xyo-network/archivist-model": "~5.1.24",
|
|
55
|
+
"@xyo-network/diviner-address-history": "~5.1.24",
|
|
56
|
+
"@xyo-network/diviner-jsonpatch-memory": "~5.1.24",
|
|
57
|
+
"@xyo-network/diviner-jsonpath-aggregate-memory": "~5.1.24",
|
|
58
|
+
"@xyo-network/diviner-jsonpath-memory": "~5.1.24",
|
|
59
|
+
"@xyo-network/diviner-model": "~5.1.24",
|
|
60
|
+
"@xyo-network/manifest": "~5.1.24",
|
|
61
|
+
"@xyo-network/module-factory-locator": "~5.1.24",
|
|
62
|
+
"@xyo-network/module-resolver": "~5.1.24",
|
|
63
|
+
"@xyo-network/node-memory": "~5.1.24",
|
|
64
|
+
"@xyo-network/node-model": "~5.1.24",
|
|
65
|
+
"@xyo-network/payload-model": "~5.1.24",
|
|
66
|
+
"@xyo-network/wallet": "~5.1.24",
|
|
67
|
+
"@xyo-network/witness-adhoc": "~5.1.24",
|
|
68
|
+
"@xyo-network/witness-model": "~5.1.24",
|
|
66
69
|
"typescript": "~5.9.3",
|
|
67
|
-
"vitest": "~4.0.
|
|
70
|
+
"vitest": "~4.0.10"
|
|
68
71
|
},
|
|
69
72
|
"publishConfig": {
|
|
70
73
|
"access": "public"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSegmentResolve.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/MultiSegmentResolve.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ParentsPrivates.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/ParentsPrivates.spec.ts"],"names":[],"mappings":"AAUA,OAAO,yBAAyB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Sentinel.Interval.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Sentinel.Interval.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UpDown.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/UpDown.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VariousNodeConfigurations.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/VariousNodeConfigurations.spec.ts"],"names":[],"mappings":"AACA,OAAO,yBAAyB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"XyoModuleResolver.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/XyoModuleResolver.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/hex'
|
|
2
|
-
import { MemoryArchivist } from '@xyo-network/archivist-memory'
|
|
3
|
-
import { ArchivistConfigSchema } from '@xyo-network/archivist-model'
|
|
4
|
-
import { MemoryNode } from '@xyo-network/node-memory'
|
|
5
|
-
import { NodeConfigSchema } from '@xyo-network/node-model'
|
|
6
|
-
import {
|
|
7
|
-
describe, expect, test,
|
|
8
|
-
} from 'vitest'
|
|
9
|
-
|
|
10
|
-
const rootNodeName = 'root'
|
|
11
|
-
const nodeAName = 'nodeA'
|
|
12
|
-
const nodeBName = 'nodeB'
|
|
13
|
-
const moduleAName = 'module'
|
|
14
|
-
const moduleBName = 'module'
|
|
15
|
-
const moduleCName = 'moduleC'
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @group module
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
describe('SimpleModuleResolverDeep', () => {
|
|
22
|
-
test('two archivists same name, different nodes', async () => {
|
|
23
|
-
const rootNode = await MemoryNode.create({ account: 'random', config: { name: rootNodeName, schema: NodeConfigSchema } })
|
|
24
|
-
const nodeA = await MemoryNode.create({ account: 'random', config: { name: nodeAName, schema: NodeConfigSchema } })
|
|
25
|
-
const nodeB = await MemoryNode.create({ account: 'random', config: { name: nodeBName, schema: NodeConfigSchema } })
|
|
26
|
-
const moduleA = await MemoryArchivist.create({ account: 'random', config: { name: moduleAName, schema: ArchivistConfigSchema } })
|
|
27
|
-
const moduleB = await MemoryArchivist.create({ account: 'random', config: { name: moduleBName, schema: ArchivistConfigSchema } })
|
|
28
|
-
const moduleC = await MemoryArchivist.create({ account: 'random', config: { name: moduleCName, schema: ArchivistConfigSchema } })
|
|
29
|
-
|
|
30
|
-
await nodeA.register(moduleA)
|
|
31
|
-
await nodeA.attach(moduleA.address, true)
|
|
32
|
-
|
|
33
|
-
const resolvedModuleAFromNodeA = await nodeA.resolve(moduleAName)
|
|
34
|
-
expect(resolvedModuleAFromNodeA?.address).toBe(moduleA.address)
|
|
35
|
-
|
|
36
|
-
await nodeB.register(moduleB)
|
|
37
|
-
await nodeB.register(moduleC)
|
|
38
|
-
await nodeB.attach(moduleB.address, true)
|
|
39
|
-
await nodeB.attach(moduleC.address)
|
|
40
|
-
|
|
41
|
-
const resolvedModuleBFromNodeB = await nodeB.resolve(moduleBName)
|
|
42
|
-
expect(resolvedModuleBFromNodeB?.address).toBe(moduleB.address)
|
|
43
|
-
|
|
44
|
-
await rootNode.register(nodeA)
|
|
45
|
-
await rootNode.attach(nodeA.address, true)
|
|
46
|
-
await rootNode.register(nodeB)
|
|
47
|
-
await rootNode.attach(nodeB.address, true)
|
|
48
|
-
|
|
49
|
-
const rootNodeResolve = await rootNode.resolve(`${rootNodeName}`)
|
|
50
|
-
expect(rootNodeResolve?.address).toBe(rootNode.address)
|
|
51
|
-
|
|
52
|
-
const resolvedModuleA = await rootNode.resolve(moduleAName)
|
|
53
|
-
expect([moduleA.address, moduleB.address].includes(resolvedModuleA?.address ?? '' as Address)).toBe(true)
|
|
54
|
-
const resolvedModuleB = await rootNode.resolve(moduleBName)
|
|
55
|
-
expect([moduleA.address, moduleB.address].includes(resolvedModuleB?.address ?? '' as Address)).toBe(true)
|
|
56
|
-
|
|
57
|
-
const resolvedModuleAMulti = await rootNode.resolve(`${nodeAName}:${moduleAName}`)
|
|
58
|
-
expect(resolvedModuleAMulti?.address).toBe(moduleA.address)
|
|
59
|
-
const resolvedModuleBMulti = await rootNode.resolve(`${nodeBName}:${moduleBName}`)
|
|
60
|
-
expect(resolvedModuleBMulti?.address).toBe(moduleB.address)
|
|
61
|
-
|
|
62
|
-
const resolvedModuleAMultiTooFar = await rootNode.resolve(`${rootNodeName}:${moduleAName}`)
|
|
63
|
-
expect(!!resolvedModuleAMultiTooFar).toBe(false)
|
|
64
|
-
})
|
|
65
|
-
})
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { MemoryArchivist } from '@xyo-network/archivist-memory'
|
|
2
|
-
import { ArchivistConfigSchema } from '@xyo-network/archivist-model'
|
|
3
|
-
import { MemoryNode } from '@xyo-network/node-memory'
|
|
4
|
-
import { NodeConfigSchema } from '@xyo-network/node-model'
|
|
5
|
-
|
|
6
|
-
const nodeAName = 'nodeA'
|
|
7
|
-
const rootPrivateNodeName = 'rootPrivateNode'
|
|
8
|
-
const rootPrivateName = 'rootPrivate'
|
|
9
|
-
const moduleAName = 'module'
|
|
10
|
-
|
|
11
|
-
import '@xylabs/vitest-extended'
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
describe, expect, test,
|
|
15
|
-
} from 'vitest'
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @group module
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
describe('ParentsPrivates', () => {
|
|
22
|
-
test("children should be able to see parent's privates", async () => {
|
|
23
|
-
const rootNode = await MemoryNode.create({ account: 'random' })
|
|
24
|
-
const rootPrivateNode = await MemoryNode.create({ account: 'random', config: { name: rootPrivateNodeName, schema: NodeConfigSchema } })
|
|
25
|
-
const rootPrivate = await MemoryArchivist.create({ account: 'random', config: { name: rootPrivateName, schema: ArchivistConfigSchema } })
|
|
26
|
-
const nodeA = await MemoryNode.create({ account: 'random', config: { name: nodeAName, schema: NodeConfigSchema } })
|
|
27
|
-
const moduleA = await MemoryArchivist.create({ account: 'random', config: { name: moduleAName, schema: ArchivistConfigSchema } })
|
|
28
|
-
|
|
29
|
-
await rootPrivateNode.register(rootPrivate)
|
|
30
|
-
await rootPrivateNode.attach(rootPrivate.address, false)
|
|
31
|
-
|
|
32
|
-
await nodeA.register(moduleA)
|
|
33
|
-
await nodeA.attach(moduleA.address, true)
|
|
34
|
-
|
|
35
|
-
const resolvedModuleAFromNodeA = await nodeA.resolve(moduleAName)
|
|
36
|
-
expect(resolvedModuleAFromNodeA?.address).toBe(moduleA.address)
|
|
37
|
-
|
|
38
|
-
await rootNode.register(rootPrivateNode)
|
|
39
|
-
await rootNode.attach(rootPrivateNode.address, false)
|
|
40
|
-
|
|
41
|
-
await rootNode.register(nodeA)
|
|
42
|
-
await rootNode.attach(nodeA.address, true)
|
|
43
|
-
|
|
44
|
-
const resolveRootPrivateNode = await nodeA.resolve(rootPrivateNodeName)
|
|
45
|
-
expect(resolveRootPrivateNode).toBeDefined()
|
|
46
|
-
|
|
47
|
-
const resolveRootPrivate = await nodeA.resolve(rootPrivateName)
|
|
48
|
-
expect(resolveRootPrivate).toBeUndefined()
|
|
49
|
-
})
|
|
50
|
-
})
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/schema.json",
|
|
3
|
-
"nodes": [
|
|
4
|
-
{
|
|
5
|
-
"config": {
|
|
6
|
-
"name": "DivinerTest",
|
|
7
|
-
"schema": "network.xyo.node.config",
|
|
8
|
-
"language": "javascript"
|
|
9
|
-
},
|
|
10
|
-
"modules": {
|
|
11
|
-
"public": [
|
|
12
|
-
{
|
|
13
|
-
"config": {
|
|
14
|
-
"name": "AddressStateArchivist",
|
|
15
|
-
"schema": "network.xyo.archivist.config"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"config": {
|
|
20
|
-
"archivist": "AddressStateArchivist",
|
|
21
|
-
"name": "AddressStateBoundWitnessDiviner",
|
|
22
|
-
"schema": "network.xyo.diviner.boundwitness.config"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"config": {
|
|
27
|
-
"archivist": "AddressStateArchivist",
|
|
28
|
-
"name": "AddressStatePayloadDiviner",
|
|
29
|
-
"schema": "network.xyo.diviner.payload.config"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"config": {
|
|
34
|
-
"name": "Archivist",
|
|
35
|
-
"schema": "network.xyo.archivist.config"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"config": {
|
|
40
|
-
"archivist": "Archivist",
|
|
41
|
-
"name": "BoundWitnessDiviner",
|
|
42
|
-
"schema": "network.xyo.diviner.boundwitness.config"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"config": {
|
|
47
|
-
"archivist": "Archivist",
|
|
48
|
-
"name": "PayloadDiviner",
|
|
49
|
-
"schema": "network.xyo.diviner.payload.config"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"config": {
|
|
54
|
-
"name": "JsonPatch",
|
|
55
|
-
"schema": "network.xyo.diviner.jsonpatch.config"
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"config": {
|
|
60
|
-
"name": "PayloadDivinerQueryTemplateWitness",
|
|
61
|
-
"schema": "network.xyo.witness.adhoc.config",
|
|
62
|
-
"payload": {
|
|
63
|
-
"limit": 1,
|
|
64
|
-
"order": "asc",
|
|
65
|
-
"schema": "network.xyo.diviner.payload.query",
|
|
66
|
-
"schemas": ["network.xyo.test"]
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"config": {
|
|
72
|
-
"destinationSchema": "network.xyo.diviner.payload.query",
|
|
73
|
-
"excludeSources": true,
|
|
74
|
-
"name": "PayloadDivinerQueryBuilder",
|
|
75
|
-
"schema": "network.xyo.diviner.jsonpath.aggregate.config",
|
|
76
|
-
"schemaTransforms": {
|
|
77
|
-
"network.xyo.diviner.payload.query": [
|
|
78
|
-
{
|
|
79
|
-
"destinationField": "limit",
|
|
80
|
-
"sourcePathExpression": "$.limit"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"destinationField": "order",
|
|
84
|
-
"sourcePathExpression": "$.order"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"destinationField": "schemas",
|
|
88
|
-
"sourcePathExpression": "$.schemas"
|
|
89
|
-
}
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"config": {
|
|
96
|
-
"archiving": {
|
|
97
|
-
"archivists": ["Results"]
|
|
98
|
-
},
|
|
99
|
-
"automations": [
|
|
100
|
-
{
|
|
101
|
-
"frequency": 1,
|
|
102
|
-
"frequencyUnits": "second",
|
|
103
|
-
"schema": "network.xyo.automation.interval",
|
|
104
|
-
"start": 0,
|
|
105
|
-
"type": "interval"
|
|
106
|
-
}
|
|
107
|
-
],
|
|
108
|
-
"name": "Sentinel",
|
|
109
|
-
"schema": "network.xyo.sentinel.config",
|
|
110
|
-
"synchronous": "true",
|
|
111
|
-
"tasks": [
|
|
112
|
-
{
|
|
113
|
-
"input": true,
|
|
114
|
-
"mod": "PayloadDivinerQueryTemplateWitness"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"input": ["PayloadDivinerQueryTemplateWitness"],
|
|
118
|
-
"mod": "PayloadDivinerQueryBuilder"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"input": ["PayloadDivinerQueryBuilder"],
|
|
122
|
-
"mod": "PayloadDiviner"
|
|
123
|
-
}
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
"config": {
|
|
129
|
-
"name": "Results",
|
|
130
|
-
"schema": "network.xyo.archivist.config"
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
]
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
],
|
|
137
|
-
"schema": "network.xyo.manifest"
|
|
138
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import '@xylabs/vitest-extended'
|
|
2
|
-
|
|
3
|
-
import { delay } from '@xylabs/delay'
|
|
4
|
-
import { asArchivistInstance } from '@xyo-network/archivist-model'
|
|
5
|
-
import { JsonPatchDiviner } from '@xyo-network/diviner-jsonpatch-memory'
|
|
6
|
-
import { JsonPathAggregateDiviner } from '@xyo-network/diviner-jsonpath-aggregate-memory'
|
|
7
|
-
import { JsonPathDiviner } from '@xyo-network/diviner-jsonpath-memory'
|
|
8
|
-
import { asDivinerInstance } from '@xyo-network/diviner-model'
|
|
9
|
-
import type { PackageManifestPayload } from '@xyo-network/manifest'
|
|
10
|
-
import { ManifestWrapper } from '@xyo-network/manifest'
|
|
11
|
-
import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
|
|
12
|
-
import type { MemoryNode } from '@xyo-network/node-memory'
|
|
13
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
14
|
-
import { HDWallet } from '@xyo-network/wallet'
|
|
15
|
-
import {
|
|
16
|
-
beforeAll,
|
|
17
|
-
describe, expect, it,
|
|
18
|
-
} from 'vitest'
|
|
19
|
-
|
|
20
|
-
import SentinelManifest from './Sentinel.Interval.spec.json' with { type: 'json' }
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @group sentinel
|
|
24
|
-
* @group module
|
|
25
|
-
* @group slow
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
const NETWORK_XYO_TEST = 'network.xyo.test' as const
|
|
29
|
-
|
|
30
|
-
describe('Sentinel.Interval', () => {
|
|
31
|
-
let node: MemoryNode
|
|
32
|
-
|
|
33
|
-
beforeAll(async () => {
|
|
34
|
-
const wallet = await HDWallet.random()
|
|
35
|
-
const locator = new ModuleFactoryLocator()
|
|
36
|
-
locator.register(JsonPatchDiviner.factory())
|
|
37
|
-
locator.register(JsonPathDiviner.factory())
|
|
38
|
-
locator.register(JsonPathAggregateDiviner.factory())
|
|
39
|
-
const manifest = SentinelManifest as PackageManifestPayload
|
|
40
|
-
const manifestWrapper = new ManifestWrapper(manifest, wallet, locator)
|
|
41
|
-
node = await manifestWrapper.loadNodeFromIndex(0)
|
|
42
|
-
await node.start()
|
|
43
|
-
|
|
44
|
-
const publicModules = manifest.nodes[0].modules?.public ?? []
|
|
45
|
-
const mods = await node.resolve('*')
|
|
46
|
-
expect(mods.length).toBe(publicModules.length + 1)
|
|
47
|
-
|
|
48
|
-
// Add some test data
|
|
49
|
-
const testPayloads = [
|
|
50
|
-
{
|
|
51
|
-
schema: NETWORK_XYO_TEST,
|
|
52
|
-
value: 1,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
schema: NETWORK_XYO_TEST,
|
|
56
|
-
value: 2,
|
|
57
|
-
},
|
|
58
|
-
]
|
|
59
|
-
const archivist = asArchivistInstance(await node.resolve('Archivist'))
|
|
60
|
-
expect(archivist).toBeDefined()
|
|
61
|
-
await archivist?.insert(testPayloads)
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
it('sentinel query', async () => {
|
|
65
|
-
let payloads: Payload[] = []
|
|
66
|
-
const archivist = asArchivistInstance(await node.resolve('Results'))
|
|
67
|
-
expect(archivist).toBeDefined()
|
|
68
|
-
while (payloads.length === 0) {
|
|
69
|
-
await delay(500)
|
|
70
|
-
const all = await archivist?.all?.() ?? []
|
|
71
|
-
const filtered = all.filter(p => p.schema === NETWORK_XYO_TEST)
|
|
72
|
-
if (filtered.length > 0) payloads.push(...filtered)
|
|
73
|
-
}
|
|
74
|
-
expect(payloads.some(p => p.schema === NETWORK_XYO_TEST)).toBeTrue()
|
|
75
|
-
}, 3000)
|
|
76
|
-
it.skip('manual query', async () => {
|
|
77
|
-
const testPayloads = [
|
|
78
|
-
{
|
|
79
|
-
schema: NETWORK_XYO_TEST,
|
|
80
|
-
value: 1,
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
schema: NETWORK_XYO_TEST,
|
|
84
|
-
value: 2,
|
|
85
|
-
},
|
|
86
|
-
]
|
|
87
|
-
const archivist = asArchivistInstance(await node.resolve('Archivist'))
|
|
88
|
-
expect(archivist).toBeDefined()
|
|
89
|
-
await archivist?.insert(testPayloads)
|
|
90
|
-
// const addressStateArchivist = asArchivistInstance(await node.resolve('AddressStateArchivist'))
|
|
91
|
-
// const addressStateBoundWitnessDiviner = asDivinerInstance(await node.resolve('AddressStateBoundWitnessDiviner'))
|
|
92
|
-
const addressStatePayloadDiviner = asDivinerInstance(await node.resolve('AddressStatePayloadDiviner'))
|
|
93
|
-
const lastStateQuery = {
|
|
94
|
-
limit: 1,
|
|
95
|
-
offset: 0,
|
|
96
|
-
order: 'desc',
|
|
97
|
-
schema: 'network.xyo.diviner.payload.query',
|
|
98
|
-
// schema: 'network.xyo.diviner.boundwitness.query',
|
|
99
|
-
// payload_schemas: ['network.xyo.module.state'],
|
|
100
|
-
schemas: ['network.xyo.module.state'],
|
|
101
|
-
}
|
|
102
|
-
const initialState = await addressStatePayloadDiviner?.divine([lastStateQuery])
|
|
103
|
-
const statePayloads
|
|
104
|
-
= initialState?.filter((p): p is { offset?: number; schema: string } => p.schema === 'network.xyo.module.state') ?? []
|
|
105
|
-
const offset = statePayloads?.[0]?.offset ?? 0
|
|
106
|
-
const payloadDiviner = asDivinerInstance(await node.resolve('PayloadDiviner'))
|
|
107
|
-
const payloadDivinerQuery = {
|
|
108
|
-
limit: 1,
|
|
109
|
-
offset,
|
|
110
|
-
order: 'asc',
|
|
111
|
-
schema: 'network.xyo.diviner.payload.query',
|
|
112
|
-
schemas: [NETWORK_XYO_TEST],
|
|
113
|
-
}
|
|
114
|
-
const payloadBatch = await payloadDiviner?.divine([payloadDivinerQuery])
|
|
115
|
-
expect(payloadBatch?.length).toBe(1)
|
|
116
|
-
})
|
|
117
|
-
})
|
package/src/spec/UpDown.spec.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import '@xylabs/vitest-extended'
|
|
2
|
-
|
|
3
|
-
import { MemoryArchivist } from '@xyo-network/archivist-memory'
|
|
4
|
-
import { ArchivistConfigSchema } from '@xyo-network/archivist-model'
|
|
5
|
-
import { MemoryNode } from '@xyo-network/node-memory'
|
|
6
|
-
import { NodeConfigSchema } from '@xyo-network/node-model'
|
|
7
|
-
import {
|
|
8
|
-
describe, expect, test,
|
|
9
|
-
} from 'vitest'
|
|
10
|
-
|
|
11
|
-
const rootNodeName = 'root'
|
|
12
|
-
const nodeAName = 'nodeA'
|
|
13
|
-
const nodeBName = 'nodeB'
|
|
14
|
-
const moduleAName = 'module'
|
|
15
|
-
const moduleBName = 'module'
|
|
16
|
-
const moduleCName = 'moduleC'
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @group module
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
describe('UpDown', () => {
|
|
23
|
-
test('two archivists same name, different nodes', async () => {
|
|
24
|
-
const rootNode = await MemoryNode.create({ account: 'random', config: { name: rootNodeName, schema: NodeConfigSchema } })
|
|
25
|
-
const nodeA = await MemoryNode.create({ account: 'random', config: { name: nodeAName, schema: NodeConfigSchema } })
|
|
26
|
-
const nodeB = await MemoryNode.create({ account: 'random', config: { name: nodeBName, schema: NodeConfigSchema } })
|
|
27
|
-
const moduleA = await MemoryArchivist.create({ account: 'random', config: { name: moduleAName, schema: ArchivistConfigSchema } })
|
|
28
|
-
const moduleB = await MemoryArchivist.create({ account: 'random', config: { name: moduleBName, schema: ArchivistConfigSchema } })
|
|
29
|
-
const moduleC = await MemoryArchivist.create({ account: 'random', config: { name: moduleCName, schema: ArchivistConfigSchema } })
|
|
30
|
-
|
|
31
|
-
await nodeA.register(moduleA)
|
|
32
|
-
await nodeA.attach(moduleA.address, true)
|
|
33
|
-
|
|
34
|
-
await nodeB.register(moduleB)
|
|
35
|
-
await nodeB.register(moduleC)
|
|
36
|
-
await nodeB.attach(moduleB.address, true)
|
|
37
|
-
await nodeB.attach(moduleC.address)
|
|
38
|
-
|
|
39
|
-
await rootNode.register(nodeA)
|
|
40
|
-
await rootNode.attach(nodeA.address, true)
|
|
41
|
-
await rootNode.register(nodeB)
|
|
42
|
-
await rootNode.attach(nodeB.address, true)
|
|
43
|
-
|
|
44
|
-
const upAndDownResolve = await moduleA.resolve(`${nodeAName}:${moduleAName}`)
|
|
45
|
-
expect(upAndDownResolve?.address).toBe(moduleA.address)
|
|
46
|
-
|
|
47
|
-
const upAndDownResolvePrivate = await moduleA.resolvePrivate(`${nodeBName}:${moduleCName}`)
|
|
48
|
-
expect(upAndDownResolvePrivate?.address).toBe(moduleC.address)
|
|
49
|
-
})
|
|
50
|
-
})
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-statements */
|
|
2
|
-
import '@xylabs/vitest-extended'
|
|
3
|
-
|
|
4
|
-
import { MemoryArchivist } from '@xyo-network/archivist-memory'
|
|
5
|
-
import type { AttachableArchivistInstance } from '@xyo-network/archivist-model'
|
|
6
|
-
import { AddressHistoryDiviner, AddressHistoryDivinerConfigSchema } from '@xyo-network/diviner-address-history'
|
|
7
|
-
import type { AttachableDivinerInstance } from '@xyo-network/diviner-model'
|
|
8
|
-
import { MemoryNode } from '@xyo-network/node-memory'
|
|
9
|
-
import {
|
|
10
|
-
isNodeInstance, isNodeModule, NodeConfigSchema,
|
|
11
|
-
} from '@xyo-network/node-model'
|
|
12
|
-
import { AdhocWitness, AdhocWitnessConfigSchema } from '@xyo-network/witness-adhoc'
|
|
13
|
-
import type { AttachableWitnessInstance } from '@xyo-network/witness-model'
|
|
14
|
-
import {
|
|
15
|
-
beforeAll,
|
|
16
|
-
describe, expect, test,
|
|
17
|
-
} from 'vitest'
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @group module
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
describe('MultiNodeConfiguration', () => {
|
|
24
|
-
let primaryArchivist: AttachableArchivistInstance
|
|
25
|
-
let primaryNode: MemoryNode
|
|
26
|
-
|
|
27
|
-
let leftInternalArchivist: AttachableArchivistInstance
|
|
28
|
-
let leftInternalArchivist2: AttachableArchivistInstance
|
|
29
|
-
let leftExternalArchivist: AttachableArchivistInstance
|
|
30
|
-
let leftDiviner: AttachableDivinerInstance
|
|
31
|
-
let leftNode: MemoryNode
|
|
32
|
-
|
|
33
|
-
let rightNode: MemoryNode
|
|
34
|
-
let rightInternalArchivist: AttachableArchivistInstance
|
|
35
|
-
let rightExternalArchivist: AttachableArchivistInstance
|
|
36
|
-
let rightWitness: AttachableWitnessInstance
|
|
37
|
-
|
|
38
|
-
beforeAll(async () => {
|
|
39
|
-
primaryNode = await MemoryNode.create({ account: 'random', config: { name: 'primaryNode', schema: NodeConfigSchema } })
|
|
40
|
-
expect(isNodeModule(primaryNode)).toBe(true)
|
|
41
|
-
expect(isNodeInstance(primaryNode)).toBe(true)
|
|
42
|
-
primaryArchivist = await MemoryArchivist.create({
|
|
43
|
-
account: 'random',
|
|
44
|
-
config: { name: 'primaryArchivist', schema: MemoryArchivist.defaultConfigSchema },
|
|
45
|
-
})
|
|
46
|
-
await primaryNode.register(primaryArchivist)
|
|
47
|
-
await primaryNode.attach(primaryArchivist.address, true)
|
|
48
|
-
|
|
49
|
-
rightNode = await MemoryNode.create({ account: 'random', config: { name: 'rightNode', schema: NodeConfigSchema } })
|
|
50
|
-
rightInternalArchivist = await MemoryArchivist.create({
|
|
51
|
-
account: 'random',
|
|
52
|
-
config: { name: 'rightInternalArchivist', schema: MemoryArchivist.defaultConfigSchema },
|
|
53
|
-
})
|
|
54
|
-
rightExternalArchivist = await MemoryArchivist.create({
|
|
55
|
-
account: 'random',
|
|
56
|
-
config: { name: 'archivist', schema: MemoryArchivist.defaultConfigSchema },
|
|
57
|
-
})
|
|
58
|
-
rightWitness = await AdhocWitness.create({
|
|
59
|
-
account: 'random',
|
|
60
|
-
config: { name: 'rightWitness', schema: AdhocWitnessConfigSchema },
|
|
61
|
-
})
|
|
62
|
-
await rightNode.register(rightInternalArchivist)
|
|
63
|
-
await rightNode.attach(rightInternalArchivist.address)
|
|
64
|
-
await rightNode.register(rightExternalArchivist)
|
|
65
|
-
await rightNode.attach(rightExternalArchivist.address, true)
|
|
66
|
-
await rightNode.register(rightWitness)
|
|
67
|
-
await rightNode.attach(rightWitness.address, true)
|
|
68
|
-
|
|
69
|
-
leftNode = await MemoryNode.create({ account: 'random', config: { name: 'leftNode', schema: NodeConfigSchema } })
|
|
70
|
-
leftInternalArchivist = await MemoryArchivist.create({
|
|
71
|
-
account: 'random',
|
|
72
|
-
config: { name: 'leftInternalArchivist', schema: MemoryArchivist.defaultConfigSchema },
|
|
73
|
-
})
|
|
74
|
-
leftInternalArchivist2 = await MemoryArchivist.create({
|
|
75
|
-
account: 'random',
|
|
76
|
-
config: { name: 'leftInternalArchivist2', schema: MemoryArchivist.defaultConfigSchema },
|
|
77
|
-
})
|
|
78
|
-
leftExternalArchivist = await MemoryArchivist.create({
|
|
79
|
-
account: 'random',
|
|
80
|
-
config: { name: 'archivist', schema: MemoryArchivist.defaultConfigSchema },
|
|
81
|
-
})
|
|
82
|
-
leftDiviner = await AddressHistoryDiviner.create({
|
|
83
|
-
account: 'random',
|
|
84
|
-
config: {
|
|
85
|
-
address: leftNode.address, name: 'leftDiviner', schema: AddressHistoryDivinerConfigSchema,
|
|
86
|
-
},
|
|
87
|
-
})
|
|
88
|
-
await leftNode.register(leftInternalArchivist)
|
|
89
|
-
await leftNode.attach(leftInternalArchivist.address)
|
|
90
|
-
await leftNode.register(leftInternalArchivist2)
|
|
91
|
-
await leftNode.attach(leftInternalArchivist2.address)
|
|
92
|
-
await leftNode.register(leftExternalArchivist)
|
|
93
|
-
await leftNode.attach(leftExternalArchivist.address, true)
|
|
94
|
-
await leftNode.register(leftDiviner)
|
|
95
|
-
await leftNode.attach(leftDiviner.address, true)
|
|
96
|
-
|
|
97
|
-
await primaryNode.register(leftNode)
|
|
98
|
-
await primaryNode.register(rightNode)
|
|
99
|
-
})
|
|
100
|
-
test('leftNode', async () => {
|
|
101
|
-
await primaryNode.attach(leftNode.address, true)
|
|
102
|
-
// await primaryNode.detach(rightNode.address)
|
|
103
|
-
expect((await primaryNode.resolve(primaryArchivist.address))).toBeDefined()
|
|
104
|
-
expect((await primaryNode.resolve('primaryArchivist'))).toBeDefined()
|
|
105
|
-
|
|
106
|
-
expect((await leftNode.resolve(leftDiviner.address))).toBeDefined()
|
|
107
|
-
expect((await leftNode.resolve('leftDiviner'))).toBeDefined()
|
|
108
|
-
|
|
109
|
-
// internal: should be resolvable by leftNode children
|
|
110
|
-
expect((await leftInternalArchivist2.resolve(leftInternalArchivist.address))).toBeDefined()
|
|
111
|
-
expect((await leftInternalArchivist2.resolve('leftInternalArchivist'))).toBeDefined()
|
|
112
|
-
|
|
113
|
-
expect((await leftInternalArchivist2.resolve(leftExternalArchivist.address))).toBeDefined()
|
|
114
|
-
expect((await leftInternalArchivist2.resolve('archivist'))).toBeDefined()
|
|
115
|
-
|
|
116
|
-
expect((await leftInternalArchivist2.resolve(rightWitness.address))).toBeUndefined()
|
|
117
|
-
expect((await leftInternalArchivist2.resolve('rightWitness'))).toBeUndefined()
|
|
118
|
-
|
|
119
|
-
// internal: should not be resolvable by anyone outside of node, including wrapper
|
|
120
|
-
|
|
121
|
-
expect((await rightNode.resolve(rightInternalArchivist.address))).toBeUndefined()
|
|
122
|
-
expect((await rightNode.resolve('rightInternalArchivist'))).toBeUndefined()
|
|
123
|
-
|
|
124
|
-
expect((await rightNode.resolve(rightInternalArchivist.address))).toBeUndefined()
|
|
125
|
-
expect((await rightNode.resolve('rightInternalArchivist'))).toBeUndefined()
|
|
126
|
-
|
|
127
|
-
expect((await rightNode.resolve(rightExternalArchivist.address))).toBeDefined()
|
|
128
|
-
expect((await rightNode.resolve('archivist'))).toBeDefined()
|
|
129
|
-
|
|
130
|
-
expect((await primaryNode.resolve(leftNode.address))).toBeDefined()
|
|
131
|
-
expect((await primaryNode.resolve('leftNode'))).toBeDefined()
|
|
132
|
-
|
|
133
|
-
expect((await primaryNode.resolve(rightNode.address))).toBeUndefined()
|
|
134
|
-
expect((await primaryNode.resolve('rightNode'))).toBeUndefined()
|
|
135
|
-
|
|
136
|
-
expect((await primaryNode.resolve(leftDiviner.address))).toBeDefined()
|
|
137
|
-
expect((await primaryNode.resolve('leftDiviner'))).toBeDefined()
|
|
138
|
-
|
|
139
|
-
expect((await primaryNode.resolve(rightWitness.address))).toBeUndefined()
|
|
140
|
-
expect((await primaryNode.resolve('rightWitness'))).toBeUndefined()
|
|
141
|
-
|
|
142
|
-
// internal: should NOT be resolvable by primaryNode
|
|
143
|
-
expect((await primaryNode.resolve(leftInternalArchivist.address))).toBeUndefined()
|
|
144
|
-
expect((await primaryNode.resolve('leftInternalArchivist'))).toBeUndefined()
|
|
145
|
-
|
|
146
|
-
// internal: should NOT be resolvable by node
|
|
147
|
-
expect((await primaryNode.resolve(rightInternalArchivist.address))).toBeUndefined()
|
|
148
|
-
expect((await primaryNode.resolve('rightInternalArchivist'))).toBeUndefined()
|
|
149
|
-
|
|
150
|
-
// external: should be resolvable by primaryNode
|
|
151
|
-
expect((await primaryNode.resolve(leftExternalArchivist.address))).toBeDefined()
|
|
152
|
-
|
|
153
|
-
// external: should be NOT be resolvable by node
|
|
154
|
-
expect((await primaryNode.resolve(rightExternalArchivist.address))).toBeUndefined()
|
|
155
|
-
|
|
156
|
-
// external: should be resolvable by node
|
|
157
|
-
expect((await primaryNode.resolve('archivist'))).toBeDefined()
|
|
158
|
-
expect((await primaryNode.resolve('archivist'))?.address).toBe(leftExternalArchivist.address)
|
|
159
|
-
})
|
|
160
|
-
|
|
161
|
-
test('rightNode', async () => {
|
|
162
|
-
await primaryNode.attach(rightNode.address, true)
|
|
163
|
-
await primaryNode.detach(leftNode.address)
|
|
164
|
-
expect((await primaryNode.resolve(primaryArchivist.address))).toBeDefined()
|
|
165
|
-
expect((await leftNode.resolve(leftDiviner.address))).toBeDefined()
|
|
166
|
-
expect((await rightNode.resolve(rightWitness.address))).toBeDefined()
|
|
167
|
-
expect((await primaryNode.resolve(rightNode.address))).toBeDefined()
|
|
168
|
-
expect((await primaryNode.resolve(leftNode.address))).toBeDefined()
|
|
169
|
-
expect((await primaryNode.resolve(rightWitness.address))).toBeDefined()
|
|
170
|
-
expect((await primaryNode.resolve(leftDiviner.address))).toBeDefined()
|
|
171
|
-
expect((await primaryNode.resolve('archivist'))).toBeDefined()
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
test('leftNode', async () => {
|
|
175
|
-
// await primaryNode.detach(leftNode.address)
|
|
176
|
-
await primaryNode.detach(rightNode.address)
|
|
177
|
-
await primaryNode.attach(leftNode.address, true)
|
|
178
|
-
await primaryNode.attach(rightNode.address, true)
|
|
179
|
-
|
|
180
|
-
// internal: should NOT be resolvable by primaryNode
|
|
181
|
-
expect((await primaryNode.resolve(leftInternalArchivist.address))).toBeUndefined()
|
|
182
|
-
expect((await primaryNode.resolve('leftInternalArchivist'))).toBeUndefined()
|
|
183
|
-
|
|
184
|
-
// internal: should NOT be resolvable by node
|
|
185
|
-
expect((await primaryNode.resolve(rightInternalArchivist.address))).toBeUndefined()
|
|
186
|
-
expect((await primaryNode.resolve('rightInternalArchivist'))).toBeUndefined()
|
|
187
|
-
|
|
188
|
-
// external: should be resolvable by primaryNode
|
|
189
|
-
expect((await primaryNode.resolve(leftExternalArchivist.address))).toBeDefined()
|
|
190
|
-
|
|
191
|
-
// external: should be resolvable by node
|
|
192
|
-
expect((await primaryNode.resolve(rightExternalArchivist.address))).toBeDefined()
|
|
193
|
-
|
|
194
|
-
// external: should be resolvable by node
|
|
195
|
-
expect((await primaryNode.resolve('archivist'))).toBeDefined()
|
|
196
|
-
})
|
|
197
|
-
})
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import '@xylabs/vitest-extended'
|
|
2
|
-
|
|
3
|
-
import { MemoryArchivist } from '@xyo-network/archivist-memory'
|
|
4
|
-
import type { ArchivistInstance } from '@xyo-network/archivist-model'
|
|
5
|
-
import { CompositeModuleResolver } from '@xyo-network/module-resolver'
|
|
6
|
-
import { AdhocWitness, AdhocWitnessConfigSchema } from '@xyo-network/witness-adhoc'
|
|
7
|
-
import type { WitnessInstance } from '@xyo-network/witness-model'
|
|
8
|
-
import {
|
|
9
|
-
beforeAll,
|
|
10
|
-
describe, expect, test,
|
|
11
|
-
} from 'vitest'
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @group module
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
describe('ModuleResolver', () => {
|
|
18
|
-
let archivist: ArchivistInstance
|
|
19
|
-
let witness: WitnessInstance
|
|
20
|
-
let resolver: CompositeModuleResolver
|
|
21
|
-
beforeAll(async () => {
|
|
22
|
-
archivist = await MemoryArchivist.create({
|
|
23
|
-
account: 'random',
|
|
24
|
-
config: { name: 'memory-archivist', schema: MemoryArchivist.defaultConfigSchema },
|
|
25
|
-
})
|
|
26
|
-
witness = await AdhocWitness.create({ account: 'random', config: { schema: AdhocWitnessConfigSchema } })
|
|
27
|
-
resolver = new CompositeModuleResolver({ root: archivist })
|
|
28
|
-
resolver.add(archivist)
|
|
29
|
-
resolver.add(witness)
|
|
30
|
-
})
|
|
31
|
-
test('simple by address', async () => {
|
|
32
|
-
expect((await resolver.resolve(archivist.address))).toBeDefined()
|
|
33
|
-
expect((await resolver.resolve(witness.address))).toBeDefined()
|
|
34
|
-
})
|
|
35
|
-
test('simple by name', async () => {
|
|
36
|
-
expect((await resolver.resolve('memory-archivist'))).toBeDefined()
|
|
37
|
-
})
|
|
38
|
-
})
|