From e748a32e181669621046f9f4a0385bec0c7498bd Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Sat, 11 Nov 2023 09:52:40 +0100 Subject: [PATCH] fixes for compile result mapping --- apps/vyper/src/app/components/CompilerButton.tsx | 2 ++ apps/vyper/src/app/components/VyperResult.tsx | 3 ++- apps/vyper/src/app/utils/compiler.tsx | 15 +++++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/apps/vyper/src/app/components/CompilerButton.tsx b/apps/vyper/src/app/components/CompilerButton.tsx index b85a356337..057323882f 100644 --- a/apps/vyper/src/app/components/CompilerButton.tsx +++ b/apps/vyper/src/app/components/CompilerButton.tsx @@ -36,7 +36,9 @@ function CompilerButton({contract, setOutput, compilerUrl, setCompilerResponse}: }) let output try { + console.log('calling comile endpoint now') output = await compile(compilerUrl, _contract) + console.log('output from compile endpoint', {output}) } catch (e: any) { setOutput(_contract.name, {status: 'failed', message: e.message}) return diff --git a/apps/vyper/src/app/components/VyperResult.tsx b/apps/vyper/src/app/components/VyperResult.tsx index d209246483..e6ad250d79 100644 --- a/apps/vyper/src/app/components/VyperResult.tsx +++ b/apps/vyper/src/app/components/VyperResult.tsx @@ -1,11 +1,12 @@ import React, {useState} from 'react' -import {VyperCompilationResult, VyperCompilationOutput, isCompilationError} from '../utils' +import {VyperCompilationOutput, isCompilationError} from '../utils' import Tabs from 'react-bootstrap/Tabs' import Tab from 'react-bootstrap/Tab' import Button from 'react-bootstrap/Button' import JSONTree from 'react-json-view' import { JsonView } from 'react-json-view-lite' import {CopyToClipboard} from '@remix-ui/clipboard' +import { VyperCompilationResult } from '../utils/types' interface VyperResultProps { output?: VyperCompilationOutput diff --git a/apps/vyper/src/app/utils/compiler.tsx b/apps/vyper/src/app/utils/compiler.tsx index e846ac2bfe..8b7c39bc73 100644 --- a/apps/vyper/src/app/utils/compiler.tsx +++ b/apps/vyper/src/app/utils/compiler.tsx @@ -1,5 +1,6 @@ import {CompilationResult, ABIDescription} from '@remixproject/plugin-api' import axios from 'axios' +import { VyperCompilationResultType } from './types' export interface Contract { name: string @@ -50,7 +51,7 @@ export function normalizeContractPath(contractPath: string): string[] { * @param contract The name and content of the contract */ export async function compile(url: string, contract: Contract): Promise { - + console.log('responding to call to comile') if (!contract.name) { throw new Error('Set your Vyper contract file.') } @@ -87,11 +88,13 @@ export async function compile(url: string, contract: Contract): Promise