Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"electron-compile": "^6.4.2",
"electron-settings": "^3.1.2",
"electron-squirrel-startup": "^1.0.0",
"ethereumjs-testrpc": "^4.1.3",
"ethereumjs-testrpc": "^6.0.1",
"ethereumjs-units": "^0.2.0",
"find-process": "^1.1.0",
"lodash": "^3.10.1",
Expand Down
9 changes: 8 additions & 1 deletion src/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,19 @@ function startServer(options) {
oldSendAsync(payload, callback)
}

server.listen(options.port, options.hostname, function(err, state) {
server.listen(options.port, options.hostname, function(err, result) {
if (err) {
process.send({type: 'start-error', data: err});
return
}

var state = result ? result : server.provider.manager.state;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a small workaround to an issue I accidentally introduced during the 6.x dev cycle (server callback isn't passed the state object anymore). With the way this is written fixing the problem won't break ganache.

I was dumb and released ganache-core before I found this issue (will test better next time), so rather than pushing out yet another release, I just created this workaround. Will fix the issue in the next ganache-core release.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks for the writeup!


if (!state) {
process.send({type: 'start-error', data: "Couldn't get a reference to TestRPC's StateManager."});
return
}

var data = {
mnemonic: state.mnemonic,
hdPath: state.wallet_hdpath,
Expand Down