fix: add optimism gas

This commit is contained in:
Danil Kovtonyuk 2022-01-28 16:45:36 +10:00 committed by Alexey Pertsev
parent 4a28d4646e
commit 96b6e722d8
4 changed files with 15 additions and 2 deletions

@ -1,6 +1,6 @@
{ {
"name": "relay", "name": "relay",
"version": "5.0.0-beta.8", "version": "5.0.0-beta.9",
"description": "Relayer for Tornado.cash privacy solution. https://tornado.cash", "description": "Relayer for Tornado.cash privacy solution. https://tornado.cash",
"scripts": { "scripts": {
"server": "node src/server.js", "server": "node src/server.js",

@ -23,6 +23,7 @@ module.exports = {
gasPrices, gasPrices,
gasLimits: { gasLimits: {
[jobType.TORNADO_WITHDRAW]: 390000, [jobType.TORNADO_WITHDRAW]: 390000,
[jobType.OP_TORNADO_WITHDRAW]: 440000,
[jobType.ARB_TORNADO_WITHDRAW]: 1900000, [jobType.ARB_TORNADO_WITHDRAW]: 1900000,
}, },
proxyLight, proxyLight,

@ -1,5 +1,6 @@
const jobType = Object.freeze({ const jobType = Object.freeze({
TORNADO_WITHDRAW: 'TORNADO_WITHDRAW', TORNADO_WITHDRAW: 'TORNADO_WITHDRAW',
OP_TORNADO_WITHDRAW: 'OP_TORNADO_WITHDRAW',
ARB_TORNADO_WITHDRAW: 'ARB_TORNADO_WITHDRAW', ARB_TORNADO_WITHDRAW: 'ARB_TORNADO_WITHDRAW',
}) })

@ -55,7 +55,18 @@ function getGasPrices() {
} }
function getGasLimit() { function getGasLimit() {
const action = Number(netId) === 42161 ? jobType.ARB_TORNADO_WITHDRAW : jobType.TORNADO_WITHDRAW let action
switch (Number(netId)) {
case 10:
action = jobType.OP_TORNADO_WITHDRAW
break
case 42161:
action = jobType.ARB_TORNADO_WITHDRAW
break
default:
action = jobType.TORNADO_WITHDRAW
}
return gasLimits[action] return gasLimits[action]
} }