on master help sign in
fix: rename averageGasPrice to suggestedGasPrice
commit029c993a9201717b885612f9e0d967b5f1402a03 authorMatt Condon (shrugs) <mattgcondon@gmail.com> dateWed 17 Jul 2019, 16:02 (7 years ago) parenta850d7f
1 file changed+6−6
src/lib/useEthereumTransaction.js+6−6
src/lib/useEthereumTransaction.js+6−6
@@ -47,7 +47,7 @@ export default function useEthereumTransaction(
4747 const [chainId, setChainId] = useState();
4848 const [nonce, setNonce] = useState();
4949 const [gasPrice, setGasPrice] = useState(initialGasPrice); // gwei
50− const [averageGasPrice, setAverageGasPrice] = useState(gasPrice); // gwei
50+ const [suggestedGasPrice, setSuggestedGasPrice] = useState(gasPrice); // gwei
5151 const [gasLimit] = useState(initialGasLimit);
5252 const [unsignedTransaction, setUnsignedTransaction] = useState();
5353 const [signedTransaction, setSignedTransaction] = useState();
@@ -132,14 +132,14 @@ export default function useEthereumTransaction(
132132 setUnsignedTransaction(undefined);
133133 setTxHash(undefined);
134134 setSignedTransaction(undefined);
135− setGasPrice(averageGasPrice);
135+ setGasPrice(suggestedGasPrice);
136136 setState(STATE.NONE);
137137 setError(undefined);
138− }, [averageGasPrice, setError]);
138+ }, [suggestedGasPrice, setError]);
139139
140− const resetGasPrice = useCallback(() => setGasPrice(averageGasPrice), [
140+ const resetGasPrice = useCallback(() => setGasPrice(suggestedGasPrice), [
141141 setGasPrice,
142− averageGasPrice,
142+ suggestedGasPrice,
143143 ]);
144144
145145 useLifecycle(() => {
@@ -155,7 +155,7 @@ export default function useEthereumTransaction(
155155 setNonce(nonce);
156156 setChainId(chainId);
157157 const gasPrice = parseInt(fromWei(estimatedGasPrice, 'gwei'), 10);
158− setAverageGasPrice(gasPrice);
158+ setSuggestedGasPrice(gasPrice);
159159 setGasPrice(gasPrice);
160160 } catch (error) {
161161 setError(error);