Skip to content

Commit

Permalink
Add explanation to getWaitForNSubmissionsPromise
Browse files Browse the repository at this point in the history
  • Loading branch information
area authored and kronosapiens committed Aug 23, 2022
1 parent 6d7af66 commit d77bfcf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions helpers/test-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,9 @@ exports.getWaitForNSubmissionsPromise = async function getWaitForNSubmissionsPro
return new Promise(function (resolve, reject) {
repCycleEthers.on("ReputationRootHashSubmitted", async (_miner, _hash, _nLeaves, _jrh, _entryIndex, event) => {
let nSubmissions;
// If we've passed in a hash, we check how many submissions that hash in particular has
// If not, and we're just waiting for N submissions from any hash, we lookup the number of
// submissions the hash in the emitted event that triggered this function has
if (rootHash === _hash) {
nSubmissions = await repCycleEthers.getNSubmissionsForHash(rootHash, nLeaves, jrh);
} else {
Expand Down

0 comments on commit d77bfcf

Please sign in to comment.