Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve send slice tests #11091

Merged
merged 4 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/ducks/send/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ const slice = createSlice({
// updateGasPrice to also tap into the appropriate follow up checks
// and gasTotal calculation.
slice.caseReducers.updateGasPrice(state, {
payload: getGasPriceInHexWei(action.value.average ?? '0x0'), // TODO: Is this more correct?
payload: getGasPriceInHexWei(action.value.average ?? '0x0'),
});
})
.addCase(BASIC_GAS_ESTIMATE_STATUS, (state, action) => {
Expand Down
2 changes: 1 addition & 1 deletion ui/ducks/send/send.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ describe('Send Slice', () => {
expect(result.recipient.error).toStrictEqual('invalidAddressRecipient');
});

// TODO: This seems off, is this suppose to be a networks that dont implement checksum? But the user input is not valid hex in the first place.
// TODO: Expectation might change in the future
tmashuang marked this conversation as resolved.
Show resolved Hide resolved
it('should error with an invalid network error when user input is not a valid hex string on a non default network', () => {
const tokenAssetTypeState = {
...initialState,
Expand Down
2 changes: 1 addition & 1 deletion ui/selectors/custom-gas.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export function getRenderableEstimateDataForSmallButtonsFromGWEI(state) {
const isMainnet = getIsMainnet(state);
const showFiat = isMainnet || Boolean(showFiatInTestnets);
const gasLimit =
state.send.gas.gasLimit || getCustomGasLimit(state) || '0x5208'; // Should the first conditional be state.send.gas.gasLimit ?
state.send.gas.gasLimit || getCustomGasLimit(state) || '0x5208';
const { conversionRate } = state.metamask;
const currentCurrency = getCurrentCurrency(state);
const {
Expand Down
2 changes: 0 additions & 2 deletions ui/selectors/custom-gas.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ describe('custom-gas selectors', () => {
expect(isCustomPriceExcessive(mockState)).toStrictEqual(true);
});
it('should return false gas.basicEstimates.price 0x28bed01600 (175) (checkSend=true)', () => {
// Inconsistent state from the selectors? ui/ducks/send/send.js3L1117
// Is there suppose to be a send[gas]?
const mockState = {
send: {
gas: {
Expand Down