testCreateWalletRandom() passing;

implemented getRestoreHeight()
This commit is contained in:
woodser
2019-05-27 22:51:52 -04:00
parent 69f4420011
commit 5e2deef09b
2 changed files with 62 additions and 6 deletions
+24 -3
View File
@@ -61,7 +61,7 @@ void MoneroWallet::setDaemonConnection(const string& uri, const string& username
wallet2->set_daemon(uri, login, isTrusted);
}
MoneroRpcConnection MoneroWallet::getDaemonConnection() {
MoneroRpcConnection MoneroWallet::getDaemonConnection() const {
MoneroRpcConnection connection;
if (!wallet2->get_daemon_address().empty()) connection.uri = wallet2->get_daemon_address();
if (wallet2->get_daemon_login()) {
@@ -73,16 +73,37 @@ MoneroRpcConnection MoneroWallet::getDaemonConnection() {
return connection;
}
MoneroNetworkType MoneroWallet::getNetworkType() {
string MoneroWallet::getPath() const {
return wallet2->path();
}
MoneroNetworkType MoneroWallet::getNetworkType() const {
return static_cast<MoneroNetworkType>(wallet2->nettype());
}
string MoneroWallet::getLanguage() const {
return wallet2->get_seed_language();
}
string MoneroWallet::getMnemonic() const {
epee::wipeable_string wipeablePassword;
wallet2->get_seed(wipeablePassword);
return string(wipeablePassword.data(), wipeablePassword.size());
}
string MoneroWallet::getAddress(uint32_t accountIdx, uint32_t subaddressIdx) {
uint64_t MoneroWallet::getHeight() const {
return wallet2->get_blockchain_current_height();
}
uint64_t MoneroWallet::getChainHeight() const {
string err;
return wallet2->get_daemon_blockchain_height(err);
}
uint64_t MoneroWallet::getRestoreHeight() const {
return wallet2->get_refresh_from_block_height();
}
string MoneroWallet::getAddress(uint32_t accountIdx, uint32_t subaddressIdx) const {
return wallet2->get_subaddress_as_str({accountIdx, subaddressIdx});
}
+38 -3
View File
@@ -84,9 +84,25 @@ using namespace crypto;
*/
void setDaemonConnection(const string& uri, const string& username, const string& password);
MoneroRpcConnection getDaemonConnection();
/**
* TODO
*/
MoneroRpcConnection getDaemonConnection() const;
MoneroNetworkType getNetworkType();
/**
* TODO
*/
string getPath() const;
/**
* TODO
*/
MoneroNetworkType getNetworkType() const;
/**
* TODO
*/
string getLanguage() const;
// /**
// * Get the wallet's seed.
@@ -102,6 +118,25 @@ using namespace crypto;
*/
string getMnemonic() const;
/**
* Get the height of the last block processed by the wallet (its index + 1).
*
* @return the height of the last block processed by the wallet
*/
uint64_t getHeight() const;
/**
* Get the blockchain's height.
*
* @return the block chain's height
*/
uint64_t getChainHeight() const;
/**
* TODO
*/
uint64_t getRestoreHeight() const;
/**
* Get the address of a specific subaddress.
*
@@ -109,7 +144,7 @@ using namespace crypto;
* @param subaddressIdx specifies the subaddress index within the account
* @return the receive address of the specified subaddress
*/
string getAddress(uint32_t accountIdx, uint32_t subaddressIdx);
string getAddress(uint32_t accountIdx, uint32_t subaddressIdx) const;
// --------------------------------- PRIVATE --------------------------------