CoinAlpha / gateway-api

Apache License 2.0
47 stars 25 forks source link

services/fees.js ethGasStationEnabled default value raises error #60

Closed james-hummingbot closed 3 years ago

james-hummingbot commented 3 years ago

https://github.com/CoinAlpha/gateway-api/blob/8100a1df86c7bc362b50459203bb1bbf58d95a70/src/services/fees.js#L10 This defaults it to false.

https://github.com/CoinAlpha/gateway-api/blob/8100a1df86c7bc362b50459203bb1bbf58d95a70/src/services/fees.js#L27 When ethGasStationEnabled is the default value false, the first condition fails, the second condition triggers an error because it is not a string and thus skips the else branch. The else branch would only be called if the user manually set the env var ENABLE_ETH_GAS_STATION to a string that isn't equal to true. Would it be better that the default value calls the else branch and sets this.ethGasPrice = ethManualGasPrice.

james-hummingbot commented 3 years ago

This issue is no longer necessary. We are rewriting everything in gateway-v2.