mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(electron): add BSO name resolvers for desktop board address resolution
Configure desktop PKC RPC with Ethereum-backed BSO resolvers so .bso board addresses resolve correctly.
This commit is contained in:
@@ -1,6 +1,23 @@
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { createDefaultPkcOptions, DEFAULT_ETH_RPC_URLS } from './pkc-rpc-options.js';
|
||||
import { startPkcRpcServer } from './start-pkc-rpc-core.js';
|
||||
|
||||
describe('createDefaultPkcOptions', () => {
|
||||
it('configures BSO name resolvers for the desktop RPC server', () => {
|
||||
const options = createDefaultPkcOptions({ dataPath: '/tmp/5chan-pkc' });
|
||||
|
||||
expect(options.dataPath).toBe('/tmp/5chan-pkc');
|
||||
expect(options.kuboRpcClientsOptions).toEqual([{ url: 'http://localhost:50019/api/v0' }]);
|
||||
expect(options.nameResolvers).toHaveLength(DEFAULT_ETH_RPC_URLS.length);
|
||||
expect(options.nameResolvers.map((resolver) => resolver.provider)).toEqual(DEFAULT_ETH_RPC_URLS);
|
||||
expect(options.nameResolvers[0]).toMatchObject({
|
||||
key: 'eth-ethereum-rpc.publicnode.com',
|
||||
provider: DEFAULT_ETH_RPC_URLS[0],
|
||||
});
|
||||
expect(options.nameResolvers[0].canResolve({ name: 'business-and-finance.bso' })).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('startPkcRpcServer', () => {
|
||||
it('passes the Electron data path through pkcOptions', async () => {
|
||||
const pkcOptions = {
|
||||
|
||||
Reference in New Issue
Block a user