From e5e780e57c17158e7a1c577238f6e52119b9762e Mon Sep 17 00:00:00 2001 From: ronaldsg Date: Wed, 4 Dec 2024 13:06:41 -0500 Subject: [PATCH] Fix provider definition on the flyoverservice instance on pegout --- src/pegout/store/FlyoverPegout/actions.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pegout/store/FlyoverPegout/actions.ts b/src/pegout/store/FlyoverPegout/actions.ts index af1e28ba..b04287f2 100644 --- a/src/pegout/store/FlyoverPegout/actions.ts +++ b/src/pegout/store/FlyoverPegout/actions.ts @@ -8,10 +8,14 @@ import { BridgeService } from '@/common/services/BridgeService'; import { promiseWithTimeout } from '@/common/utils'; import { ApiService } from '@/common/services'; import { EnvironmentAccessorService } from '@/common/services/enviroment-accessor.service'; +import { providers } from 'ethers'; export const actions: ActionTree = { - [constants.FLYOVER_PEGOUT_INIT]: async ({ state, dispatch }) => new Promise((resolve, reject) => { - state.flyoverService.initialize() + [constants.FLYOVER_PEGOUT_INIT]: async ( + { state, dispatch }, + provider: providers.Web3Provider, + ) => new Promise((resolve, reject) => { + state.flyoverService.initialize(provider.provider) .then(() => dispatch(constants.FLYOVER_PEGOUT_GET_PROVIDERS)) .then(resolve) .catch(reject); @@ -27,12 +31,12 @@ export const actions: ActionTree = { }; (async () => { try { - const providers: LiquidityProvider2WP[] = await promiseWithTimeout( + const liquidityProviders: LiquidityProvider2WP[] = await promiseWithTimeout( state.flyoverService.getProviders(), EnvironmentAccessorService.getEnvironmentVariables().flyoverGetProvidersTimeout, ); result = constants.FlyoverCallResult.SUCCESS; - resolve(commit(constants.FLYOVER_PEGOUT_SET_PROVIDERS, providers)); + resolve(commit(constants.FLYOVER_PEGOUT_SET_PROVIDERS, liquidityProviders)); } catch (e) { reject(new Error('Error getting providers')); } finally {