refactor(core): remove legacy plebbit terminology

This commit is contained in:
Tommaso Casaburi
2026-04-17 10:48:27 +07:00
parent e366dac25c
commit ee7a5b5778
158 changed files with 626 additions and 836 deletions
@@ -23,7 +23,7 @@ const testState = vi.hoisted(() => ({
rpcSettings: {
pkcRpcSettings: {
pkcOptions: {
dataPath: '/tmp/plebbit-data',
dataPath: '/tmp/pkc-data',
},
},
state: 'disconnected',
@@ -100,7 +100,7 @@ describe('AdvancedSettings', () => {
testState.rpcSettings = {
pkcRpcSettings: {
pkcOptions: {
dataPath: '/tmp/plebbit-data',
dataPath: '/tmp/pkc-data',
},
},
state: 'disconnected',
@@ -149,7 +149,7 @@ describe('AdvancedSettings', () => {
await dispatchInput(textareas[3], ' https://eth.one.example \n');
await dispatchInput(textareas[4], ' https://sol.one.example \n');
await dispatchInput(textInputs[1], ' ws://127.0.0.1:9138/secret ');
await dispatchInput(textInputs[2], ' /tmp/next-plebbit ');
await dispatchInput(textInputs[2], ' /tmp/next-pkc ');
await clickButton('save_advanced_settings');
expect(testState.setAccountMock).toHaveBeenCalledWith({
@@ -159,7 +159,7 @@ describe('AdvancedSettings', () => {
sol: { chainId: 101, urls: ['https://sol.one.example'] },
},
pkcOptions: {
dataPath: '/tmp/next-plebbit',
dataPath: '/tmp/next-pkc',
httpRoutersOptions: ['https://router.one.example'],
ipfsGatewayUrls: ['https://ipfs.one.example', 'https://ipfs.two.example'],
pkcRpcClientsOptions: ['ws://127.0.0.1:9138/secret'],
@@ -20,7 +20,6 @@ type AccountProtocolOptions = {
httpRoutersOptions?: string[];
ipfsGatewayUrls?: string[];
pkcRpcClientsOptions?: string[];
plebbitRpcClientsOptions?: string[];
pubsubHttpClientsOptions?: string[];
pubsubKuboRpcClientsOptions?: string[];
};
@@ -29,24 +28,22 @@ type AccountShape = {
chainProviders?: AccountProtocolOptions['chainProviders'];
mediaIpfsGatewayUrl?: string;
pkcOptions?: AccountProtocolOptions;
plebbitOptions?: AccountProtocolOptions;
};
type RpcSettingsShape = {
pkcOptions?: { dataPath?: string };
plebbitOptions?: { dataPath?: string };
};
const getProtocolOptions = (account?: AccountShape) => account?.pkcOptions ?? account?.plebbitOptions;
const getProtocolOptions = (account?: AccountShape) => account?.pkcOptions;
const getChainProviders = (account?: AccountShape) => account?.chainProviders ?? getProtocolOptions(account)?.chainProviders;
const getNodeRpcClientsOptions = (protocolOptions?: AccountProtocolOptions) => protocolOptions?.pkcRpcClientsOptions ?? protocolOptions?.plebbitRpcClientsOptions;
const getNodeRpcClientsOptions = (protocolOptions?: AccountProtocolOptions) => protocolOptions?.pkcRpcClientsOptions;
const getPubsubRpcClientsOptions = (protocolOptions?: AccountProtocolOptions) =>
protocolOptions?.pubsubKuboRpcClientsOptions ?? protocolOptions?.pubsubHttpClientsOptions;
const getRpcSettingsDataPath = (rpcSettings?: RpcSettingsShape) => rpcSettings?.pkcOptions?.dataPath ?? rpcSettings?.plebbitOptions?.dataPath ?? '';
const getRpcSettingsDataPath = (rpcSettings?: RpcSettingsShape) => rpcSettings?.pkcOptions?.dataPath ?? '';
const IPFSGatewaysSettings = ({ ipfsGatewayUrlsRef, mediaIpfsGatewayUrlRef }: SettingsProps) => {
const account = useAccount() as AccountShape | undefined;