@ -7,8 +7,15 @@ export const baseURLWasm = 'https://solc-bin.ethereum.org/wasm'
export const pathToURL = { }
export const pathToURL = { }
// retrieves the URL of the given compiler version
/ * *
export function urlFromVersion ( version ) {
* Retrieves the URL of the given compiler version
* @ param version is the version of compiler with or without 'soljson-v' prefix and . js postfix
* /
export function urlFromVersion ( version ) { // 0x959371506b8f6223d71c709ac2eb2d0158104dca2d76ca949f1662712cf0e6db
console . log ( "1. orig_________= " + version + " path =" , pathToURL , " version =" , version , " and url is = " , pathToURL [ version ] )
if ( version . substr ( 0 , 9 ) !== 'soljson-v' ) version = 'soljson-v' + version
if ( version . substr ( version . length - 3 , version . length ) !== '.js' ) version = version + '.js;'
console . log ( "2. orig_________= " + version + " path =" , pathToURL , " version =" , version , " and url is = " , pathToURL [ version ] )
return ` ${ pathToURL [ version ] } / ${ version } `
return ` ${ pathToURL [ version ] } / ${ version } `
}
}
@ -29,7 +36,7 @@ function browserSupportWorker () {
return document . location . protocol !== 'file:' && Worker !== undefined
return document . location . protocol !== 'file:' && Worker !== undefined
}
}
// returns a promic e for minixhr
// returns a promis e for minixhr
export function promisedMiniXhr ( url ) {
export function promisedMiniXhr ( url ) {
return new Promise ( ( resolve , reject ) => {
return new Promise ( ( resolve , reject ) => {
minixhr ( url , ( json , event ) => {
minixhr ( url , ( json , event ) => {