src/blockchain/normalizer.js
/**
   * attempts to broadcast a tx. Will successfully resolve as soon as a txHash is
   * returned. Does not wait for the tx to be mined to resolve. Otherwise will fail.
   *
   * @param {function} method the fn to pass to lockNonceAndSendTransaction
   * @param {object} opts the opts to pass to lockNonceAndSendTransaction
   * @param {*} arg  the fn argument to pass to lockNonceAndSendTransaction
   */
attempts to broadcast a tx. Will successfully resolve as soon as a txHash is
returned. Does not wait for the tx to be mined to resolve. Otherwise will fail.

@param {function} method the fn to pass to lockNonceAndSendTransaction
@param {object} opts the opts to pass to lockNonceAndSendTransaction
@param {*} arg  the fn argument to pass to lockNonceAndSendTransaction
attempts to broadcast a tx . Will successfully resolve as soon as a txHash is returned . Does not wait for the tx to be mined to resolve . Otherwise will fail . @param { function } method the fn to pass to lockNonceAndSendTransaction @param { object } opts the opts to pass to lockNonceAndSendTransaction @param { * } arg the fn argument to pass to lockNonceAndSendTransaction
function sendTx(method, opts, arg) {
    return new Promise((resolve, reject) => {
      const onRejected = e => {
        logger.info('Normalizer sendTx lockNonceAndSendTransaction()', {
          opts,
          arg,
          method,
          error: e,
        });
        reject(e);
      };
      lockNonceAndSendTransaction(web3, method, opts, arg)
        .on('transactionHash', () => {
          logger.info('Normalizer sendTx lockNonceAndSendTransaction() response', {
            opts,
            method,
            arg,
          });
          resolve();
        })
        .on('error', onRejected)
        .catch(onRejected);
    });
  }
function sendTx ( method , opts , arg ) { return new Promise ( ( resolve , reject ) => { const onRejected = e => { logger . info ( 'Normalizer sendTx lockNonceAndSendTransaction()' , { opts , arg , method , error : e , } ) ; reject ( e ) ; } ; lockNonceAndSendTransaction ( web3 , method , opts , arg ) . on ( 'transactionHash' , ( ) => { logger . info ( 'Normalizer sendTx lockNonceAndSendTransaction() response' , { opts , method , arg , } ) ; resolve ( ) ; } ) . on ( 'error' , onRejected ) . catch ( onRejected ) ; } ) ; }
attempts to broadcast a tx.
attempts to broadcast a tx .
// if we have a txHash, then the tx was submitted and successfully estimatedGas // if it fails at this point, we will retry in the next poll