Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Fix not working example of get "eth_accounts" #2572

Closed
Closed
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
5 changes: 3 additions & 2 deletions src/packages/ganache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,11 @@ server.listen(PORT, err => {

console.log(`ganache listening on port ${PORT}...`);
const provider = server.provider;
const accounts = await provider.request({
provider.request({
method: "eth_accounts",
params: []
});
}).then(accounts => console.log(accounts));

Copy link
Member

Choose a reason for hiding this comment

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

This should probably be:

server.listen(PORT, async (err) => {
  if (err) throw err;
  console.log(`ganache listening on port ${PORT}...`);
  const provider = server.provider;
  const accounts = await provider.request({
    method: "eth_accounts",
    params: []
  });

});
```

Expand Down