src/utils/index.js
function increaseBlockRecursively(provider, count, total, callback) {
  // if the count hits the total, stop the recursion
  if (count >= total) {
    callback(null, true);
  } else {
    // else mine a block
    provider.sendAsync({
      method: 'evm_mine',
    }, (mineError) => {
      if (mineError) {
        callback(`while mining to increase block: ${JSON.stringify(mineError)}`, null);
      } else {
        increaseBlockRecursively(provider, count + 1, total, callback);
      }
    });
  }
}
function increaseBlockRecursively(provider, count, total, callback) {
  // if the count hits the total, stop the recursion
  if (count >= total) {
    callback(null, true);
  } else {
    // else mine a block
    provider.sendAsync({
      method: 'evm_mine',
    }, (mineError) => {
      if (mineError) {
        callback(`while mining to increase block: ${JSON.stringify(mineError)}`, null);
      } else {
        increaseBlockRecursively(provider, count + 1, total, callback);
      }
    });
  }
}
function increaseBlockRecursively ( provider , count , total , callback ) { // if the count hits the total, stop the recursion if ( count >= total ) { callback ( null , true ) ; } else { // else mine a block provider . sendAsync ( { method : 'evm_mine' , } , ( mineError ) => { if ( mineError ) { callback ( ` ${ JSON . stringify ( mineError ) } ` , null ) ; } else { increaseBlockRecursively ( provider , count + 1 , total , callback ) ; } } ) ; } }
increase the TestRPC blocks by a specific count recursively
increase the TestRPC blocks by a specific count recursively