|
|
@ -1000,6 +1000,7 @@ void Main::on_mine_triggered() |
|
|
|
|
|
|
|
void Main::on_send_clicked() |
|
|
|
{ |
|
|
|
debugFinished(); |
|
|
|
u256 totalReq = value() + fee(); |
|
|
|
m_client->lock(); |
|
|
|
for (auto i: m_myKeys) |
|
|
@ -1007,8 +1008,27 @@ void Main::on_send_clicked() |
|
|
|
{ |
|
|
|
m_client->unlock(); |
|
|
|
Secret s = i.secret(); |
|
|
|
if (ui->enableDebug->isChecked()) |
|
|
|
if (isCreation()) |
|
|
|
m_client->transact(s, value(), m_data, m_init, ui->gas->value(), gasPrice()); |
|
|
|
else |
|
|
|
m_client->transact(s, value(), fromString(ui->destination->currentText()), m_data, ui->gas->value(), gasPrice()); |
|
|
|
refresh(); |
|
|
|
return; |
|
|
|
} |
|
|
|
m_client->unlock(); |
|
|
|
statusBar()->showMessage("Couldn't make transaction: no single account contains at least the required amount."); |
|
|
|
} |
|
|
|
|
|
|
|
void Main::on_debug_clicked() |
|
|
|
{ |
|
|
|
debugFinished(); |
|
|
|
u256 totalReq = value() + fee(); |
|
|
|
m_client->lock(); |
|
|
|
for (auto i: m_myKeys) |
|
|
|
if (m_client->state().balance(i.address()) >= totalReq) |
|
|
|
{ |
|
|
|
m_client->unlock(); |
|
|
|
Secret s = i.secret(); |
|
|
|
m_client->lock(); |
|
|
|
m_executiveState = state(); |
|
|
|
m_client->unlock(); |
|
|
@ -1044,15 +1064,6 @@ void Main::on_send_clicked() |
|
|
|
initDebugger(); |
|
|
|
m_currentExecution.reset(); |
|
|
|
updateDebugger(); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (isCreation()) |
|
|
|
m_client->transact(s, value(), m_data, m_init, ui->gas->value(), gasPrice()); |
|
|
|
else |
|
|
|
m_client->transact(s, value(), fromString(ui->destination->currentText()), m_data, ui->gas->value(), gasPrice()); |
|
|
|
refresh(); |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
m_client->unlock(); |
|
|
@ -1065,14 +1076,6 @@ void Main::on_create_triggered() |
|
|
|
m_keysChanged = true; |
|
|
|
} |
|
|
|
|
|
|
|
void Main::on_enableDebug_triggered() |
|
|
|
{ |
|
|
|
ui->debugPanel->setEnabled(ui->enableDebug->isChecked()); |
|
|
|
ui->send->setText(ui->enableDebug->isChecked() ? "D&ebug" : "&Execute"); |
|
|
|
if (!ui->enableDebug->isChecked()) |
|
|
|
debugFinished(); |
|
|
|
} |
|
|
|
|
|
|
|
void Main::on_debugStep_triggered() |
|
|
|
{ |
|
|
|
ui->debugTimeline->setValue(ui->debugTimeline->value() + 1); |
|
|
@ -1088,18 +1091,14 @@ void Main::debugFinished() |
|
|
|
ui->debugStorage->setHtml(""); |
|
|
|
ui->debugStateInfo->setText(""); |
|
|
|
ui->send->setEnabled(true); |
|
|
|
ui->enableDebug->setEnabled(true); |
|
|
|
ui->debugStep->setEnabled(false); |
|
|
|
ui->debugContinue->setEnabled(false); |
|
|
|
ui->debugPanel->setEnabled(false); |
|
|
|
} |
|
|
|
|
|
|
|
void Main::initDebugger() |
|
|
|
{ |
|
|
|
ui->send->setEnabled(false); |
|
|
|
ui->enableDebug->setEnabled(false); |
|
|
|
ui->debugStep->setEnabled(true); |
|
|
|
ui->debugContinue->setEnabled(true); |
|
|
|
ui->debugPanel->setEnabled(true); |
|
|
|
ui->debugCode->setEnabled(false); |
|
|
|
ui->debugTimeline->setMinimum(0); |
|
|
|