log transaction error

pull/5370/head
Omkara 6 years ago
parent 67c5852658
commit b4d88db199
  1. 1
      remix-tests/package.json
  2. 6
      remix-tests/src/deployer.js
  3. 2
      remix-tests/src/runTestSources.ts
  4. 6
      remix-tests/src/testRunner.ts
  5. 25
      remix-tests/tests/testRunner.ts

@ -37,6 +37,7 @@
},
"homepage": "https://github.com/ethereum/remix-tests#readme",
"dependencies": {
"@types/async": "^2.4.0",
"async": "^2.6.0",
"change-case": "^3.0.1",
"colors": "^1.1.2",

@ -69,7 +69,7 @@ function deployAll (compileResult, web3, callback) {
callback(null, { result: { createdAddress: receipt.contractAddress } }) // TODO this will only work with JavaScriptV VM
}).on('error', function (err) {
console.dir(err)
console.error(err)
callback(err)
})
})
@ -79,9 +79,13 @@ function deployAll (compileResult, web3, callback) {
let contract = compiledObject[contractName]
let encodeDataFinalCallback = (error, contractDeployData) => {
if (error) return nextEach(error)
try {
let contractObject = new web3.eth.Contract(contract.abi)
let deployObject = contractObject.deploy({arguments: [], data: '0x' + contractDeployData.dataHex})
deployRunner(deployObject, contractObject, contractName, contract.filename, (error) => { nextEach(error) })
} catch (e) {
throw e
}
}
let encodeDataStepCallback = (msg) => { console.dir(msg) }

@ -1,4 +1,4 @@
import async = require('async')
import async from 'async'
require('colors')
import Compiler = require('./compiler.js')

@ -1,6 +1,6 @@
import async = require('async');
import changeCase = require('change-case');
import Web3 = require('web3');
import async from 'async'
import * as changeCase from 'change-case'
import Web3 from 'web3'
function getFunctionFullName (signature, methodIdentifiers) {
for (var method in methodIdentifiers) {

@ -1,35 +1,40 @@
import async = require('async')
import Web3 = require('web3')
import assert = require('assert')
import async from 'async'
import Web3 from 'web3'
import * as assert from 'assert'
import { Provider } from 'remix-simulator'
let Compiler = require('../src/compiler.js')
let Deployer = require('../src/deployer.js')
let TestRunner = require('../src/testRunner.ts')
const Provider = require('remix-simulator').Provider
interface Results {
passingNum: number,
failureNum: number,
}
function compileAndDeploy (filename, callback) {
function compileAndDeploy (filename: string, callback: Function) {
let web3 = new Web3()
web3.setProvider(new Provider())
let compilationData
let accounts
let compilationData: Object
let accounts: Object
async.waterfall([
function getAccountList (next) {
web3.eth.getAccounts((_err, _accounts) => {
function getAccountList (next: Function) {
web3.eth.getAccounts((_err: Error, _accounts: Object) => {
accounts = _accounts
next(_err)
})
},
function compile (next) {
function compile (next: Function) {
Compiler.compileFileOrFiles(filename, false, {accounts}, next)
},
function deployAllContracts (compilationResult, next) {
try {
compilationData = compilationResult
Deployer.deployAll(compilationResult, web3, next)
next()
} catch(e) {
throw e
}
}
], function (_err, contracts) {
callback(null, compilationData, contracts, accounts)

Loading…
Cancel
Save