<commit_before>import debugModule from "debug";
const debug = debugModule("debugger:web3:sagas");

import {
  all,
  takeEvery,
  apply,
  fork,
  join,
  take,
  put
} from "redux-saga/effects";
import { prefixName } from "lib/helpers";

import * as actions from "../actions";
import * as session from "lib/session/actions";

import Web3Adapter from "../adapter";

function* fetchTransactionInfo(adapter, { txHash }) {
  debug("inspecting transaction");
  var trace;
  try {
    trace = yield apply(adapter, adapter.getTrace, [txHash]);
  } catch (e) {
    debug("putting error");
    yield put(actions.error(e));
    return;
  }

  debug("got trace");
  yield put(actions.receiveTrace(trace));

  let tx = yield apply(adapter, adapter.getTransaction, [txHash]);
  let receipt = yield apply(adapter, adapter.getReceipt, [txHash]);

  yield put(session.saveTransaction(tx));
  yield put(session.saveReceipt(receipt));

  if (tx.to != null) {
    yield put(actions.receiveCall({ address: tx.to, data: tx.input }));
    return;
  }

  if (receipt.contractAddress) {
    yield put(actions.receiveCall({ binary: tx.input, data: "0x" }));
    return;
  }

  throw new Error(
    "Could not find contract associated with transaction. " +
      "Please make sure you're debugging a transaction that executes a " +
      "contract function or creates a new contract."
  );
}
<commit_msg>Revert "Add empty calldata for initial creation call"<commit_after>import debugModule from "debug";
const debug = debugModule("debugger:web3:sagas");

import {
  all,
  takeEvery,
  apply,
  fork,
  join,
  take,
  put
} from "redux-saga/effects";
import { prefixName } from "lib/helpers";

import * as actions from "../actions";
import * as session from "lib/session/actions";

import Web3Adapter from "../adapter";

function* fetchTransactionInfo(adapter, { txHash }) {
  debug("inspecting transaction");
  var trace;
  try {
    trace = yield apply(adapter, adapter.getTrace, [txHash]);
  } catch (e) {
    debug("putting error");
    yield put(actions.error(e));
    return;
  }

  debug("got trace");
  yield put(actions.receiveTrace(trace));

  let tx = yield apply(adapter, adapter.getTransaction, [txHash]);
  let receipt = yield apply(adapter, adapter.getReceipt, [txHash]);

  yield put(session.saveTransaction(tx));
  yield put(session.saveReceipt(receipt));

  if (tx.to != null) {
    yield put(actions.receiveCall({ address: tx.to, data: tx.input }));
    return;
  }

  if (receipt.contractAddress) {
    yield put(actions.receiveCall({ binary: tx.input }));
    return;
  }

  throw new Error(
    "Could not find contract associated with transaction. " +
      "Please make sure you're debugging a transaction that executes a " +
      "contract function or creates a new contract."
  );
}

{'fraction_non_alphanumeric': 0.1349605168700646, 'fraction_numerical': 0.0017946877243359654, 'mean_word_length': 3.8554006968641117, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4548586', 'n_tokens_mistral': 889, 'n_tokens_neox': 858, 'n_words': 247}