Merge pull request #1277 from ethereum/useEthersForAbiCoding

Use ethers for abi coding
pull/1/head
yann300 7 years ago committed by GitHub
commit 4a71d9d5c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .circleci/config.yml
  2. 2
      src/app/execution/txLogger.js
  3. 16
      test-browser/helpers/contracts.js
  4. 28
      test-browser/tests/compiling.js
  5. 2
      test-browser/tests/units/testRecorder.js

@ -26,10 +26,10 @@ jobs:
- checkout
- restore_cache:
keys:
- dep-bundle-7-{{ checksum "package.json" }}
- dep-bundle-10-{{ checksum "package.json" }}
- run: npm install
- save_cache:
key: dep-bundle-7-{{ checksum "package.json" }}
key: dep-bundle-10-{{ checksum "package.json" }}
paths:
- ~/repo/node_modules
- run: npm run lint && npm run test && npm run downloadsolc && npm run make-mock-compiler && npm run build

@ -264,7 +264,7 @@ function context (self, opts) {
var val = data.tx.value
var hash = data.tx.hash ? helper.shortenHexData(data.tx.hash) : ''
var input = data.tx.input ? helper.shortenHexData(data.tx.input) : ''
var logs = data.logs && data.logs.decoded ? data.logs.decoded.length : 0
var logs = data.logs && data.logs.decoded && data.logs.decoded.length ? data.logs.decoded.length : 0
var block = data.tx.blockNumber || ''
var i = data.tx.transactionIndex
var value = val ? typeConversion.toInt(val) : 0

@ -135,13 +135,25 @@ function testFunction (fnFullName, txHash, log, expectedInput, expectedReturn, e
.click('#editor-container div[class^="terminal"] span[id="tx' + txHash + '"] div[class^="log"]')
.perform(function (client, done) {
if (expectedReturn) {
client.assert.containsText('#editor-container div[class^="terminal"] span[id="tx' + txHash + '"] table[class^="txTable"] #decodedoutput', expectedReturn)
client.getText('#editor-container div[class^="terminal"] span[id="tx' + txHash + '"] table[class^="txTable"] #decodedoutput', (result) => {
console.log(result)
var equal = deepequal(JSON.parse(result.value), JSON.parse(expectedReturn))
if (!equal) {
client.assert.fail('expected ' + expectedReturn + ' got ' + result.value, 'info about error', '')
}
})
}
done()
})
.perform(function (client, done) {
if (expectedEvent) {
client.assert.containsText('#editor-container div[class^="terminal"] span[id="tx' + txHash + '"] table[class^="txTable"] #logs', expectedEvent)
client.getText('#editor-container div[class^="terminal"] span[id="tx' + txHash + '"] table[class^="txTable"] #logs', (result) => {
console.log(result)
var equal = deepequal(JSON.parse(result.value), JSON.parse(expectedEvent))
if (!equal) {
client.assert.fail('expected ' + expectedEvent + ' got ' + result.value, 'info about error', '')
}
})
}
done()
if (callback) callback()

@ -78,7 +78,7 @@ function testReturnValues (browser, callback) {
"0": "bool: _b true",
"1": "uint256: _u 345",
"2": "int256: _i -345",
"3": "address: _a 0xca35b7d915458ef540ade6068dfe2f44e8fa733c"
"3": "address: _a 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c"
}`)
.pause(500)
.testFunction('retunValues2 - transact (not payable)',
@ -127,13 +127,25 @@ function testInputValues (browser, callback) {
{
"topic": "d30981760edbf605bda8689e945f622877f230c9a77cbfbd448aa4b7d8ac6e7f",
"event": "event1",
"args": [
"-123",
"000000000000000000000000000000000000000000000000000000000000007b",
"9c22ff5f21f0b81b113e63f7db6da94fedef11b2119b4088b89664fb9a3cb658",
"0x00001234",
"test _ test _ test _ test test _ test test _ test test _ test test _ test test _ test test _ test "
]
"args": {
"0": "-123",
"1": "123",
"2": {
"indexed": true,
"hash": "0x9c22ff5f21f0b81b113e63f7db6da94fedef11b2119b4088b89664fb9a3cb658"
},
"3": "0x00001234",
"4": "test _ test _ test _ test test _ test test _ test test _ test test _ test test _ test test _ test ",
"_i": "-123",
"_u": "123",
"_str": {
"indexed": true,
"hash": "0x9c22ff5f21f0b81b113e63f7db6da94fedef11b2119b4088b89664fb9a3cb658"
},
"_b": "0x00001234",
"_notIndexed": "test _ test _ test _ test test _ test test _ test test _ test test _ test test _ test test _ test ",
"length": 5
}
}
]`)
.click('i[class^="clearinstance"]').perform(() => { callback(null, browser) })

@ -16,7 +16,7 @@ module.exports = {
.clickFunction('getFromLib - call')
.waitForElementPresent('div[class^="contractActionsContainer"] div[class^="value"] ul')
.perform((client, done) => {
contractHelper.verifyCallReturnValue(browser, '0x35ef07393b57464e93deb59175ff72e6499450cf', ['0: uint256: 1', '0: uint256: 3456', '0: address: 0x35ef07393b57464e93deb59175ff72e6499450cf'], () => {
contractHelper.verifyCallReturnValue(browser, '0x35ef07393b57464e93deb59175ff72e6499450cf', ['0: uint256: 1', '0: uint256: 3456', '0: address: 0x35eF07393b57464e93dEB59175fF72E6499450cF'], () => {
done()
})
})

Loading…
Cancel
Save