Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

David/merge upstream #2

Merged
merged 172 commits into from
Oct 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
f636f7e
use proper javascript object for scripting
yann300 Jul 16, 2018
01f0df4
clear circle cache
yann300 Jul 16, 2018
6fdf001
Merge pull request #1414 from ethereum/fixTerminalInterpreter
yann300 Jul 16, 2018
97a01ea
warn deprecated
yann300 Jul 18, 2018
afcae85
help message in terminal
yann300 Jul 18, 2018
b82a579
typo
yann300 Jul 18, 2018
56a489b
intro
yann300 Jul 18, 2018
5640dc0
clear circle cache
yann300 Jul 18, 2018
8288bf2
Merge pull request #1416 from ethereum/addCommandInterpreterWarnin
yann300 Jul 18, 2018
f24e4d1
Filter tests
ninabreznik Jun 15, 2018
b5cd9f5
Add event trigger/register for new File created
ninabreznik Jun 18, 2018
f7a9889
Push new file to allTest and run only selectedTests
ninabreznik Jun 18, 2018
0cd96bb
Add checked to new tests
ninabreznik Jun 18, 2018
29b8698
Add styling to test outputs
ninabreznik Jun 27, 2018
18cb050
Add filename to tests summary
ninabreznik Jun 29, 2018
ed92cbd
fix lost refs while rebasing
yann300 Jul 6, 2018
9afb294
new css style for test result
yann300 Jul 18, 2018
03777aa
Merge pull request #1369 from ethereum/tests-logic
yann300 Jul 18, 2018
9265f14
Fix copy input field
ninabreznik Jul 12, 2018
90d886a
Merge pull request #1409 from ethereum/copyInput
yann300 Jul 18, 2018
992968d
Update test-tab.js
yann300 Jul 23, 2018
734a53b
Merge pull request #1420 from ethereum/yann300-patch-16
yann300 Jul 23, 2018
cfedff4
draggable content for extension
yann300 Jul 17, 2018
d63efbc
update font awesome
yann300 Jul 23, 2018
f18ee02
don't load plugin if loaded
yann300 Jul 23, 2018
014d2ed
add actions (minimize, maximise, close)
yann300 Jul 23, 2018
d4dad9a
load plugin
yann300 Jul 23, 2018
9c55135
standard
yann300 Jul 23, 2018
9ceb133
Merge pull request #1421 from ethereum/pluginUX
yann300 Jul 23, 2018
e343fe4
add compiler metadata
yann300 Apr 25, 2018
0d57f4e
retrieve contract metadata
yann300 Apr 25, 2018
40c995a
linklibrairies in metadata file is present
yann300 Apr 25, 2018
1deb327
fix path
yann300 Jul 24, 2018
3a7b34e
autodeploy libs when creating instances
yann300 Jul 24, 2018
375af18
add autdeploylib property to metadata
yann300 Jul 24, 2018
eb7438a
fix compilation slow warning
yann300 Jul 24, 2018
64aed49
clear circle ci cache
yann300 Jul 24, 2018
4a67d88
Merge pull request #1281 from ethereum/librarieDeployCustom
yann300 Jul 25, 2018
9a31589
Update package.json
yann300 Jul 25, 2018
aa425d4
Merge pull request #1426 from ethereum/yann300-patch-17
yann300 Jul 25, 2018
c3a9c38
json file include network id
yann300 Jul 25, 2018
a4aa164
clear ci cache
yann300 Jul 27, 2018
19b889e
resolve only networkname if id no present
yann300 Jul 27, 2018
f07e95e
also return by networkid
yann300 Jul 27, 2018
19e62c9
Merge pull request #1425 from ethereum/librarieDeployCustom
yann300 Jul 27, 2018
45ca32e
Update test-tab.js
yann300 Aug 2, 2018
c95d86e
Merge pull request #1436 from ethereum/yann300-patch-18
yann300 Aug 2, 2018
9174094
Update txlogger.js
Aug 2, 2018
4af4559
commit added vm acount (for fixing account balance)
yann300 Aug 6, 2018
e133927
add NPM pkg for .sol syntax hilighting
raphaelhuefner Jul 17, 2018
d0f723a
add ethers.js to the console
yann300 Aug 7, 2018
d35fe6f
Merge pull request #1446 from ethereum/addEthersLibToTheConsole
yann300 Aug 7, 2018
6403bca
implemented `execute` terminal command
evgeniuz Aug 7, 2018
9e501d3
return error if localhost not connected
yann300 Aug 7, 2018
ed18c3d
Merge pull request #1448 from ethereum/fix_ImportFailureDueToRemixd
yann300 Aug 7, 2018
4983587
use Web3 1.0.0 in remix-ide
yann300 Aug 8, 2018
9d51f74
Update terminal.js
yann300 Aug 9, 2018
14bf264
Merge pull request #1452 from ethereum/useweb31
yann300 Aug 14, 2018
d3f2135
Merge pull request #1444 from ethereum/yann300-patch-19
yann300 Aug 14, 2018
674994e
Merge pull request #1447 from evgeniuz/master
yann300 Aug 14, 2018
0d1af55
Update package.json
yann300 Aug 14, 2018
feb2997
Update terminal.js
yann300 Aug 14, 2018
69f410d
Update compiler-imports.js
yann300 Aug 14, 2018
04d6749
Update publishOnSwarm.js
yann300 Aug 14, 2018
20bb08f
Check lowered case metadata key
yann300 Aug 8, 2018
a020b29
Merge pull request #1437 from n3tc0m/master
yann300 Aug 14, 2018
f45f376
Merge pull request #1453 from ethereum/yann300-patch-21
yann300 Aug 14, 2018
5f9d8ef
Merge pull request #1451 from ethereum/yann300-patch-20
yann300 Aug 14, 2018
8199879
add http && https explorer and import raw url
yann300 Aug 13, 2018
deabcda
remove User Agent Remix
yann300 Aug 13, 2018
5205aed
clear circle ci cache
yann300 Aug 14, 2018
62749fb
Merge pull request #1456 from ethereum/importUrlRawContent
yann300 Aug 14, 2018
37883d1
Alignment fixes
ninabreznik Jul 25, 2018
8b96a56
Some more fixes in UI of run tab
ninabreznik Jul 25, 2018
5d3aaaa
Fix_ErrorWhileCallingUnknownContract
yann300 Aug 6, 2018
ecceea1
typo
yann300 Aug 14, 2018
4814d86
fix display status not available if receipt not available
yann300 Aug 14, 2018
69ea9d5
Merge pull request #1427 from ethereum/runTabUI
yann300 Aug 14, 2018
8d8d770
add console.warn to terminal
serapath Aug 14, 2018
b84110d
add missing css to dark style
yann300 Aug 16, 2018
010c990
add generate test file
yann300 Aug 16, 2018
2559c97
fix tab name
yann300 Aug 16, 2018
f53f2ce
fix description
yann300 Aug 16, 2018
2f2e62f
fix test tab
yann300 Aug 16, 2018
e9251de
add "no test file available"
yann300 Aug 16, 2018
c53e1e4
tab ordering
yann300 Aug 16, 2018
943e1a2
Warn user at deploy time if contract size above ethereum/EIPs#170
bakaoh Aug 15, 2018
4064d19
Merge pull request #1465 from ethereum/generateTestFile
yann300 Aug 17, 2018
cf1e23c
Merge pull request #1415 from raphaelhuefner/switchSyntaxHilightToExt…
yann300 Aug 17, 2018
446cfb6
Merge pull request #1461 from bakaoh/issue1457
yann300 Aug 20, 2018
355a6d1
reorg debug panel
yann300 Aug 20, 2018
0f406e8
Improve log styling
yann300 Aug 21, 2018
3b5ad90
fix test
yann300 Aug 21, 2018
38db7fe
Update vmdebugger.js
yann300 Aug 21, 2018
e84bbcc
Update vmdebugger.js
yann300 Aug 21, 2018
37f36ca
Update vmdebugger.js
yann300 Aug 21, 2018
9ca7635
Merge pull request #1468 from ethereum/fontInTerminal
yann300 Aug 21, 2018
6083665
Merge pull request #1467 from ethereum/debuggerSmallUIFixes
yann300 Aug 21, 2018
bcbc08c
clear accounts list before renewing
yann300 Aug 8, 2018
3412905
fix autoDeploy lib, default behavior
yann300 Aug 8, 2018
2f48c50
auto update accounts list
yann300 Aug 8, 2018
66486db
standard
yann300 Aug 8, 2018
9ac7704
Merge pull request #1445 from ethereum/fixLogUnknownCall
yann300 Aug 21, 2018
83867fd
add warning color to stylesheet
serapath Aug 21, 2018
c8ec99b
Merge pull request #1459 from ethereum/terminal-commands
yann300 Aug 21, 2018
d9d73b0
update requires to new remix libs
iurimatias Jul 18, 2018
dd36c41
point to local libs to test
iurimatias Jul 25, 2018
baa87b4
use lastest package versions
iurimatias Jul 26, 2018
c0bfb11
fix reference to storage
iurimatias Jul 26, 2018
3a21e1c
fix typo
iurimatias Jul 27, 2018
5b97c65
cleanup
iurimatias Jul 30, 2018
2085938
fix web3 obj
iurimatias Jul 31, 2018
5c30948
update txbrowser web3 reference
iurimatias Aug 1, 2018
17721ff
reinit vmdebugger; tolerate view not existing
iurimatias Aug 1, 2018
a252ab7
fix fixes for remix-debug integration
iurimatias Aug 13, 2018
ca47914
fix debugging
yann300 Aug 14, 2018
93a3e8a
make linter happy
iurimatias Aug 15, 2018
df3e334
fix debug button
iurimatias Aug 17, 2018
88af440
fix loading trace
yann300 Aug 20, 2018
d44857a
don't display provider url
yann300 Aug 20, 2018
74a8625
remove reference when unloading
yann300 Aug 20, 2018
452d1b7
use getSourceLocationFromVMTraceIndex
yann300 Aug 22, 2018
89080d1
fix used ref
yann300 Aug 22, 2018
469ab51
fix hit breakpoint
yann300 Aug 22, 2018
7b9a217
use latest published remix lib
yann300 Aug 22, 2018
2030934
remove downloadsolc + clean cache
yann300 Aug 22, 2018
edf9ab2
fix ref
yann300 Aug 22, 2018
37b3614
adapt UI
yann300 Aug 22, 2018
5804c2c
ui small fixes
yann300 Aug 22, 2018
b9b2e6a
small ui fixes
yann300 Aug 22, 2018
2ce940c
clear cache
yann300 Aug 22, 2018
edafdc6
fix standalone debugger
yann300 Aug 22, 2018
d8c4762
delete comment
yann300 Aug 22, 2018
04e8a91
remove console.log
yann300 Aug 22, 2018
961561b
fix updating web reference
yann300 Aug 22, 2018
1425417
show all panels in any case
yann300 Aug 22, 2018
4d0269a
fix fake provider
yann300 Aug 22, 2018
989d6f1
fix tests
yann300 Aug 22, 2018
763381f
fix test
yann300 Aug 22, 2018
ef8e8b5
Merge pull request #1464 from ethereum/new_remix_lib
yann300 Aug 22, 2018
9000673
Merge pull request #1449 from ethereum/fix_listenOnWeb3AccountsChanged
yann300 Aug 22, 2018
6df87d0
add remix-debug to the console
yann300 Aug 2, 2018
7477a45
typo
yann300 Aug 2, 2018
df062e1
fix tests
yann300 Aug 22, 2018
d8bcd00
move solidity version selector to compile tab
yann300 Aug 17, 2018
fbc80fd
move plugin panel up
yann300 Aug 17, 2018
1771864
move remix, remixd info to setttings tab
yann300 Aug 17, 2018
8bfd802
refactor plugin loading/removing
yann300 Aug 17, 2018
9b539e9
UX update for buttons for plugin tab
ryestew Aug 22, 2018
62dc31d
Merge pull request #1439 from ethereum/remixDebug
yann300 Aug 22, 2018
953ec99
add title in pluging
yann300 Aug 22, 2018
3c3cce1
fix dark styling
yann300 Aug 22, 2018
7f9a671
add some help log
yann300 Aug 22, 2018
6e31383
Merge pull request #1466 from ethereum/cleantabsContent
yann300 Aug 22, 2018
8fa95a0
Merge pull request #1472 from ethereum/variousImpr
yann300 Aug 22, 2018
f6ebee8
option for generating metadata
yann300 Aug 22, 2018
12dbc71
Merge pull request #1473 from ethereum/optionForGeneratingJSON
yann300 Aug 22, 2018
2c6ee48
Add ability to sign messages for web3 providers and Javascript VM
oogetyboogety Aug 23, 2018
c6dd9d5
fix standard && display hashed messages in the result
yann300 Aug 23, 2018
19eabee
remove ECRecover test
yann300 Aug 23, 2018
e6918e3
Merge pull request #1474 from oogetyboogety/master
yann300 Aug 23, 2018
e09de5c
word wrap for modal dialog
yann300 Aug 23, 2018
56f85b8
display error message in the console
yann300 Aug 23, 2018
5ae7768
Merge pull request #1475 from ethereum/variousFixes
yann300 Aug 23, 2018
8084370
Update README.md
yann300 Aug 23, 2018
2f5256f
Merge pull request #1476 from ethereum/yann300-patch-22
yann300 Aug 23, 2018
dbd5e51
Update package.json
yann300 Aug 23, 2018
28f2123
Merge pull request #1477 from ethereum/yann300-patch-23
yann300 Aug 23, 2018
df4610a
Add Custom networks when using Web3 Provider.
hello2mao Aug 23, 2018
7e16fd6
Merge pull request #1479 from hello2mao/master
yann300 Aug 23, 2018
3189710
Merge from upstream/remix-live
Oct 9, 2018
f7258ad
Fixed linkages
Oct 9, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:
- checkout
- restore_cache:
keys:
- dep-bundle-13-{{ checksum "package.json" }}
- dep-bundle-20-{{ checksum "package.json" }}
- run: npm install
- save_cache:
key: dep-bundle-13-{{ checksum "package.json" }}
key: dep-bundle-20-{{ 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
- run: npm run lint && npm run test && npm run make-mock-compiler && npm run build
- run: ./ci/browser_tests.sh

remix-debugger:
Expand All @@ -46,10 +46,10 @@ jobs:
- checkout
- restore_cache:
keys:
- dep-bundle-8-{{ checksum "package.json" }}
- dep-bundle-15-{{ checksum "package.json" }}
- run: npm install
- save_cache:
key: dep-bundle-8-{{ checksum "package.json" }}
key: dep-bundle-15-{{ checksum "package.json" }}
paths:
- ~/repo/node_modules
- run: npm run build_debugger
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ branches:
- master
- remix_live
script:
- npm run lint && npm run test && npm run downloadsolc && npm run make-mock-compiler && npm run build
- npm run lint && npm run test && npm run make-mock-compiler && npm run build
- ./ci/browser_tests.sh
deploy:
- provider: script
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Remix is a browser-based compiler and IDE that enables users to build **Ethereum

To try it out, visit [https://remix.ethereum.org](https://remix.ethereum.org).

https://github.com/ethereum/remix-ide/releases also gives others ways to use Remix locally. Please check it out.

Remix consists of many modules and in this repository you will find the Remix IDE (aka. Browser-Solidity).

![Remix screenshot](https://i.imgur.com/clfc7US.png)
Expand Down Expand Up @@ -36,7 +38,7 @@ Or if you want to clone the github repository (`wget` need to be installed first
git clone https://github.com/ethereum/remix-ide.git
cd remix-ide
npm install
npm run setupremix # this will clone https://github.com/ethereum/remix for you and link it to remix-ide
npm run setupremix # this will clone https://github.com/ethereum/remix for you and link it to remix-ide. Only execute this step if you want to contribute on Remix development
npm start
```

Expand Down
4 changes: 2 additions & 2 deletions assets/css/font-awesome.min.css

Large diffs are not rendered by default.

Binary file modified assets/fonts/FontAwesome.otf
Binary file not shown.
Binary file modified assets/fonts/fontawesome-webfont.eot
Binary file not shown.
3,305 changes: 2,668 additions & 637 deletions assets/fonts/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/fonts/fontawesome-webfont.ttf
Binary file not shown.
Binary file modified assets/fonts/fontawesome-webfont.woff
Binary file not shown.
Binary file modified assets/fonts/fontawesome-webfont.woff2
Binary file not shown.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.2",
"description": "Minimalistic browser-based Solidity IDE",
"devDependencies": {
"@shyftnetwork/shyft_ethereumjs-block": "^1.7.1",
"ace-mode-solidity": "^0.1.0",
"async": "^2.1.2",
"babel-preset-env": "^1.6.1",
"babel-eslint": "^7.1.1",
Expand Down Expand Up @@ -38,21 +38,22 @@
"npm-link-local": "^1.1.0",
"npm-run-all": "^4.0.2",
"onchange": "^3.2.1",
"@shyftnetwork/shyft_remix-core": "latest",
"@shyftnetwork/shyft_remix-debugger": "latest",
"@shyftnetwork/shyft_remix-debug": "latest",
"@shyftnetwork/shyft_remix-analyzer": "latest",
"@shyftnetwork/shyft_remix-lib": "latest",
"@shyftnetwork/shyft_remix-solidity": "latest",
"@shyftnetwork/shyft_remix-tests": "latest",
"remixd": "git+https://github.com/ethereum/remixd.git",
"request": "^2.83.0",
"rimraf": "^2.6.1",
"selenium-standalone": "^6.0.1",
"standard": "^8.5.0",
"swarmgw": "^0.2.0",
"swarmgw": "^0.3.1",
"tape": "^4.5.1",
"uglify-js": "^2.8.16",
"vm-browserify": "0.0.4",
"watchify": "^3.9.0",
"web3": "^0.18.0",
"web3": "1.0.0-beta.27",
"webworkify": "^1.2.1",
"yo-yo": "^1.2.2",
"yo-yoify": "^3.7.3"
Expand All @@ -64,7 +65,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/ethereum/remix-ide.git"
"url": "git+https://github.com/shyftnetwork/shyft_remix-ide.git"
},
"keywords": [
"ethereum",
Expand Down Expand Up @@ -148,21 +149,20 @@
"remix-ide": "./bin/remix-ide"
},
"scripts": {
"setupremix": "npm run pullremix && npm run linkremixcore && npm run linkremixlib && npm run linkremixsolidity;",
"setupremix": "npm run pullremix && npm run linkremixlib && npm run linkremixsolidity;",
"pullremix": "git clone https://github.com/ethereum/remix",
"linkremixcore": "cd node_modules && rm -rf remix-core && ln -s ../remix/remix-core remix-core && cd ..",
"linkremixlib": "cd node_modules && rm -rf remix-lib && ln -s ../remix/remix-lib remix-lib && cd ..",
"linkremixsolidity": "cd node_modules && rm -rf remix-solidity && ln -s ../remix/remix-solidity remix-solidity && cd ..",
"build": "browserify src/index.js -o build/app.js",
"build": "browserify src/index.js -o build/app.js --exclude solc",
"build_debugger": "browserify src/app/debugger/remix-debugger/index.js -o src/app/debugger/remix-debugger/build/app.js",
"browsertest": "sleep 5 && npm run nightwatch_local",
"csslint": "csslint --ignore=order-alphabetical --errors='errors,duplicate-properties,empty-rules' --exclude-list='assets/css/font-awesome.min.css' assets/css/",
"downloadsolc": "rimraf soljson.js && cd node_modules/solc && wget --no-check-certificate https://shyftnetwork.github.io/shyft_solc-bin/soljson.js && cd ../../",
"downloadsolc_root": "wget --no-check-certificate https://shyftnetwork.github.io/shyft_solc-bin/soljson.js",
"lint": "standard | notify-error",
"make-mock-compiler": "node ci/makeMockCompiler.js",
"minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false",
"nightwatch_local": "nightwatch --config nightwatch.js --env local",
"nightwatch_local_debugger": "nightwatch --config nightwatch_debugger.js --env local",
"nightwatch_remote_chrome": "nightwatch --config nightwatch.js --env chrome",
"nightwatch_remote_firefox": "nightwatch --config nightwatch.js --env default",
"nightwatch_remote_ie": "nightwatch --config nightwatch.js --env ie",
Expand All @@ -180,6 +180,6 @@
"start": "npm-run-all -lpr serve watch onchange remixd",
"test": "npm run csslint; standard && node test/index.js",
"test-browser": "npm-run-all -lpr selenium downloadsolc_root make-mock-compiler serve browsertest",
"watch": "watchify src/index.js -dv -p browserify-reload -o build/app.js"
"watch": "watchify src/index.js -dv -p browserify-reload -o build/app.js --exclude solc"
}
}
6 changes: 6 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ class App {
self._components.filesProviders['github'] = new BasicReadOnlyExplorer('github')
self._components.filesProviders['gist'] = new NotPersistedExplorer('gist')
self._components.filesProviders['ipfs'] = new BasicReadOnlyExplorer('ipfs')
self._components.filesProviders['https'] = new BasicReadOnlyExplorer('https')
self._components.filesProviders['http'] = new BasicReadOnlyExplorer('http')
registry.put({api: self._components.filesProviders['localhost'], name: 'fileproviders/localhost'})
registry.put({api: self._components.filesProviders['swarm'], name: 'fileproviders/swarm'})
registry.put({api: self._components.filesProviders['github'], name: 'fileproviders/github'})
Expand Down Expand Up @@ -321,6 +323,9 @@ class App {
}
var provider = self._components.fileManager.fileProviderOf(url)
if (provider) {
if (provider.type === 'localhost' && !provider.isConnected()) {
return filecb(`file provider ${provider.type} not available while trying to resolve ${url}`)
}
provider.exists(url, (error, exist) => {
if (error) return filecb(error)
if (exist) {
Expand Down Expand Up @@ -474,6 +479,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
self._components.filePanel = new FilePanel()
self._view.leftpanel.appendChild(self._components.filePanel.render())
self._components.filePanel.event.register('resize', delta => self._adjustLayout('left', delta))
registry.put({api: self._components.filePanel, name: 'filepanel'})

// ----------------- Renderer -----------------
var renderer = new Renderer()
Expand Down
22 changes: 17 additions & 5 deletions src/app/compiler/compiler-imports.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'
var base64 = require('js-base64').Base64
var swarmgw = require('swarmgw')
var swarmgw = require('swarmgw')()
var request = require('request')

module.exports = class CompilerImports {
Expand Down Expand Up @@ -40,10 +40,7 @@ module.exports = class CompilerImports {

return request.get(
{
url: 'https://gateway.ipfs.io/' + url,
headers: {
'User-Agent': 'Remix'
}
url: 'https://gateway.ipfs.io/' + url
},
(err, r, data) => {
if (err) {
Expand All @@ -53,9 +50,24 @@ module.exports = class CompilerImports {
})
}

handleHttpCall (url, cleanUrl, cb) {
return request.get(
{
url
},
(err, r, data) => {
if (err) {
return cb(err || 'Unknown transport error')
}
cb(null, data, cleanUrl)
})
}

handlers () {
return [
{ type: 'github', match: /^(https?:\/\/)?(www.)?github.com\/([^/]*\/[^/]*)\/(.*)/, handler: (match, cb) => { this.handleGithubCall(match[3], match[4], cb) } },
{ type: 'http', match: /^(http?:\/\/?(.*))$/, handler: (match, cb) => { this.handleHttpCall(match[1], match[2], cb) } },
{ type: 'https', match: /^(https?:\/\/?(.*))$/, handler: (match, cb) => { this.handleHttpCall(match[1], match[2], cb) } },
{ type: 'swarm', match: /^(bzz[ri]?:\/\/?(.*))$/, handler: (match, cb) => { this.handleSwarmImport(match[1], match[2], cb) } },
{ type: 'ipfs', match: /^(ipfs:\/\/?.+)/, handler: (match, cb) => { this.handleIPFS(match[1], cb) } }
]
Expand Down
2 changes: 1 addition & 1 deletion src/app/contract/publishOnSwarm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

var async = require('async')
var swarmgw = require('swarmgw')
var swarmgw = require('swarmgw')()

module.exports = (contract, fileManager, cb, swarmVerifiedPublishCallBack) => {
// gather list of files to publish
Expand Down
44 changes: 26 additions & 18 deletions src/app/debugger/debugger.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use strict'

var EthdebuggerUI = require('./remix-debugger/src/ui/EthdebuggerUI')
var Ethdebugger = require('@shyftnetwork/shyft_remix-debug').EthDebugger
var remixLib = require('@shyftnetwork/shyft_remix-lib')
var remixCore = require('@shyftnetwork/shyft_remix-core')
var Ethdebugger = require('./remix-debugger/src/ui/Ethdebugger')
var executionContext = require('../../execution-context')
var globlalRegistry = require('../../global/registry')

Expand All @@ -22,6 +21,7 @@ function Debugger (container, sourceHighlighter, localRegistry) {
}
this.debugger = new Ethdebugger(
{
executionContext: executionContext,
compilationResult: () => {
var compilationResult = this._deps.compiler.lastCompilationResult
if (compilationResult) {
Expand All @@ -30,17 +30,21 @@ function Debugger (container, sourceHighlighter, localRegistry) {
return null
}
})
this.debugger_ui = new EthdebuggerUI({debugger: this.debugger})
this.sourceMappingDecoder = new remixLib.SourceMappingDecoder()
container.appendChild(this.debugger.render())
//
// TODO: render doesn't exist anymore
container.appendChild(this.debugger_ui.render())
//
this.isActive = false

this.breakPointManager = new remixCore.code.BreakpointManager(this.debugger, (sourceLocation) => {
this.breakPointManager = new remixLib.code.BreakpointManager(this.debugger, (sourceLocation) => {
return self._deps.offsetToLineColumnConverter.offsetToLineColumn(sourceLocation, sourceLocation.file, this._deps.compiler.lastCompilationResult.source.sources)
}, (step) => {
this.debugger_ui.stepManager.jumpTo(step)
})

this.debugger.setBreakpointManager(this.breakPointManager)
this.breakPointManager.event.register('breakpointHit', (sourceLocation) => {
})

var self = this
self._deps.editor.event.register('breakpointCleared', (fileName, row) => {
Expand Down Expand Up @@ -70,15 +74,18 @@ function Debugger (container, sourceHighlighter, localRegistry) {
})

// register selected code item, highlight the corresponding source location
this.debugger.codeManager.event.register('changed', this, function (code, address, index) {
this.debugger_ui.event.register('indexChanged', function (index) {
if (self._deps.compiler.lastCompilationResult) {
self.debugger.callTree.sourceLocationTracker.getSourceLocationFromInstructionIndex(address, index, self._deps.compiler.lastCompilationResult.data.contracts, function (error, rawLocation) {
if (!error && self._deps.compiler.lastCompilationResult && self._deps.compiler.lastCompilationResult.data) {
var lineColumnPos = self._deps.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file, self._deps.compiler.lastCompilationResult.source.sources)
self._components.sourceHighlighter.currentSourceLocation(lineColumnPos, rawLocation)
} else {
self._components.sourceHighlighter.currentSourceLocation(null)
}
self.debugger.traceManager.getCurrentCalledAddressAt(index, (error, address) => {
if (error) return console.log(error)
self.debugger.callTree.sourceLocationTracker.getSourceLocationFromVMTraceIndex(address, index, self._deps.compiler.lastCompilationResult.data.contracts, function (error, rawLocation) {
if (!error && self._deps.compiler.lastCompilationResult && self._deps.compiler.lastCompilationResult.data) {
var lineColumnPos = self._deps.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file, self._deps.compiler.lastCompilationResult.source.sources)
self._components.sourceHighlighter.currentSourceLocation(lineColumnPos, rawLocation)
} else {
self._components.sourceHighlighter.currentSourceLocation(null)
}
})
})
}
})
Expand All @@ -91,9 +98,10 @@ function Debugger (container, sourceHighlighter, localRegistry) {
*/
Debugger.prototype.debug = function (txHash) {
var self = this
this.debugger.web3().eth.getTransaction(txHash, function (error, tx) {

this.debugger.web3.eth.getTransaction(txHash, function (error, tx) {
if (!error) {
self.debugger.debug(tx)
self.debugger_ui.debug(tx)
}
})
}
Expand Down Expand Up @@ -121,7 +129,7 @@ Debugger.prototype.switchProvider = function (type) {
* get the current provider
*/
Debugger.prototype.web3 = function (type) {
return this.debugger.web3()
return this.debugger.web3
}

module.exports = Debugger
5 changes: 2 additions & 3 deletions src/app/debugger/remix-debugger/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
<script type="text/javascript">
function loadDebugger() {
var container = document.getElementById('app')
container.debugger = new window.remix.ui.Debugger()
container.debugger.addProvider('INTERNAL')
container.debugger.switchProvider('INTERNAL')
var debuggerBackend = new window.remix.ui.DebuggerBackend({})
container.debugger = new window.remix.ui.Debugger({debugger: debuggerBackend})
container.appendChild(container.debugger.render())
}
</script>
Expand Down
6 changes: 4 additions & 2 deletions src/app/debugger/remix-debugger/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict'
var VMDebugger = require('./src/ui/VmDebugger')
var Debugger = require('./src/ui/Ethdebugger')
var Debugger = require('./src/ui/EthdebuggerUI')
var DebuggerBackend = require('@shyftnetwork/shyft_remix-debug').EthDebugger

if (typeof (module) !== 'undefined' && typeof (module.exports) !== 'undefined') {
module.exports = modules()
Expand All @@ -14,7 +15,8 @@ function modules () {
return {
ui: {
Debugger: Debugger,
VMdebugger: VMDebugger
VMdebugger: VMDebugger,
DebuggerBackend
}
}
}
1 change: 1 addition & 0 deletions src/app/debugger/remix-debugger/src/ui/ButtonNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function ButtonNavigator (_parent, _traceManager) {
this.revertionPoint = null

_parent.event.register('indexChanged', this, (index) => {
if (!this.view) return
if (index < 0) return
if (_parent.currentStepIndex !== index) return

Expand Down
10 changes: 5 additions & 5 deletions src/app/debugger/remix-debugger/src/ui/CalldataPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
var DropdownPanel = require('./DropdownPanel')
var yo = require('yo-yo')

function CalldataPanel (_parent, _traceManager) {
this.parent = _parent
function CalldataPanel (_parentUI, _traceManager) {
this._parentUI = _parentUI
this.traceManager = _traceManager
this.basicPanel = new DropdownPanel('Call Data', {json: true})
this.init()
Expand All @@ -15,15 +15,15 @@ CalldataPanel.prototype.render = function () {

CalldataPanel.prototype.init = function () {
var self = this
this.parent.event.register('indexChanged', this, function (index) {
this._parentUI.event.register('indexChanged', this, function (index) {
if (index < 0) return
if (self.parent.currentStepIndex !== index) return
if (self._parentUI.currentStepIndex !== index) return

self.traceManager.getCallDataAt(index, function (error, calldata) {
if (error) {
self.basicPanel.update({})
console.log(error)
} else if (self.parent.currentStepIndex === index) {
} else if (self._parentUI.currentStepIndex === index) {
self.basicPanel.update(calldata)
}
})
Expand Down
5 changes: 2 additions & 3 deletions src/app/debugger/remix-debugger/src/ui/CodeListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ var styles = styleGuide.chooser()
var css = csjs`
.instructions {
${styles.rightPanel.debuggerTab.box_Debugger}
width: 75%;
overflow-y: scroll;
max-height: 250px;
max-height: 150px;
}
`
function CodeListView (_parent, _codeManager) {
Expand All @@ -24,7 +23,7 @@ function CodeListView (_parent, _codeManager) {
this.address
this.codeView
this.itemSelected
this.basicPanel = new DropdownPanel('Instructions', {json: false})
this.basicPanel = new DropdownPanel('Instructions', {json: false, displayContentOnly: true})
this.basicPanel.event.register('hide', () => {
this.event.trigger('hide', [])
})
Expand Down
Loading