Skip to content

Commit

Permalink
Merge pull request #1478 from ethereum/fix_deploy_main_net_beta
Browse files Browse the repository at this point in the history
fix deploying, defining a correct type
  • Loading branch information
LianaHus authored Aug 13, 2021
2 parents e1489e6 + 169cf64 commit 6e78707
Show file tree
Hide file tree
Showing 11 changed files with 698 additions and 638 deletions.
2 changes: 1 addition & 1 deletion apps/remix-ide/src/blockchain/blockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Blockchain {
this.events = new EventEmitter()
this.config = config
const web3Runner = new TxRunnerWeb3({
config: config,
config: this.config,
detectNetwork: (cb) => {
this.executionContext.detectNetwork(cb)
},
Expand Down
2 changes: 1 addition & 1 deletion libs/remix-analyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"ethereumjs-util": "^7.0.10",
"ethers": "^5.4.2",
"string-similarity": "^4.0.4",
"web3": "1.2.4"
"web3": "^1.5.1"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion libs/remix-astwalker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"tape": "^4.10.1",
"ts-node": "^8.0.3",
"typescript": "^3.4.3",
"web3": "1.2.4"
"web3": "^1.5.1"
},
"devDependencies": {
"tap-spec": "^5.0.0"
Expand Down
2 changes: 1 addition & 1 deletion libs/remix-debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"ethereumjs-util": "^7.0.10",
"ethers": "^5.4.2",
"string-similarity": "^4.0.4",
"web3": "^1.2.4"
"web3": "^1.5.1"
},
"devDependencies": {
"@babel/core": "^7.4.5",
Expand Down
2 changes: 1 addition & 1 deletion libs/remix-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"events": "^3.0.0",
"solc": "^0.7.4",
"string-similarity": "^4.0.4",
"web3": "^1.2.4"
"web3": "^1.5.1"
},
"devDependencies": {
"@babel/core": "^7.4.5",
Expand Down
25 changes: 15 additions & 10 deletions libs/remix-lib/src/execution/txRunnerWeb3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ export class TxRunnerWeb3 {
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.baseFeePerGas) {
tx.maxPriorityFee = 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.type = 2
tx.maxPriorityFeePerGas = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.maxPriorityFee, 'gwei'))
tx.maxFeePerGas = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.maxFee, 'gwei'))
tx.type = '0x2'
} else {
tx.gasPrice = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.gasPrice, 'gwei'))
tx.type = 1
tx.type = '0x1'
}
}

Expand Down Expand Up @@ -100,18 +105,18 @@ export class TxRunnerWeb3 {
// callback is called whenever no error
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) => {
if (err) {
console.log(err)
return
}

if (this._api.config.getUnpersistedProperty('doNotShowTransactionConfirmationAgain')) {
return this._executeTx(tx, network, null, this._api, promptCb, callback)
}

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) => {
callback(error)
})
Expand Down
2 changes: 1 addition & 1 deletion libs/remix-simulator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"merge": "^1.2.0",
"string-similarity": "^4.0.4",
"time-stamp": "^2.0.0",
"web3": "^1.2.4"
"web3": "^1.5.1"
},
"devDependencies": {
"@babel/core": "^7.4.5",
Expand Down
2 changes: 1 addition & 1 deletion libs/remix-solidity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"ethers": "^5.4.2",
"solc": "^0.7.4",
"string-similarity": "^4.0.4",
"web3": "1.2.4",
"web3": "^1.5.1",
"webworkify-webpack": "^2.1.5"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion libs/remix-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"string-similarity": "^4.0.4",
"time-stamp": "^2.2.0",
"tslib": "^2.3.0",
"web3": "^1.2.4",
"web3": "^1.5.1",
"winston": "^3.0.0"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit 6e78707

Please sign in to comment.