mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Dont default gas limit in gas popover when non is available on transaction params (#11872)
* Dont default gas limit when non is available on transaction params * Fix unit tests
This commit is contained in:
parent
d1d6f0531e
commit
05fa7961f1
@ -229,7 +229,7 @@ export function useGasFeeInputs(
|
|||||||
initialGasPrice && initialFeeParamsAreCustom ? initialGasPrice : null,
|
initialGasPrice && initialFeeParamsAreCustom ? initialGasPrice : null,
|
||||||
);
|
);
|
||||||
const [gasLimit, setGasLimit] = useState(
|
const [gasLimit, setGasLimit] = useState(
|
||||||
Number(hexToDecimal(transaction?.txParams?.gas ?? minimumGasLimit)),
|
Number(hexToDecimal(transaction?.txParams?.gas ?? '0x0')),
|
||||||
);
|
);
|
||||||
|
|
||||||
const userPrefersAdvancedGas = useSelector(getAdvancedInlineGasShown);
|
const userPrefersAdvancedGas = useSelector(getAdvancedInlineGasShown);
|
||||||
|
@ -323,7 +323,12 @@ describe('useGasFeeInputs', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return true', () => {
|
it('should return true', () => {
|
||||||
const { result } = renderHook(() => useGasFeeInputs());
|
const { result } = renderHook(() =>
|
||||||
|
useGasFeeInputs(null, {
|
||||||
|
userFeeLevel: 'medium',
|
||||||
|
txParams: { gas: '0x5208' },
|
||||||
|
}),
|
||||||
|
);
|
||||||
expect(result.current.balanceError).toBe(true);
|
expect(result.current.balanceError).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user