Skip to content

Commit

Permalink
feat: don't initialize ethersProvider in module scope
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre committed Feb 15, 2024
1 parent 98ed008 commit 4565503
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/state/slices/opportunitiesSlice/resolvers/uniV2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ import type {
} from '../types'
import { calculateAPRFromToken0 } from './utils'

const ethersProvider = getEthersProvider()

let _blockNumber: number | null = null
const getBlockNumber = async () => {
const ethersProvider = getEthersProvider()
if (_blockNumber) return _blockNumber
const blockNumber = await ethersProvider.getBlockNumber()
_blockNumber = blockNumber
Expand Down

0 comments on commit 4565503

Please sign in to comment.