Fix issues in Contract Development view (#5555)

* Better errors in contract dev

* Use RAW Git instead of Github Raw URLs (better CORS support)

* Network first for Solc list

* Don't use importScript n Worker // update rawgit to use CDN
This commit is contained in:
Nicolas Gotchac
2017-05-05 10:00:16 +02:00
committed by Jaco Greeff
parent 951dc757f8
commit eb316fcb9c
5 changed files with 59 additions and 49 deletions

View File

@@ -52,21 +52,9 @@ export default class SolidityUtils {
static getCompiler (build) {
const { longVersion, path } = build;
const URL = `https://raw.githubusercontent.com/ethereum/solc-bin/gh-pages/bin/${path}`;
const URL = `https://cdn.rawgit.com/ethereum/solc-bin/gh-pages/bin/${path}`;
const isWorker = typeof window !== 'object';
if (isWorker) {
return new Promise((resolve, reject) => {
self.importScripts(URL);
setTimeout(() => {
const compiler = solc(self.Module);
return resolve(compiler);
}, 50);
});
}
return fetch(URL)
.then((r) => r.text())
.then((code) => {