fix: handle auth and server error during swap (#593)
* fix: change execution order for light node upgrade * refactor: grab new configuration from post config request * fix: only print successful light node upgrade when it really happens * fix: log full desktop side swap error (#596) * refactor: try to make the auth error in swap nicer * refactor: make error instruction consistent * fix: avoid overwriting daiToSwap when it is set manually
This commit is contained in:
@@ -26,8 +26,8 @@ export async function getBzzPriceAsDai(desktopUrl: string): Promise<Token> {
|
||||
return DaiToken.fromDecimal(response.data)
|
||||
}
|
||||
|
||||
export async function upgradeToLightNode(desktopUrl: string, rpcProvider: string): Promise<void> {
|
||||
await updateDesktopConfiguration(desktopUrl, {
|
||||
export function upgradeToLightNode(desktopUrl: string, rpcProvider: string): Promise<BeeConfig> {
|
||||
return updateDesktopConfiguration(desktopUrl, {
|
||||
'swap-enable': true,
|
||||
'swap-endpoint': rpcProvider,
|
||||
})
|
||||
@@ -43,8 +43,8 @@ export function getDesktopConfiguration(desktopUrl: string): Promise<BeeConfig>
|
||||
return getJson(`${desktopUrl}/config`)
|
||||
}
|
||||
|
||||
async function updateDesktopConfiguration(desktopUrl: string, values: Record<string, unknown>): Promise<void> {
|
||||
await postJson(`${desktopUrl}/config`, values)
|
||||
function updateDesktopConfiguration(desktopUrl: string, values: Record<string, unknown>): Promise<BeeConfig> {
|
||||
return postJson(`${desktopUrl}/config`, values)
|
||||
}
|
||||
|
||||
export async function restartBeeNode(desktopUrl: string): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user