diff --git a/.circleci/config.yml b/.circleci/config.yml index 74c3834eb4..61aba18604 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,10 +26,10 @@ jobs: - checkout - restore_cache: keys: - - dep-bundle-20-{{ checksum "package.json" }} + - dep-bundle-21-{{ checksum "package.json" }} - run: npm install - save_cache: - key: dep-bundle-20-{{ checksum "package.json" }} + key: dep-bundle-21-{{ checksum "package.json" }} paths: - ~/repo/node_modules - run: npm run lint && npm run test && npm run make-mock-compiler && npm run build @@ -46,10 +46,10 @@ jobs: - checkout - restore_cache: keys: - - dep-bundle-15-{{ checksum "package.json" }} + - dep-bundle-16-{{ checksum "package.json" }} - run: npm install - save_cache: - key: dep-bundle-15-{{ checksum "package.json" }} + key: dep-bundle-16-{{ checksum "package.json" }} paths: - ~/repo/node_modules - run: npm run build_debugger diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index faf22a2556..60a40c3999 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -403,6 +403,7 @@ function contractDropdown (events, self) { } else { if (Object.keys(selectedContract.contract.object.evm.bytecode.linkReferences).length) self._deps.logCallback(`linking ${JSON.stringify(selectedContract.contract.object.evm.bytecode.linkReferences, null, '\t')} using ${JSON.stringify(contractMetadata.linkReferences, null, '\t')}`) txFormat.encodeConstructorCallAndLinkLibraries(selectedContract.contract.object, args, constructor, contractMetadata.linkReferences, selectedContract.contract.object.evm.bytecode.linkReferences, (error, data) => { + data.contractName = selectedContract.name createInstanceCallback(error, selectedContract, data) }) } diff --git a/src/recorder.js b/src/recorder.js index 5bf6bd7863..1f14c472ca 100644 --- a/src/recorder.js +++ b/src/recorder.js @@ -51,8 +51,8 @@ class Recorder { record.to = `created{${creationTimestamp}}` record.abi = this.data._contractABIReferences[creationTimestamp] } - record.name = payLoad.funAbi.name + record.inputs = txHelper.serializeInputs(payLoad.funAbi) record.type = payLoad.funAbi.type udapp.getAccounts((error, accounts) => { @@ -201,8 +201,10 @@ class Recorder { var fnABI if (tx.record.type === 'constructor') { fnABI = txHelper.getConstructorInterface(abi) + } else if (tx.record.type === 'fallback') { + fnABI = txHelper.getFallbackInterface(abi) } else { - fnABI = txHelper.getFunction(abi, record.name) + fnABI = txHelper.getFunction(abi, record.name + record.inputs) } if (!fnABI) { modal.alert('cannot resolve abi of ' + JSON.stringify(record, null, '\t') + '. Execution stopped at ' + index) diff --git a/test-browser/tests/units/testRecorder.js b/test-browser/tests/units/testRecorder.js index 2258594352..aca1892c48 100644 --- a/test-browser/tests/units/testRecorder.js +++ b/test-browser/tests/units/testRecorder.js @@ -87,6 +87,7 @@ var records = `{ "contractName": "testLib", "bytecode": "60606040523415600e57600080fd5b60968061001c6000396000f300606060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680636d4ce63c146044575b600080fd5b604a6060565b6040518082815260200191505060405180910390f35b6000610d809050905600a165627a7a7230582022d123b15248b8176151f8d45c2dc132063bcc9bb8d5cd652aea7efae362c8050029", "linkReferences": {}, + "inputs": "()", "type": "constructor", "from": "account{0}" } @@ -113,6 +114,7 @@ var records = `{ }, "name": "", "type": "constructor", + "inputs": "(uint256)", "from": "account{0}" } }, @@ -127,6 +129,7 @@ var records = `{ "to": "created{1512830015080}", "abi": "0xc41589e7559804ea4a2080dad19d876a024ccb05117835447d72ce08c1d020ec", "name": "set", + "inputs": "(uint256,address)", "type": "function", "from": "account{0}" } @@ -244,6 +247,7 @@ var scenario = { 'linkReferences': {}, 'name': '', 'type': 'constructor', + 'inputs': '(uint256)', 'from': 'account{0}' } }, @@ -257,6 +261,7 @@ var scenario = { 'to': 'created{1512912691086}', 'abi': '0x54a8c0ab653c15bfb48b47fd011ba2b9617af01cb45cab344acd57c924d56798', 'name': 'set', + 'inputs': '(uint256)', 'type': 'function', 'from': 'account{0}' }