def _refresh_storage(self, addr: Address = None): """ Helper function that refreshes the displayed storage table widget with values for the specified address. """ self._clear_table_widget(TableWidgetEnum.STORAGE) if addr is None: return self.ui.storage_address_label.setText("Address: 0x" + addr.hex()) self.ui.storage_address_label.setToolTip( "Showing storage for address: 0x" + addr.hex()) lkp = self.storage_lookup.get(addr) if lkp is not None: for i in range(0, len(lkp.keys())): self.ui.storage_table_widget.insertRow(i) for slot in lkp.keys(): value = hex(self.evm_handler.get_storage_at( addr, int(slot, 0))) k = QTableWidgetItem() v = QTableWidgetItem() k.setText(slot) v.setText(value) v.setTextAlignment(130) self.ui.storage_table_widget.setItem(lkp.get(slot), 0, k) self.ui.storage_table_widget.setItem(lkp.get(slot), 1, v)
def contract_created_signal_cb(self, addr: Address): cb: QComboBox = self.ui.select_address_combobox if addr != b'': self.current_contract.set_address(addr.hex()) a = self.current_contract.get_readable_address() self.relevant_addresses[a] = self.current_contract self._refresh_statusbar("Mined new Contract at address " + a) cb.currentIndexChanged.disconnect() cb.clear() for addr in self.relevant_addresses.values(): if self.evm_handler.get_code(addr.get_typed_address()) != b'': cb.addItem(addr.get_readable_address()) cb.currentIndexChanged.connect(self.contract_selected) cb.setCurrentIndex(cb.count() - 1) if cb.count() == 1: self.contract_selected() else: self._refresh_statusbar("Error processing transaction.") self.post_transaction_handling()