Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to fetch #692

Closed
Gannervi opened this issue Jul 4, 2018 · 0 comments
Closed

Failed to fetch #692

Gannervi opened this issue Jul 4, 2018 · 0 comments

Comments

@Gannervi
Copy link

Gannervi commented Jul 4, 2018

TypeError: Failed to fetch 
 While processing action: 
 function (dispatch, getState, api) {
    return api.geth.eth.getBlockByNumber('pending', true).then(function (result) {
      var addrs = getState().accounts.get('accounts').map(function (acc) {
        return acc.get('id');
      });
      var txes = result.transactions.filter(function (t) {
        return addrs.includes(t.to) || addrs.includes(t.from);
      });
      // TODO: dependency on wallet/history module
      dispatch(_history2.default.actions.processPending(txes));
      var _iteratorNormalCompletion = true;
      var _didIteratorError = false;
      var _iteratorError = undefined;

      try {
        for (var _iterator = txes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
          var tx = _step.value;

          var disp = {
            type: _actionTypes2.default.PENDING_BALANCE,
            value: tx.value,
            gas: tx.gas,
            gasPrice: tx.gasPrice,
            from: '',
            to: ''
          };
          if (addrs.includes(tx.from)) {
            disp.from = tx.from;
            dispatch(disp);
          }
          if (addrs.includes(tx.to)) {
            disp.to = tx.to;
            dispatch(disp);
          }
        }
      } catch (err) {
        _didIteratorError = true;
        _iteratorError = err;
      } finally {
        try {
          if (!_iteratorNormalCompletion && _iterator.return) {
            _iterator.return();
          }
        } finally {
          if (_didIteratorError) {
            throw _iteratorError;
          }
        }
      }
    });
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants