Skip to content

Commit

Permalink
fix: update swap-endpoint to blockchain-rpc-endpoint (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
rampall committed Oct 18, 2023
1 parent 8367f2b commit bce93ce
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/pages/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function SettingsPage(): ReactElement {
try {
setAndPersistJsonRpcProvider(value)

const shouldUpdateDesktop = isDesktop && (await getDesktopConfiguration(desktopUrl))['swap-endpoint']
const shouldUpdateDesktop = isDesktop && (await getDesktopConfiguration(desktopUrl))['blockchain-rpc-endpoint']

if (shouldUpdateDesktop) {
await setJsonRpcInDesktop(desktopUrl, value)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/status/SetupSteps/EthereumConnectionCheck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function EthereumConnectionCheck(): ReactElement | null {
Getblock
</a>
. By default, Bee expects a local node at http://localhost:8545. To use a provider instead, simply change
the <strong>swap-endpoint</strong> in your configuration file.
the <strong>blockchain-rpc-endpoint</strong> in your configuration file.
</>
)}
</ExpandableListItemNote>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/top-up/Swap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ export function Swap({ header }: Props): ReactElement {
)
}

if (!desktopConfiguration['swap-endpoint']) {
throw new SwapError('Swap endpoint is not configured in Swarm Desktop')
if (!desktopConfiguration['blockchain-rpc-endpoint']) {
throw new SwapError('Blockchain RPC endpoint is not configured in Swarm Desktop')
}
await wrapWithSwapError(
Rpc.getNetworkChainId(desktopConfiguration['swap-endpoint']),
`Swap endpoint not reachable at ${desktopConfiguration['swap-endpoint']}`,
Rpc.getNetworkChainId(desktopConfiguration['blockchain-rpc-endpoint']),
`Blockchain RPC endpoint not reachable at ${desktopConfiguration['blockchain-rpc-endpoint']}`,
)
await wrapWithSwapError(sendSwapRequest(daiToSwap), GENERIC_SWAP_FAILED_ERROR_MESSAGE)
}
Expand Down
6 changes: 3 additions & 3 deletions src/utils/desktop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface BeeConfig {
'resolver-options': string
'use-postage-snapshot': boolean
'data-dir': string
'swap-endpoint'?: string
'blockchain-rpc-endpoint'?: string
}

export async function getBzzPriceAsDai(desktopUrl: string): Promise<Token> {
Expand All @@ -29,13 +29,13 @@ export async function getBzzPriceAsDai(desktopUrl: string): Promise<Token> {
export function upgradeToLightNode(desktopUrl: string, rpcProvider: string): Promise<BeeConfig> {
return updateDesktopConfiguration(desktopUrl, {
'swap-enable': true,
'swap-endpoint': rpcProvider,
'blockchain-rpc-endpoint': rpcProvider,
})
}

export async function setJsonRpcInDesktop(desktopUrl: string, value: string): Promise<void> {
await updateDesktopConfiguration(desktopUrl, {
'swap-endpoint': value,
'blockchain-rpc-endpoint': value,
})
}

Expand Down

0 comments on commit bce93ce

Please sign in to comment.