Skip to content

Commit

Permalink
fox: Importing withdrawal from network provider (#395)
Browse files Browse the repository at this point in the history
* fox: Importing withdrawal from network provider

* fix: Tests
  • Loading branch information
LautaroPetaccio authored Jan 7, 2025
1 parent f37f833 commit e22413a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/modules/mana/sagas.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChainId, Network } from '@dcl/schemas'
import { call, select } from '@redux-saga/core/effects'
import { getChainIdByNetwork, getNetworkProvider } from 'decentraland-dapps/dist/lib/eth'
import { getChainIdByNetwork, getNetworkProvider, getNetworkWeb3Provider } from 'decentraland-dapps/dist/lib/eth'
import { fetchTransactionRequest } from 'decentraland-dapps/dist/modules/transaction/actions'
import { getAddress } from 'decentraland-dapps/dist/modules/wallet/selectors'
import { expectSaga } from 'redux-saga-test-plan'
Expand Down Expand Up @@ -100,7 +100,8 @@ describe('handleImportWithdrawalRequest', () => {
[select(getAddress), address],
[call(getChainIdByNetwork, network), chainId],
[call(getMaticPOSClient), maticPOSClient],
[call(getNetworkProvider, chainId), networkProvider]
[call(getNetworkProvider, chainId), networkProvider],
[call(getNetworkWeb3Provider, chainId), networkProvider]
])

expectedActions.forEach(ea => (test = test.put(ea)))
Expand Down
10 changes: 8 additions & 2 deletions src/modules/mana/sagas.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { ChainId, Network } from '@dcl/schemas'
import { ITransactionWriteResult, POSClient, setProofApi, use } from '@maticnetwork/maticjs'
import { Web3ClientPlugin } from '@maticnetwork/maticjs-ethers'
import { getChainIdByNetwork, getConnectedProvider, getNetworkProvider, getSigner } from 'decentraland-dapps/dist/lib/eth'
import {
getChainIdByNetwork,
getConnectedProvider,
getNetworkProvider,
getNetworkWeb3Provider,
getSigner
} from 'decentraland-dapps/dist/lib/eth'
import { closeModal, openModal } from 'decentraland-dapps/dist/modules/modal/actions'
import {
FETCH_TRANSACTION_SUCCESS,
Expand Down Expand Up @@ -410,7 +416,7 @@ export function* handleImportWithdrawalRequest(action: ImportWithdrawalRequestAc
}

const chainId: ChainId = yield call(getChainIdByNetwork, Network.MATIC)
const provider: Provider = yield call(getNetworkProvider, chainId)
const provider: Provider = yield call(getNetworkWeb3Provider, chainId)

const transaction: { input: string; from: string } | undefined = yield call([provider, 'send'], 'eth_getTransactionByHash', [txHash])

Expand Down

0 comments on commit e22413a

Please sign in to comment.