From f5e57b6f9d271a4bf60a568a4d6552b7e7730095 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Tue, 22 Nov 2022 10:45:02 +0100 Subject: [PATCH] arrange evm and cater for berlin positionally --- .../solidity-compiler/src/lib/compiler-container.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 7c35e1cda0..6ed3150222 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -22,6 +22,15 @@ declare global { const _paq = window._paq = window._paq || [] //eslint-disable-line +function reorderEvms (evmVersions: string[], newEvms: string[]): string[] { + evmVersions.forEach(evm => { + if (evm === 'london') newEvms[1] = evm + else if (evm === 'berlin') newEvms[2] = evm + else newEvms.push(evm) + }) + return newEvms +} + export const CompilerContainer = (props: CompilerContainerProps) => { const { api, @@ -67,6 +76,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { const [hhCompilation, sethhCompilation] = useState(false) const [truffleCompilation, setTruffleCompilation] = useState(false) const [compilerContainer, dispatch] = useReducer(compilerReducer, compilerInitialState) + const [evmVersions] = useState>(reorderEvms(compileTabLogic.evmVersions, [])) const intl = useIntl() @@ -871,7 +881,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {