Clean up tx send logic for clarity

This commit is contained in:
Aditya Kulkarni
2018-10-21 22:28:51 -07:00
parent fdcd1c32ab
commit e154f18c79
5 changed files with 107 additions and 78 deletions

View File

@@ -7,6 +7,8 @@
class RPC;
class Settings;
using json = nlohmann::json;
// Struct used to hold destination info when sending a Tx.
struct ToFields {
QString addr;
@@ -15,6 +17,11 @@ struct ToFields {
QString encodedMemo;
};
struct Tx {
QString fromAddr;
QList<ToFields> toAddrs;
};
namespace Ui {
class MainWindow;
}
@@ -45,6 +52,10 @@ private:
void removeExtraAddresses();
void setDefaultPayFrom();
Tx createTxFromSendPage();
bool confirmTx(Tx tx, ToFields devFee);
void fillTxJsonParams(json& params, Tx tx);
void cancelButton();
void sendButton();
void inputComboTextChanged(const QString& text);
@@ -60,7 +71,7 @@ private:
void memoButtonClicked(int number);
void setMemoEnabled(int number, bool enabled);
QString doSendTxValidations(QString fromAddr, QList<ToFields> toAddrs);
QString doSendTxValidations(Tx tx);
void donate();
void importPrivKeys();