Skip to content

Commit 1f63933

Browse files
authored
Merge pull request #6109 from ethereum/vyper-playbtn-fix
Fix vyper compilation from play button
2 parents 43c3791 + 2230afe commit 1f63933

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

apps/remix-ide/src/app/plugins/templates-selection/templates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export const templates = (intl: any, plugin: any): TemplateGroup[] => {
268268
tooltip: "Cookbook is a Smart Contract Search Tool. Click here to open Cookbook and browse Contracts.",
269269
onClick: async () => {
270270
await plugin.call('manager', 'activatePlugin', 'cookbookdev')
271-
plugin.call('menuicons', 'showContent', 'cookbookdev')
271+
await plugin.call('menuicons', 'showContent', 'cookbookdev')
272272
},
273273
onClickLabel: 'Open Cookbook Plugin',
274274
description: 'Discover more templates!',

apps/vyper/src/app/utils/compiler.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,8 @@ export async function compile(url: string, contract: Contract): Promise<VyperCom
8282
[contractName] : { content : contract.content }
8383
}
8484
}
85-
console.log('compilePackage', `${url}compile`)
86-
let response = await axios.post(`${url}compile`, compilePackage )
8785

86+
let response = await axios.post(`${url.endsWith('/') ? url + 'compile' : url + '/compile'}`, compilePackage )
8887
if (response.status === 404) {
8988
throw new Error(`Vyper compiler not found at "${url}".`)
9089
}
@@ -97,17 +96,17 @@ console.log('compilePackage', `${url}compile`)
9796
response = null
9897
let result: any
9998

100-
const status = await (await axios.get(url + 'status/' + compileCode , {
99+
const status = await (await axios.get(`${url.endsWith('/') ? url + 'status/' : url + '/status/'}`+ compileCode , {
101100
method: 'Get'
102101
})).data
103102
if (status === 'SUCCESS') {
104-
result = await(await axios.get(url + 'artifacts/' + compileCode , {
103+
result = await(await axios.get(`${url.endsWith('/') ? url + 'artifacts/' : url + '/artifacts/'}` + compileCode , {
105104
method: 'Get'
106105
})).data
107106

108107
return result
109108
} else if (status === 'FAILED') {
110-
const intermediate = await(await axios.get(url + 'exceptions/' + compileCode , {
109+
const intermediate = await(await axios.get(`${url.endsWith('/') ? url + 'exceptions/' : url + '/exceptions/'}` + compileCode , {
111110
method: 'Get'
112111
})).data
113112
return intermediate
@@ -189,7 +188,7 @@ export async function compileContract(contract: string, compilerUrl: string, set
189188
title: 'Compiling'
190189
})
191190
// try {
192-
let output = await compile(compilerUrl, _contract)
191+
const output = await compile(compilerUrl, _contract)
193192
if (output && output[0] && output[0].status === 'failed') {
194193
remixClient.changeStatus({
195194
key: 'failed',

0 commit comments

Comments
 (0)