1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Fix for wrong type being assigned to the transaction (#18818)

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
This commit is contained in:
Jyoti Puri 2023-04-27 10:16:36 +05:30 committed by GitHub
parent 17e17e83cc
commit e0919d529e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View File

@ -1983,6 +1983,10 @@ export default class MetamaskController extends EventEmitter {
this.networkController.upsertNetworkConfiguration.bind(
this.networkController,
),
getCurrentNetworkEIP1559Compatibility:
this.networkController.getEIP1559Compatibility.bind(
this.networkController,
),
// PreferencesController
setSelectedAddress: preferencesController.setSelectedAddress.bind(
preferencesController,

View File

@ -55,6 +55,7 @@ import {
showModal,
addUnapprovedTransactionAndRouteToConfirmationPage,
updateTransactionSendFlowHistory,
getCurrentNetworkEIP1559Compatibility,
} from '../../store/actions';
import { setCustomGasLimit } from '../gas/gas.duck';
import {
@ -589,7 +590,10 @@ export const initializeSendState = createAsyncThunk(
const state = thunkApi.getState();
const isNonStandardEthChain = getIsNonStandardEthChain(state);
const chainId = getCurrentChainId(state);
const eip1559support = checkNetworkAndAccountSupports1559(state);
let eip1559support = checkNetworkAndAccountSupports1559(state);
if (eip1559support === undefined) {
eip1559support = await getCurrentNetworkEIP1559Compatibility();
}
const account = getSelectedAccount(state);
const { send: sendState, metamask } = state;
const draftTransaction =

View File

@ -4650,3 +4650,17 @@ export function requestUserApproval({
}
};
}
export async function getCurrentNetworkEIP1559Compatibility(): Promise<
boolean | undefined
> {
let networkEIP1559Compatibility;
try {
networkEIP1559Compatibility = await submitRequestToBackground<boolean>(
'getCurrentNetworkEIP1559Compatibility',
);
} catch (error) {
console.error(error);
}
return networkEIP1559Compatibility;
}