-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathhistoryPing.spec.ts
More file actions
36 lines (35 loc) · 977 Bytes
/
historyPing.spec.ts
File metadata and controls
36 lines (35 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { afterAll, assert, beforeAll, describe, it } from 'vitest'
import { startRpc } from '../util.js'
const method = 'portal_historyPing'
describe(`${method} tests`, () => {
let ul
let ul2
let rp
let rp2
beforeAll(async () => {
const { ultralight, rpc } = await startRpc({ networks: ['history'], rpcPort: 8545 })
const { ultralight: ultralight2, rpc: rpc2 } = await startRpc({
port: 9001,
rpcPort: 8546,
networks: ['history'],
})
ul = ultralight
ul2 = ultralight2
rp = rpc
rp2 = rpc2
})
it('should get pong response', async () => {
const enr = (await rp2.request('portal_historyNodeInfo', [])).result.enr
assert.exists(enr)
const res = await rp.request(method, [
enr,
0,
{ ClientInfo: 'ultralight', DataRadius: 1, Capabilities: [0] },
])
assert.equal(res.result.payload.ClientInfo.clientName, 'ultralight')
}, 20000)
afterAll(() => {
ul.kill()
ul2.kill()
})
})