From 68c3e07144f21507f286a5cadfc8a5e32ec78345 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Tue, 28 Nov 2023 14:28:43 +0100 Subject: [PATCH] change types to fit compile results --- .../src/app/components/CompilerButton.tsx | 3 +- apps/vyper/src/app/components/VyperResult.tsx | 1 + apps/vyper/src/app/utils/compiler.tsx | 52 +++++-------------- 3 files changed, 15 insertions(+), 41 deletions(-) diff --git a/apps/vyper/src/app/components/CompilerButton.tsx b/apps/vyper/src/app/components/CompilerButton.tsx index 9ae62e9394..59601a9dd2 100644 --- a/apps/vyper/src/app/components/CompilerButton.tsx +++ b/apps/vyper/src/app/components/CompilerButton.tsx @@ -44,6 +44,7 @@ function CompilerButton({contract, setOutput, compilerUrl, resetCompilerState}: setOutput(_contract.name, {status: 'failed', message: e.message}) return } + console.log({ output }) const compileReturnType = () => { const t: any = toStandardOutput(contract, output) const temp = _.merge(t['contracts'][contract]) @@ -110,7 +111,7 @@ function CompilerButton({contract, setOutput, compilerUrl, resetCompilerState}: remixClient.compilationFinish(_contract.name, _contract.content, data) //map data to compilation details shape - + remixClient.call('compilationDetails' as any, 'showDetails', data) } catch (err: any) { remixClient.changeStatus({ diff --git a/apps/vyper/src/app/components/VyperResult.tsx b/apps/vyper/src/app/components/VyperResult.tsx index 40f9e5a5a6..f82c4cea0e 100644 --- a/apps/vyper/src/app/components/VyperResult.tsx +++ b/apps/vyper/src/app/components/VyperResult.tsx @@ -26,6 +26,7 @@ type TabContentMembers = { } function VyperResult({ output, themeColor }: VyperResultProps) { + // const [active, setActive] = useState('abi') const [active, setActive] = useState('abi') if (!output) diff --git a/apps/vyper/src/app/utils/compiler.tsx b/apps/vyper/src/app/utils/compiler.tsx index 1bdef67f36..d29fa9dd00 100644 --- a/apps/vyper/src/app/utils/compiler.tsx +++ b/apps/vyper/src/app/utils/compiler.tsx @@ -51,7 +51,7 @@ export function normalizeContractPath(contractPath: string): string[] { * @param url The url of the compiler * @param contract The name and content of the contract */ -export async function compile(url: string, contract: Contract): Promise { +export async function compile(url: string, contract: Contract): Promise { if (!contract.name) { throw new Error('Set your Vyper contract file.') } @@ -69,41 +69,12 @@ export async function compile(url: string, contract: Contract): Promise setTimeout(() => resolve({}), 2000)) @@ -141,19 +113,19 @@ export async function compile(url: string, contract: Contract): Promise