Merge branch 'codex/fix/remove-solana-rpc-setting'

This commit is contained in:
Tommaso Casaburi
2026-05-05 15:57:54 +07:00
2 changed files with 4 additions and 27 deletions
@@ -139,15 +139,15 @@ describe('AdvancedSettings', () => {
const textareas = container.querySelectorAll<HTMLTextAreaElement>('textarea');
const textInputs = container.querySelectorAll<HTMLInputElement>('input[type="text"]');
expect(textareas.length).toBe(5);
expect(textareas.length).toBe(4);
expect(textInputs.length).toBe(3);
expect(container.textContent).not.toContain('Solana RPC');
await dispatchInput(textareas[0], ' https://ipfs.one.example \n\nhttps://ipfs.two.example ');
await dispatchInput(textInputs[0], ' https://media.new.example ');
await dispatchInput(textareas[1], ' https://pubsub.one.example \n');
await dispatchInput(textareas[2], ' https://router.one.example \n');
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-pkc ');
await clickButton('save_advanced_settings');
@@ -156,7 +156,6 @@ describe('AdvancedSettings', () => {
mediaIpfsGatewayUrl: 'https://media.new.example',
chainProviders: {
eth: { chainId: 1, urls: ['https://eth.one.example'] },
sol: { chainId: 101, urls: ['https://sol.one.example'] },
},
pkcOptions: {
dataPath: '/tmp/next-pkc',
@@ -9,7 +9,6 @@ interface SettingsProps {
pubsubProvidersRef?: RefObject<HTMLTextAreaElement>;
httpRoutersRef?: RefObject<HTMLTextAreaElement>;
ethRpcRef?: RefObject<HTMLTextAreaElement>;
solRpcRef?: RefObject<HTMLTextAreaElement>;
p2pRpcRef?: RefObject<HTMLInputElement>;
p2pDataPathRef?: RefObject<HTMLInputElement>;
}
@@ -131,11 +130,10 @@ const HttpRoutersSettings = ({ httpRoutersRef }: SettingsProps) => {
);
};
const BlockchainProvidersSettings = ({ ethRpcRef, solRpcRef }: SettingsProps) => {
const BlockchainProvidersSettings = ({ ethRpcRef }: SettingsProps) => {
const account = useAccount() as AccountShape | undefined;
const chainProviders = getChainProviders(account);
const ethRpcDefaultValue = chainProviders?.['eth']?.urls?.join('\n');
const solRpcDefaultValue = chainProviders?.['sol']?.urls?.join('\n');
return (
<div className={styles.blockchainProvidersSettings}>
@@ -150,17 +148,6 @@ const BlockchainProvidersSettings = ({ ethRpcRef, solRpcRef }: SettingsProps) =>
rows={chainProviders?.['eth']?.urls?.length || 1}
/>
</div>
<span className={styles.settingTip}>Solana RPC, for .sol domains</span>
<div>
<textarea
defaultValue={solRpcDefaultValue}
ref={solRpcRef}
autoCorrect='off'
autoComplete='off'
spellCheck='false'
rows={chainProviders?.['sol']?.urls?.length || 1}
/>
</div>
</div>
);
};
@@ -221,7 +208,6 @@ const AdvancedSettings = () => {
const mediaIpfsGatewayUrlRef = useRef<HTMLInputElement>(null);
const pubsubProvidersRef = useRef<HTMLTextAreaElement>(null);
const ethRpcRef = useRef<HTMLTextAreaElement>(null);
const solRpcRef = useRef<HTMLTextAreaElement>(null);
const httpRoutersRef = useRef<HTMLTextAreaElement>(null);
const p2pRpcRef = useRef<HTMLInputElement>(null);
const p2pDataPathRef = useRef<HTMLInputElement>(null);
@@ -244,11 +230,6 @@ const AdvancedSettings = () => {
.map((url) => url.trim())
.filter((url) => url !== '');
const solRpcUrls = solRpcRef.current?.value
.split('\n')
.map((url) => url.trim())
.filter((url) => url !== '');
const httpRoutersOptions = httpRoutersRef.current?.value
.split('\n')
.map((url) => url.trim())
@@ -261,9 +242,6 @@ const AdvancedSettings = () => {
if (ethRpcUrls && ethRpcUrls.length > 0) {
chainProviders.eth = { urls: ethRpcUrls, chainId: 1 };
}
if (solRpcUrls && solRpcUrls.length > 0) {
chainProviders.sol = { urls: solRpcUrls, chainId: 101 };
}
try {
await setAccount({
@@ -316,7 +294,7 @@ const AdvancedSettings = () => {
blockchain providers:
</span>
<span className={styles.categorySettings}>
<BlockchainProvidersSettings ethRpcRef={ethRpcRef} solRpcRef={solRpcRef} />
<BlockchainProvidersSettings ethRpcRef={ethRpcRef} />
</span>
</div>
<div className={styles.category}>