From 96b6e722d8fd86e83e0f9483a8ee2ba4a30daed0 Mon Sep 17 00:00:00 2001 From: Danil Kovtonyuk Date: Fri, 28 Jan 2022 16:45:36 +1000 Subject: [PATCH] fix: add optimism gas --- package.json | 2 +- src/config.js | 1 + src/constants.js | 1 + src/worker.js | 13 ++++++++++++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b4eef39..c3e994f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "relay", - "version": "5.0.0-beta.8", + "version": "5.0.0-beta.9", "description": "Relayer for Tornado.cash privacy solution. https://tornado.cash", "scripts": { "server": "node src/server.js", diff --git a/src/config.js b/src/config.js index b6b8e58..ec1fab5 100644 --- a/src/config.js +++ b/src/config.js @@ -23,6 +23,7 @@ module.exports = { gasPrices, gasLimits: { [jobType.TORNADO_WITHDRAW]: 390000, + [jobType.OP_TORNADO_WITHDRAW]: 440000, [jobType.ARB_TORNADO_WITHDRAW]: 1900000, }, proxyLight, diff --git a/src/constants.js b/src/constants.js index d39c480..01466c1 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,5 +1,6 @@ const jobType = Object.freeze({ TORNADO_WITHDRAW: 'TORNADO_WITHDRAW', + OP_TORNADO_WITHDRAW: 'OP_TORNADO_WITHDRAW', ARB_TORNADO_WITHDRAW: 'ARB_TORNADO_WITHDRAW', }) diff --git a/src/worker.js b/src/worker.js index bdc28e7..e5848be 100644 --- a/src/worker.js +++ b/src/worker.js @@ -55,7 +55,18 @@ function getGasPrices() { } 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] }