feat: updated gasOracle library

This commit is contained in:
Pasha8914 2022-06-25 01:56:03 +10:00 committed by Danil Kovtonyuk
parent 9598f666fb
commit 6125b3b2af
No known key found for this signature in database
GPG key ID: E72A919BF08C3746
10 changed files with 52 additions and 331 deletions

View file

@ -166,7 +166,7 @@ const getters = {
return ACTION_GAS[action]
},
networkFee: (state, getters, rootState, rootGetters) => {
const gasPrice = rootGetters['gasPrices/fastGasPrice']
const gasPrice = rootGetters['gasPrices/gasPrice']
const networkFee = toBN(gasPrice).mul(toBN(getters.withdrawGas))
@ -554,7 +554,7 @@ const actions = {
storeName: `encrypted_events`
})
},
async sendDeposit({ state, rootState, getters, rootGetters, dispatch, commit }, { isEncrypted, gasPrice }) {
async sendDeposit({ state, rootState, getters, rootGetters, dispatch, commit }, { isEncrypted }) {
try {
const { commitment, note, prefix } = state
// eslint-disable-next-line prefer-const
@ -593,7 +593,6 @@ const actions = {
const callParams = {
method: 'eth_sendTransaction',
params: {
gasPrice,
to: contractInstance._address,
gas: numberToHex(gas + 50000),
value: numberToHex(value),
@ -961,7 +960,7 @@ const actions = {
},
calculateEthToReceive({ commit, state, rootGetters }, { currency }) {
const gasLimit = rootGetters['metamask/networkConfig'].tokens[currency].gasLimit
const gasPrice = toBN(rootGetters['gasPrices/fastGasPrice'])
const gasPrice = toBN(rootGetters['gasPrices/gasPrice'])
const ethToReceive = gasPrice
.mul(toBN(gasLimit))