on master help sign in
constants: bump max gas price to 80 gwei
commitfd8159860207cc696af2b39f56d5736d9cc729bb authorFang <git@fang.io> dateTue 21 Jul 2020, 00:10 (6 years ago) parent404f794
2 files changed+5−3
src/lib/constants.js+2 src/lib/getSuggestedGasPrice.js+3−3
src/lib/constants.js+2
@@ -2,6 +2,7 @@ import { isDevelopment } from './flags';
22
33const CHECK_BLOCK_EVERY_MS = isDevelopment ? 1000 : 10000;
44const DEFAULT_GAS_PRICE_GWEI = 40;
5+const MAX_GAS_PRICE_GWEI = 80;
56
67const MIN_GALAXY = 0;
78const MAX_GALAXY = 255;
@@ -74,6 +75,7 @@ const PROGRESS_ANIMATION_DELAY_MS = 500; // .animated-width
7475export {
7576 CHECK_BLOCK_EVERY_MS,
7677 DEFAULT_GAS_PRICE_GWEI,
78+ MAX_GAS_PRICE_GWEI,
7779 GAS_LIMITS,
7880 GEN_STATES,
7981 BUTTON_STATES,
src/lib/getSuggestedGasPrice.js+3−3
@@ -1,5 +1,5 @@
11import { NETWORK_TYPES } from './network';
2−import { DEFAULT_GAS_PRICE_GWEI } from './constants';
2+import { DEFAULT_GAS_PRICE_GWEI, MAX_GAS_PRICE_GWEI } from './constants';
33
44export default async function getSuggestedGasPrice(networkType) {
55 switch (networkType) {
@@ -24,8 +24,8 @@ export default async function getSuggestedGasPrice(networkType) {
2424 // more than gwei. see: https://docs.ethgasstation.info
2525 const suggestedGasPrice = Math.ceil(json.fast / 10); // to gwei
2626
27− // we don't want to charge users more than our default gwei
28− return Math.min(suggestedGasPrice, DEFAULT_GAS_PRICE_GWEI);
27+ // we don't want to charge users more than the gas tank funds
28+ return Math.min(suggestedGasPrice, MAX_GAS_PRICE_GWEI);
2929 } catch (e) {
3030 return DEFAULT_GAS_PRICE_GWEI;
3131 }