on master help sign in
constants: bump max gas price to 80 gwei
fd81598Fang
src/lib/constants.js+2
@@ -2,6 +2,7 @@ import { isDevelopment } from './flags';
2
2
3const CHECK_BLOCK_EVERY_MS = isDevelopment ? 1000 : 10000;
3const CHECK_BLOCK_EVERY_MS = isDevelopment ? 1000 : 10000;
4const DEFAULT_GAS_PRICE_GWEI = 40;
4const DEFAULT_GAS_PRICE_GWEI = 40;
5+const MAX_GAS_PRICE_GWEI = 80;
5
6
6const MIN_GALAXY = 0;
7const MIN_GALAXY = 0;
7const MAX_GALAXY = 255;
8const MAX_GALAXY = 255;
@@ -74,6 +75,7 @@ const PROGRESS_ANIMATION_DELAY_MS = 500; // .animated-width
74export {
75export {
75 CHECK_BLOCK_EVERY_MS,
76 CHECK_BLOCK_EVERY_MS,
76 DEFAULT_GAS_PRICE_GWEI,
77 DEFAULT_GAS_PRICE_GWEI,
78+ MAX_GAS_PRICE_GWEI,
77 GAS_LIMITS,
79 GAS_LIMITS,
78 GEN_STATES,
80 GEN_STATES,
79 BUTTON_STATES,
81 BUTTON_STATES,
src/lib/getSuggestedGasPrice.js+3−3
@@ -1,5 +1,5 @@
1import { NETWORK_TYPES } from './network';
1import { NETWORK_TYPES } from './network';
2−import { DEFAULT_GAS_PRICE_GWEI } from './constants';
2+import { DEFAULT_GAS_PRICE_GWEI, MAX_GAS_PRICE_GWEI } from './constants';
3
3
4export default async function getSuggestedGasPrice(networkType) {
4export default async function getSuggestedGasPrice(networkType) {
5 switch (networkType) {
5 switch (networkType) {
@@ -24,8 +24,8 @@ export default async function getSuggestedGasPrice(networkType) {
24 // more than gwei. see: https://docs.ethgasstation.info
24 // more than gwei. see: https://docs.ethgasstation.info
25 const suggestedGasPrice = Math.ceil(json.fast / 10); // to gwei
25 const suggestedGasPrice = Math.ceil(json.fast / 10); // to gwei
26
26
27− // we don't want to charge users more than our default gwei
27+ // we don't want to charge users more than the gas tank funds
28− return Math.min(suggestedGasPrice, DEFAULT_GAS_PRICE_GWEI);
28+ return Math.min(suggestedGasPrice, MAX_GAS_PRICE_GWEI);
29 } catch (e) {
29 } catch (e) {
30 return DEFAULT_GAS_PRICE_GWEI;
30 return DEFAULT_GAS_PRICE_GWEI;
31 }
31 }