Skip to content

Commit

Permalink
setAPIurl fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SloRunner committed Sep 17, 2020
1 parent a50044f commit 8d375cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ module.exports = class Ethermine {
}
setAPIurl(url = 'https://api.ethermine.org', callback){
let validapi = ['https://api.ethermine.org', 'https://api-zcash.flypool.org', 'https://api-ycash.flypool.org', 'https://api-etc.ethermine.org', 'https://api-beam.flypool.org', 'https://api-ravencoin.flypool.org'];
if (url in validapi) {
if (validapi.indexOf(url) > -1) {
this.apiurl = url;
callback(true, 'API URL set to: ' + url);
callback(false, 'API URL set to: ' + url);
}else{
callback(true, 'API not supported');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe('setAPIurl() test', function() {
describe('setAPIurl() test', function() {
it('changes the api endpoint based on whitelist, not whitelisted domain', function(){
ethermine.setAPIurl('https://example.com', function(err, data){
expect(err).to.be.equal(false);
expect(err).to.be.equal(true);
expect(data).to.be.a('string')
})
})
Expand Down

0 comments on commit 8d375cb

Please sign in to comment.