Skip to content

Commit

Permalink
Add method verifyConnections
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulBernier committed Nov 4, 2018
1 parent d05a7ee commit 5434948
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dist/factom-vote-struct.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/factom-vote.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "factom-vote",
"version": "0.1.1",
"version": "0.1.2",
"description": "JS implementation of the Factom voting specification",
"main": "src/factom-vote.js",
"scripts": {
Expand Down
13 changes: 13 additions & 0 deletions src/factom-vote-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ class FactomVoteManager {
}
}

async verifyConnections() {
try {
await this.cli.factomdApi('properties');
} catch(e) {
throw new Error(`Failed to connect to factomd: ${e.message}`);
}
try {
await this.cli.walletdApi('properties');
} catch(e) {
throw new Error(`Failed to connect to walletd: ${e.message}`);
}
}

createVoteRegistrationChain(ecAddress, nonce) {
return createVoteRegistrationChain(this.cli, nonce, ecAddress);
}
Expand Down

0 comments on commit 5434948

Please sign in to comment.