Fix gas limit estimation for metamask & bump gas limit for self-withdrawal without relayer to 20%
This commit is contained in:
parent
6137e1328a
commit
334412c803
@ -553,7 +553,7 @@ const actions = {
|
|||||||
|
|
||||||
const callParams = {
|
const callParams = {
|
||||||
method: 'eth_sendTransaction',
|
method: 'eth_sendTransaction',
|
||||||
params: Object.assign({ gasLimit }, incompletedTx),
|
params: Object.assign({ gas: numberToHex(gasLimit) }, incompletedTx),
|
||||||
watcherParams: {
|
watcherParams: {
|
||||||
title: { path: 'depositing', amount, currency },
|
title: { path: 'depositing', amount, currency },
|
||||||
successTitle: {
|
successTitle: {
|
||||||
@ -763,7 +763,7 @@ const actions = {
|
|||||||
throw new Error(e.message)
|
throw new Error(e.message)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async withdraw({ state, rootState, dispatch, getters }, { note }) {
|
async withdraw({ state, rootState, rootGetters, dispatch, getters }, { note }) {
|
||||||
try {
|
try {
|
||||||
const [, currency, amount, netId] = note.split('-')
|
const [, currency, amount, netId] = note.split('-')
|
||||||
const config = networkConfig[`netId${netId}`]
|
const config = networkConfig[`netId${netId}`]
|
||||||
@ -779,13 +779,14 @@ const actions = {
|
|||||||
const incompletedTx = {
|
const incompletedTx = {
|
||||||
data,
|
data,
|
||||||
value: args[5],
|
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 = {
|
const callParams = {
|
||||||
method: 'eth_sendTransaction',
|
method: 'eth_sendTransaction',
|
||||||
params: Object.assign({ gasLimit }, incompletedTx),
|
params: Object.assign({ gas: numberToHex(gasLimit) }, incompletedTx),
|
||||||
watcherParams: {
|
watcherParams: {
|
||||||
title: { path: 'withdrawing', amount, currency },
|
title: { path: 'withdrawing', amount, currency },
|
||||||
successTitle: {
|
successTitle: {
|
||||||
|
Loading…
Reference in New Issue
Block a user