pull/5370/head
aniket-engg 4 years ago committed by Aniket
parent 7ed245ca7b
commit d917c485f8
  1. 0
      libs/remix-lib/src/eventManager.ts
  2. 4
      libs/remix-lib/src/execution/eventsDecoder.ts
  3. 6
      libs/remix-lib/src/execution/execution-context.ts
  4. 0
      libs/remix-lib/src/execution/logsManager.ts
  5. 2
      libs/remix-lib/src/execution/txExecution.ts
  6. 0
      libs/remix-lib/src/execution/txFormat.ts
  7. 4
      libs/remix-lib/src/execution/txHelper.ts
  8. 15
      libs/remix-lib/src/execution/txListener.ts
  9. 24
      libs/remix-lib/src/execution/txRunner.ts
  10. 0
      libs/remix-lib/src/execution/typeConversion.ts
  11. 0
      libs/remix-lib/src/helpers/compilerHelper.ts
  12. 0
      libs/remix-lib/src/helpers/txResultHelper.ts
  13. 0
      libs/remix-lib/src/helpers/uiHelper.ts
  14. 0
      libs/remix-lib/src/init.ts
  15. 0
      libs/remix-lib/src/storage.ts
  16. 0
      libs/remix-lib/src/universalDapp.ts
  17. 12
      libs/remix-lib/src/util.ts
  18. 0
      libs/remix-lib/src/web3Provider/dummyProvider.ts
  19. 0
      libs/remix-lib/src/web3Provider/web3Providers.ts
  20. 0
      libs/remix-lib/src/web3Provider/web3VmProvider.ts

@ -1,5 +1,5 @@
'use strict'
const ethers = require('ethers')
import { ethers } from 'ethers'
const txHelper = require('./txHelper')
/**
@ -7,6 +7,8 @@ const txHelper = require('./txHelper')
*
*/
class EventsDecoder {
resolveReceipt
constructor ({resolveReceipt}) {
this.resolveReceipt = resolveReceipt
}

@ -1,6 +1,6 @@
/* global ethereum */
'use strict'
const Web3 = require('web3')
import Web3 from 'web3'
const EventManager = require('../eventManager')
const EthJSVM = require('ethereumjs-vm').default
const ethUtil = require('ethereumjs-util')
@ -12,8 +12,8 @@ const LogsManager = require('./logsManager.js')
const rlp = ethUtil.rlp
let web3
if (typeof window !== 'undefined' && typeof window.ethereum !== 'undefined') {
var injectedProvider = window.ethereum
if (typeof window !== 'undefined' && typeof window['ethereum'] !== 'undefined') {
var injectedProvider = window['ethereum']
web3 = new Web3(injectedProvider)
} else {
web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'))

@ -1,5 +1,5 @@
'use strict'
const ethers = require('ethers')
import { ethers } from 'ethers'
module.exports = {
/**

@ -1,5 +1,5 @@
'use strict'
const ethers = require('ethers')
import { ethers } from 'ethers'
module.exports = {
makeFullTypeDefinition: function (typeDef) {
@ -76,7 +76,7 @@ module.exports = {
if (abi[i].type === 'constructor') {
funABI.inputs = abi[i].inputs || []
funABI.payable = abi[i].payable
funABI.stateMutability = abi[i].stateMutability
funABI['stateMutability'] = abi[i].stateMutability
break
}
}

@ -1,6 +1,6 @@
'use strict'
const async = require('async')
const ethers = require('ethers')
import async from 'async'
import { ethers } from 'ethers'
const ethJSUtil = require('ethereumjs-util')
const EventManager = require('../eventManager')
const codeUtil = require('../util')
@ -28,6 +28,17 @@ function addExecutionCosts(txResult, tx) {
*/
class TxListener {
event
executionContext
_resolvedTransactions
_api
_resolvedContracts
_isListening: boolean
_listenOnNetwork:boolean
_loopId
blocks
lastBlock
constructor (opt, executionContext) {
this.event = new EventManager()
// has a default for now for backwards compatability

@ -1,12 +1,22 @@
'use strict'
const EthJSTX = require('ethereumjs-tx').Transaction
const EthJSBlock = require('ethereumjs-block')
const ethJSUtil = require('ethereumjs-util')
const BN = ethJSUtil.BN
import { BN } from 'ethereumjs-util'
const defaultExecutionContext = require('./execution-context')
const EventManager = require('../eventManager')
class TxRunner {
event
executionContext
_api
blockNumber
runAsync
pendingTxs
vmaccounts
queusTxs
blocks
constructor (vmaccounts, api, executionContext) {
this.event = new EventManager()
// has a default for now for backwards compatability
@ -63,7 +73,7 @@ class TxRunner {
resolve({
result,
tx,
transactionHash: result ? result.transactionHash : null
transactionHash: result ? result['transactionHash'] : null
})
})
}
@ -167,7 +177,7 @@ class TxRunner {
const tx = { from: from, to: to, data: data, value: value }
if (useCall) {
tx.gas = gasLimit
tx['gas'] = gasLimit
return this.executionContext.web3().eth.call(tx, function (error, result) {
callback(error, {
result: result,
@ -182,7 +192,7 @@ class TxRunner {
}
gasEstimationForceSend(err, () => {
// 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)
@ -194,7 +204,7 @@ class TxRunner {
return
}
confirmCb(network, tx, tx.gas, (gasPrice) => {
confirmCb(network, tx, tx['gas'], (gasPrice) => {
return this._executeTx(tx, gasPrice, this._api, promptCb, callback)
}, (error) => {
callback(error)
@ -248,7 +258,7 @@ async function tryTillTxAvailable (txhash, executionContext) {
async function pause () { return new Promise((resolve, reject) => { setTimeout(resolve, 500) }) }
function run(self, tx, stamp, confirmationCb, gasEstimationForceSend, promptCb, callback) {
function run(self, tx, stamp, confirmationCb, gasEstimationForceSend = null, promptCb = null, callback = null) {
if (!self.runAsync && Object.keys(self.pendingTxs).length) {
return self.queusTxs.push({ tx, stamp, callback })
}

@ -1,5 +1,5 @@
'use strict'
const ethutil = require('ethereumjs-util')
import { BN, bufferToHex, keccak, setLengthLeft } from 'ethereumjs-util'
/*
contains misc util: @TODO should be splitted
@ -48,10 +48,10 @@ module.exports = {
const ret = []
for (let k in bnList) {
const v = bnList[k]
if (ethutil.BN.isBN(v)) {
if (BN.isBN(v)) {
ret.push('0x' + v.toString('hex', 64))
} else {
ret.push('0x' + (new ethutil.BN(v)).toString('hex', 64)) // TEMP FIX TO REMOVE ONCE https://github.com/ethereumjs/ethereumjs-vm/pull/293 is released
ret.push('0x' + (new BN(v)).toString('hex', 64)) // TEMP FIX TO REMOVE ONCE https://github.com/ethereumjs/ethereumjs-vm/pull/293 is released
}
}
return ret
@ -161,9 +161,9 @@ module.exports = {
if (typeof value === 'string' && value.indexOf('0x') !== 0) {
value = '0x' + value
}
let ret = ethutil.bufferToHex(ethutil.setLengthLeft(value, 32))
ret = ethutil.keccak(ret)
return ethutil.bufferToHex(ret)
let ret: any = bufferToHex(setLengthLeft(value, 32))
ret = keccak(ret)
return bufferToHex(ret)
},
/**
Loading…
Cancel
Save