Skip to content

Commit

Permalink
Be better at coding and reading documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
area committed Sep 13, 2021
1 parent 046c4bf commit 6ad5dd8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/reputation-miner/bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,23 @@ class RetryProvider extends ethers.providers.JsonRpcProvider {
this.adapter = adapterObject;
}

static attemptCheck(err, attemptNumber){
if (attemptNumber === 11){
attemptCheck(err, attemptNumber){
if (attemptNumber === 10){
this.adapter.error(err);
return false;
}
return true;
}

getNetwork(){
const that = this;
return backoff(() => super.getNetwork(), {retry: that.attemptCheck});
return backoff(() => super.getNetwork(), {retry: this.attemptCheck});
}

// This should return a Promise (and may throw erros)
// method is the method name (e.g. getBalance) and params is an
// object with normalized values passed in, depending on the method
perform(method, params) {
const that = this;
return backoff(() => super.perform(method, params), {retry: that.attemptCheck});
return backoff(() => super.perform(method, params), {retry: this.attemptCheck});
}
}

Expand Down

0 comments on commit 6ad5dd8

Please sign in to comment.