index.js
function(rawTx) {
  const rawTxMutation = Object.assign({}, rawTx);

  // fix rawTx gaslimit
  if (typeof rawTxMutation.gas !== 'undefined') {
    rawTxMutation.gasLimit = rawTxMutation.gas;
    delete rawTxMutation.gas;
  }

  // fix data by prefixing it with zero
  if (typeof rawTxMutation.data !== 'undefined'
      && rawTxMutation.data.slice(0, 2) !== '0x') {
    rawTxMutation.data = '0x' + rawTxMutation.data;
  }

  // return new mutated raw tx object
  return rawTxMutation;
}
function(rawTx) {
  const rawTxMutation = Object.assign({}, rawTx);

  // fix rawTx gaslimit
  if (typeof rawTxMutation.gas !== 'undefined') {
    rawTxMutation.gasLimit = rawTxMutation.gas;
    delete rawTxMutation.gas;
  }

  // fix data by prefixing it with zero
  if (typeof rawTxMutation.data !== 'undefined'
      && rawTxMutation.data.slice(0, 2) !== '0x') {
    rawTxMutation.data = '0x' + rawTxMutation.data;
  }

  // return new mutated raw tx object
  return rawTxMutation;
}
function ( rawTx ) { const rawTxMutation = Object . assign ( { } , rawTx ) ; // fix rawTx gaslimit if ( typeof rawTxMutation . gas !== 'undefined' ) { rawTxMutation . gasLimit = rawTxMutation . gas ; delete rawTxMutation . gas ; } // fix data by prefixing it with zero if ( typeof rawTxMutation . data !== 'undefined' && rawTxMutation . data . slice ( 0 , 2 ) !== '0x' ) { rawTxMutation . data = '0x' + rawTxMutation . data ; } // return new mutated raw tx object return rawTxMutation ; }
fix ethereumjs-tx rawTx object
fix ethereumjs - tx rawTx object