"testnet" is default parameter

This commit is contained in:
Ilya Kitaev 2016-03-31 15:39:28 +03:00
parent caf0e02787
commit 9cdf0b7d7f
2 changed files with 11 additions and 3 deletions

View File

@ -31,6 +31,7 @@
#include "wallet2_api.h" #include "wallet2_api.h"
#include "wallet2.h" #include "wallet2.h"
#include "mnemonics/electrum-words.h" #include "mnemonics/electrum-words.h"
#include "cryptonote_core/cryptonote_format_utils.h"
#include <memory> #include <memory>
namespace epee { namespace epee {
@ -71,9 +72,11 @@ public:
std::string address() const; std::string address() const;
bool store(const std::string &path); bool store(const std::string &path);
bool init(const std::string &daemon_address, uint64_t upper_transaction_size_limit); bool init(const std::string &daemon_address, uint64_t upper_transaction_size_limit);
bool connectToDaemon();
uint64_t balance() const; uint64_t balance() const;
uint64_t unlockedBalance() const; uint64_t unlockedBalance() const;
bool connectToDaemon(); std::string displayAmount(uint64_t amount) const;
private: private:
void clearStatus(); void clearStatus();
@ -285,6 +288,11 @@ uint64_t WalletImpl::unlockedBalance() const
return m_wallet->unlocked_balance(); return m_wallet->unlocked_balance();
} }
std::string WalletImpl::displayAmount(uint64_t amount) const
{
return cryptonote::print_money(amount);
}
bool WalletImpl::connectToDaemon() bool WalletImpl::connectToDaemon()
{ {
bool result = m_wallet->check_connection(); bool result = m_wallet->check_connection();
@ -387,4 +395,5 @@ WalletManager *WalletManagerFactory::getWalletManager()
return g_walletManager; return g_walletManager;
} }
} }

View File

@ -71,6 +71,7 @@ struct Wallet
virtual bool connectToDaemon() = 0; virtual bool connectToDaemon() = 0;
virtual uint64_t balance() const = 0; virtual uint64_t balance() const = 0;
virtual uint64_t unlockedBalance() const = 0; virtual uint64_t unlockedBalance() const = 0;
virtual std::string displayAmount(uint64_t amount) const = 0;
// TODO? // TODO?
// virtual uint64_t unlockedDustBalance() const = 0; // virtual uint64_t unlockedDustBalance() const = 0;
}; };
@ -119,8 +120,6 @@ struct WalletManager
virtual std::string errorString() const = 0; virtual std::string errorString() const = 0;
// //! set // //! set
// virtual void setDaemonAddress(const std::string &address) = 0; // virtual void setDaemonAddress(const std::string &address) = 0;
}; };