Support 2.0.5 sapling turnstile

This commit is contained in:
Aditya Kulkarni
2019-05-22 13:17:57 -07:00
parent 43f802d7ac
commit fcb68823a7
7 changed files with 331 additions and 6 deletions

View File

@@ -31,6 +31,15 @@ struct WatchedTx {
std::function<void(QString, QString)> error;
};
struct MigrationStatus {
bool available; // Whether the underlying zcashd supports migration?
bool enabled;
QString saplingAddress;
double unmigrated;
double migrated;
QList<QString> txids;
};
class RPC
{
public:
@@ -88,10 +97,14 @@ public:
Turnstile* getTurnstile() { return turnstile; }
Connection* getConnection() { return conn; }
const MigrationStatus* getMigrationStatus() { return &migrationStatus; }
void setMigrationStatus(bool enabled);
private:
void refreshBalances();
void refreshTransactions();
void refreshMigration();
void refreshSentZTrans();
void refreshReceivedZTrans(QList<QString> zaddresses);
@@ -108,6 +121,7 @@ private:
void getZAddresses (const std::function<void(json)>& cb);
void getTAddresses (const std::function<void(json)>& cb);
Connection* conn = nullptr;
QProcess* ezcashd = nullptr;
@@ -130,6 +144,9 @@ private:
MainWindow* main;
Turnstile* turnstile;
// Sapling turnstile migration status (for the zcashd v2.0.5 tool)
MigrationStatus migrationStatus;
// Current balance in the UI. If this number updates, then refresh the UI
QString currentBalance;
};