Unverified Commit 05522ac0 authored by David Zagi's avatar David Zagi Committed by GitHub

Merge branch 'master' into remixd_terminal

parents 9d7f0445 7a7b733b
...@@ -209,7 +209,7 @@ module.exports = { ...@@ -209,7 +209,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n154', 60000) .waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n154', 60000)
}, },
'Should start debugging using remix debug nodes (rinkeby)': function (browser: NightwatchBrowser) { 'Should start debugging using remix debug nodes (rinkeby)': '' + function (browser: NightwatchBrowser) {
browser browser
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.setSolidityCompilerVersion('soljson-v0.8.4+commit.c7e474f2.js') .setSolidityCompilerVersion('soljson-v0.8.4+commit.c7e474f2.js')
......
...@@ -19,7 +19,7 @@ class Blockchain { ...@@ -19,7 +19,7 @@ class Blockchain {
this.events = new EventEmitter() this.events = new EventEmitter()
this.config = config this.config = config
const web3Runner = new TxRunnerWeb3({ const web3Runner = new TxRunnerWeb3({
config: config, config: this.config,
detectNetwork: (cb) => { detectNetwork: (cb) => {
this.executionContext.detectNetwork(cb) this.executionContext.detectNetwork(cb)
}, },
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
"ethereumjs-util": "^7.0.10", "ethereumjs-util": "^7.0.10",
"ethers": "^5.4.2", "ethers": "^5.4.2",
"string-similarity": "^4.0.4", "string-similarity": "^4.0.4",
"web3": "1.2.4" "web3": "^1.5.1"
}, },
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
"tape": "^4.10.1", "tape": "^4.10.1",
"ts-node": "^8.0.3", "ts-node": "^8.0.3",
"typescript": "^3.4.3", "typescript": "^3.4.3",
"web3": "1.2.4" "web3": "^1.5.1"
}, },
"devDependencies": { "devDependencies": {
"tap-spec": "^5.0.0" "tap-spec": "^5.0.0"
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
"ethereumjs-util": "^7.0.10", "ethereumjs-util": "^7.0.10",
"ethers": "^5.4.2", "ethers": "^5.4.2",
"string-similarity": "^4.0.4", "string-similarity": "^4.0.4",
"web3": "^1.2.4" "web3": "^1.5.1"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.4.5", "@babel/core": "^7.4.5",
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
"events": "^3.0.0", "events": "^3.0.0",
"solc": "^0.7.4", "solc": "^0.7.4",
"string-similarity": "^4.0.4", "string-similarity": "^4.0.4",
"web3": "^1.2.4" "web3": "^1.5.1"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.4.5", "@babel/core": "^7.4.5",
......
...@@ -15,15 +15,20 @@ export class TxRunnerWeb3 { ...@@ -15,15 +15,20 @@ export class TxRunnerWeb3 {
this._api = api this._api = api
} }
_executeTx (tx, txFee, api, promptCb, callback) { _executeTx (tx, network, txFee, api, promptCb, callback) {
if (network && network.lastBlock && network.lastBlock.baseFeePerGas) {
// the sending stack (web3.js / metamask need to have the type defined)
// this is to avoid the following issue: https://github.com/MetaMask/metamask-extension/issues/11824
tx.type = '0x2'
}
if (txFee) { if (txFee) {
if (txFee.baseFeePerGas) { if (txFee.baseFeePerGas) {
tx.maxPriorityFee = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.maxPriorityFee, 'gwei')) tx.maxPriorityFeePerGas = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.maxPriorityFee, 'gwei'))
tx.maxFee = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.maxFee, 'gwei')) tx.maxFeePerGas = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.maxFee, 'gwei'))
tx.type = 2 tx.type = '0x2'
} else { } else {
tx.gasPrice = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.gasPrice, 'gwei')) tx.gasPrice = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.gasPrice, 'gwei'))
tx.type = 1 tx.type = '0x1'
} }
} }
...@@ -100,18 +105,18 @@ export class TxRunnerWeb3 { ...@@ -100,18 +105,18 @@ export class TxRunnerWeb3 {
// callback is called whenever no error // callback is called whenever no error
tx['gas'] = !gasEstimation ? gasLimit : gasEstimation tx['gas'] = !gasEstimation ? gasLimit : gasEstimation
if (this._api.config.getUnpersistedProperty('doNotShowTransactionConfirmationAgain')) {
return this._executeTx(tx, null, this._api, promptCb, callback)
}
this._api.detectNetwork((err, network) => { this._api.detectNetwork((err, network) => {
if (err) { if (err) {
console.log(err) console.log(err)
return return
} }
if (this._api.config.getUnpersistedProperty('doNotShowTransactionConfirmationAgain')) {
return this._executeTx(tx, network, null, this._api, promptCb, callback)
}
confirmCb(network, tx, tx['gas'], (txFee) => { confirmCb(network, tx, tx['gas'], (txFee) => {
return this._executeTx(tx, txFee, this._api, promptCb, callback) return this._executeTx(tx, network, txFee, this._api, promptCb, callback)
}, (error) => { }, (error) => {
callback(error) callback(error)
}) })
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"merge": "^1.2.0", "merge": "^1.2.0",
"string-similarity": "^4.0.4", "string-similarity": "^4.0.4",
"time-stamp": "^2.0.0", "time-stamp": "^2.0.0",
"web3": "^1.2.4" "web3": "^1.5.1"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.4.5", "@babel/core": "^7.4.5",
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
"ethers": "^5.4.2", "ethers": "^5.4.2",
"solc": "^0.7.4", "solc": "^0.7.4",
"string-similarity": "^4.0.4", "string-similarity": "^4.0.4",
"web3": "1.2.4", "web3": "^1.5.1",
"webworkify-webpack": "^2.1.5" "webworkify-webpack": "^2.1.5"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -22,7 +22,13 @@ export function urlFromVersion (version) { ...@@ -22,7 +22,13 @@ export function urlFromVersion (version) {
* checks a compiler whitelist, browser support and OS. * checks a compiler whitelist, browser support and OS.
*/ */
export function canUseWorker (selectedVersion) { export function canUseWorker (selectedVersion) {
if (selectedVersion.startsWith('http')) {
return browserSupportWorker()
}
const version = semver.coerce(selectedVersion) const version = semver.coerce(selectedVersion)
if (!version) {
return browserSupportWorker()
}
const isNightly = selectedVersion.includes('nightly') const isNightly = selectedVersion.includes('nightly')
return browserSupportWorker() && ( return browserSupportWorker() && (
// All compiler versions (including nightlies) after 0.6.3 are wasm compiled // All compiler versions (including nightlies) after 0.6.3 are wasm compiled
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
"string-similarity": "^4.0.4", "string-similarity": "^4.0.4",
"time-stamp": "^2.2.0", "time-stamp": "^2.2.0",
"tslib": "^2.3.0", "tslib": "^2.3.0",
"web3": "^1.2.4", "web3": "^1.5.1",
"winston": "^3.0.0" "winston": "^3.0.0"
}, },
"peerDependencies": { "peerDependencies": {
......
...@@ -138,7 +138,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { ...@@ -138,7 +138,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
// fetching both normal and wasm builds and creating a [version, baseUrl] map // fetching both normal and wasm builds and creating a [version, baseUrl] map
const fetchAllVersion = async (callback) => { const fetchAllVersion = async (callback) => {
let selectedVersion, allVersionsWasm, isURL let selectedVersion, allVersionsWasm, isURL
let allVersions = [{ path: 'builtin', longVersion: 'latest local version - 0.7.4' }] let allVersions = [{ path: 'builtin', longVersion: 'latest local version - ' + state.defaultVersion }]
// fetch normal builds // fetch normal builds
const binRes: any = await promisedMiniXhr(`${baseURLBin}/list.json`) const binRes: any = await promisedMiniXhr(`${baseURLBin}/list.json`)
// fetch wasm builds // fetch wasm builds
...@@ -350,6 +350,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { ...@@ -350,6 +350,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
// Workers cannot load js on "file:"-URLs and we get a // Workers cannot load js on "file:"-URLs and we get a
// "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium, // "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium,
// resort to non-worker version in that case. // resort to non-worker version in that case.
if (selectedVersion === 'builtin') selectedVersion = state.defaultVersion
if (selectedVersion !== 'builtin' && canUseWorker(selectedVersion)) { if (selectedVersion !== 'builtin' && canUseWorker(selectedVersion)) {
compileTabLogic.compiler.loadVersion(true, url) compileTabLogic.compiler.loadVersion(true, url)
} else { } else {
......
This diff is collapsed.
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
"string-similarity": "^4.0.4", "string-similarity": "^4.0.4",
"time-stamp": "^2.2.0", "time-stamp": "^2.2.0",
"tslib": "^2.3.0", "tslib": "^2.3.0",
"web3": "1.2.4", "web3": "^1.5.1",
"winston": "^3.3.3", "winston": "^3.3.3",
"ws": "^7.3.0" "ws": "^7.3.0"
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment