Compare commits

..

3 Commits

2 changed files with 9 additions and 7 deletions

@ -553,7 +553,7 @@ const actions = {
const callParams = {
method: 'eth_sendTransaction',
params: Object.assign({ gasLimit }, incompletedTx),
params: Object.assign({ gas: numberToHex(gasLimit) }, incompletedTx),
watcherParams: {
title: { path: 'depositing', amount, currency },
successTitle: {
@ -672,7 +672,7 @@ const actions = {
const nativeCurrency = rootGetters['metamask/nativeCurrency']
const withdrawType = state.withdrawType
const relayer = BigInt(rootState.relayer.selectedRelayer.address)
let relayer = BigInt(0)
let fee = BigInt(0)
let refund = BigInt(0)
@ -718,6 +718,7 @@ const actions = {
// Don't need to calculate or estimate relayer fee, so, return proof immediately
if (withdrawType !== 'relayer') return calculateSnarkProof()
relayer = BigInt(rootState.relayer.selectedRelayer.address)
fee = BigInt(rootState.fees.withdrawalFeeViaRelayer)
const naiveProof = await calculateSnarkProof()
if (Number(note.netId) === 1) return naiveProof // Don't need to smart-estimate fee if we use V4 withdrawal
@ -763,7 +764,7 @@ const actions = {
throw new Error(e.message)
}
},
async withdraw({ state, rootState, dispatch, getters }, { note }) {
async withdraw({ state, rootState, rootGetters, dispatch, getters }, { note }) {
try {
const [, currency, amount, netId] = note.split('-')
const config = networkConfig[`netId${netId}`]
@ -779,13 +780,14 @@ const actions = {
const incompletedTx = {
data,
value: args[5],
to: contractInstance._address
to: contractInstance._address,
from: ethAccount
}
const gasLimit = await rootGetters['fees/oracle'].getGasLimit(incompletedTx, 'user_withdrawal')
const gasLimit = await rootGetters['fees/oracle'].getGasLimit(incompletedTx, 'other', 20)
const callParams = {
method: 'eth_sendTransaction',
params: Object.assign({ gasLimit }, incompletedTx),
params: Object.assign({ gas: numberToHex(gasLimit) }, incompletedTx),
watcherParams: {
title: { path: 'withdrawing', amount, currency },
successTitle: {

@ -249,7 +249,7 @@ export const actions = {
const isUpdatedMajor = major === requiredMajor
if (prerelease) return false
return isUpdatedMajor && (Number(patch) >= 4 || netId !== 1) // Patch checking - also backwards compatibility for Mainnet
return isUpdatedMajor && (Number(patch) >= 5 || netId !== 1) // Patch checking - also backwards compatibility for Mainnet
}
if (!isRelayerUpdated()) {